« first day (1487 days earlier)      last day (3686 days later) » 

18:00
@rightføld I have seen public static void main(String[] args) throws IOException :-D
@rightføld yeah, I sometimes just lose it and do throws Throwable
user1804599
lol
user1804599
In our Android app for college we just did catch (Exception e) { throw new RuntimeException(e); } everywhere.
@rightføld I agree, I just find it funny that people hate it and hate dynamic typing at the same time
@rightføld I don't know why they didn't remove the checked exception requirement in the compiler in java 5 or 6 or 7 or 8. I don't know a single person that likes it.
Xeo
Xeo
18:01
@StackedCrooked The Grisaia characters are just so lovable!
public static void doThingsToDo(Parameter firstParameter, Parameter secondParameter) throws Throwable
@BenjaminGruenbaum James Gosling
@FredOverflow James Gosling said 2 years ago he would not use Java for 'for fun' projects and he recommends people learn scala.
@BenjaminGruenbaum link or didn't happen
the pain
user1804599
18:03
@FredOverflow here's a link
user1804599
ok what language to use for a tool that just reads a file's contents, parses them and uploads data to a server.
user1804599
In a loop.
goo.gl/1TzFEl
@rightføld PHP?
user1804599
> .blackfriday
18:04
@rightføld describe 'parses them'
user1804599
@FredOverflow ugh no
@Xeo esp Sacchi :)
user1804599
@BenjaminGruenbaum pretty much split on spaces and parse integers
@BenjaminGruenbaum its not friday -_-
@rightføld JS with node and promises makes it trivial, C# is also another obvious choice, I think it's a simple enough task to just choose the language currently syntactically highlighted in the editor.
user1804599
Well, except C++, I'd use every language except C++ for that task.
user1804599
Yeah.
user1804599
Even parsing an integer without risking UB is an impossible task in C++.
6
@rightføld Wanna try and break my primitive repl, now with GUI as of today? :)
user1804599
> unknown identifier bukkake
user1804599
18:07
Nice.
user1804599
> About Main
> Version 1.0 (1.0)
@rightføld What is that? I certainly didn't assign version numbers to my classes...
user1804599
@BenjaminGruenbaum Oh I also have to seek the file.
user1804599
Or reopen it every time, that's fine too.
user1804599
@FredOverflow OS X GUI programs must have a menu bar, so Java just gives default one with an About menu item.
18:10
ah
@rightføld it's still pretty simple.
user1804599
Well just reopening every time is easier.
I can't open the java file for some reasons.
user1804599
SSCCE.
18:14
7 mins ago, by FredOverflow
@rightføld Wanna try and break my primitive repl, now with GUI as of today? :)
user1804599
I'll use Perl.
> The Java JAR file “frepl.jar” could not be launched.
user1804599
@Jefffrey java -jar frepl.jar
user1804599
Do you have Java installed?
So yesterday, I learned of a creative insult in Arabic
18:15
> Exception in thread "main" java.lang.UnsupportedClassVersionError: Main : Unsupported major.minor version 51.0
@rightføld yup
user1804599
Do you have JRE 1.8 installed?
It roughly translates to "May God let the sky rain dicks, so I can set your mom's vagina out to dry"
probably no
Do you have a keyboard?
@rightføld I have no idea what that is
but I'll find out
ow
18:17
Java, he's asking if you have java
JRE seems to be the Java Runtime Env
He is asking if I have 1.8 of that
Don't try to confuse me.
@Jefffrey letters don't match, try again
right
it's not machine, but environment
the whole ecosystem
> Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
@BartoszKP does that include the programmers?
18:20
you need 0.2 kg more
DECLINE DECLINE DECLINE
@Jefffrey once you dive into Java, you become part of it
lol 1.6
How is it in 2009
that's like the last time I used Java
so probably I also have 1.6
or less
@CatPlusPlus no justin bieber
almost
18:22
I've got to say.
I'm really surprised to see no SO questions discussing pros and cons of std::vector<object*> vs std::vector<object> when object is a non-primitive user-defined class
By "non-primitive" I mean, composed of more than primitive types (not just a simple struct)
@rightføld 1.7 should suffice
@caps std::vector<object*> is worse in almost any aspect
especially if object* is created by a new
std::vector<std::unique_ptr<object>> now_shut_up;
@FredOverflow Not available pre-C++11
4
Q: Should my std::vector contain pointers or structs?

JohnI know that holding pointers incurs the overhead of an extra dereference operation but it saves me including the (potentially large) header file that contains the definition of my struct. However my preference is to be determined by the advantage of having a std::vector<myStruct> *ptr2Vect membe...

18:25
boost::unique_ptr<object> available;
95
Q: C++ STL: should I store entire objects, or pointers to objects?

StéphaneDesigning a new system from scratch. I'll be using the STL to store lists and maps of certain long-live objects. Question: Should I ensure my objects have copy constructors and store copies of objects within my STL containers, or is it generally better to manage the life & scope myself and jus...

9
Q: Pointer to vector vs vector of pointers vs pointer to vector of pointers

LisaJust wondering what you think is the best practice regarding vectors in C++. If I have a class containing a vector member variable. When should this vector be declared a: "Whole-object" vector member varaiable containing values, i.e. vector<MyClass> my_vector; Pointer to a vector, i.e vector<M...

@caps std::vector<boost::unique_ptr<object>> what_about_now;
@FredOverflow Even so, aren't there tradeoffs when object is of a non-trivial size and the vector can be large?
don't think like a compiler
@caps You want to have as little indirections as possible. Every star hurts cache predictability.
18:26
and then I hurt you
for every star you have
@Jefffrey boost is not available in this instance either
then all you have available is C
congrats
@Jefffrey and the STL
@caps how is it "not available"? you can't do #include?
I'm not saying I like these constraints or that I chose them--they are the constraints that I have.
@BartoszKP Vetoed by co-worker/project manager.
18:28
@BartoszKP Maybe his # key is broken.
lol
Don't work with C++
@caps Are you allowed to use std::string at least?
@caps will they be happy if you rewrite unique_ptr and put it in this_is_so_not_boost/just_my_idea_for_ptr_unlike_boost_ptr.hpp ?
@BartoszKP They'd be pretty pissed if I did that.
@FredOverflow Of course. Everything in the STL for C++0x is available.
@caps Interesting. Are you allowed to write code?
4
18:29
Plus all of our compiler-specific stuff (AnsiString, UnicodeString, etc.)
@BartoszKP lol
Yes.
@caps ok, are you allowed to write classes and use templates?
But I did have to go and replace my neat little semi-RAII class ( coliru.stacked-crooked.com/a/403a00183ae586f5 ) with __try __finally { DeletePointers(container) }
@BartoszKP Yes, all the time.
@caps so, finally, are you allowed to create helper template classes that will make the code more readable, less error-prone, more maintainable etc.?
@BartoszKP Depends on the implementation. And how long they would take to write. And test. And debug when they break.
18:32
Hmm, folding expressions were adopted.
I tried to switch to vector<object> instead of vector<object*> after that but co-worker argued that vector<object> leads to much more memory fragmentation, and that you don't know what is used when the vector has to grow--memcpy? copy constructors? assignment operators? etc.
@caps well, then, ctrl-c ctrl-v from boost::unique_ptr (with attribution) is a zero-time effort. And it won't "break" - people use it for some time
@caps what's pointer in this case?
@BenjaminGruenbaum typo, fixed.
Ell
Ell
interesting behaiviour :p
18:35
@caps then use std::unique_ptr
@BenjaminGruenbaum For me the annoying part is that it spreads across boundaries like wildfire and pretty soon you're down throws Throwable out of desperation.
@caps is your co-worker a 'special' person?
@Mgetz That is C++11
@caps buahahahalol
@caps you said c++0x
that's a synonym for c++11
18:35
Because n+1 is less allocations than 3
@chris yay
@R.MartinhoFernandes I'm 'people' too so I agree :P I wonder why we can't type inference though.
@BartoszKP Such thing doesn't exist. unique_ptr relies on C++11 move semantics.
Have checked exceptions, but have them implicitly defined, so you only must deal with them (or terminate) at main and if you don't want to you can handle them at any level.
@BenjaminGruenbaum No, he's a developer with years and years more experience than I do. He learned C first, and it shows. He has written his own C++ implementations for all of the STL containers before.
18:36
@LucDanton It's weird to me (just because I'm not used to thinking of things that way yet), but it should get rid of some nice amounts of boilerplate in some cases.
It helps his argument here in that our current platform, Embarcadero XE6's 32-bit compiler (BCC32) is very non-standard in many ways (for instance, it adds a __try __finally)
@Mgetz Ah, I thought it meant pre-C++11. My bad.
@caps I think it's safe to say everyone here has implemented a bunch of containers before - that doesn't make using them a good idea.
Morning.
@caps that's c++03 or c++98
@BenjaminGruenbaum We use STL containers. The point is that one way or another he knows more about how they are implemented than I do. I am trying to remedy that.
18:37
@milleniumbug oh, I forgot. you can at least have scoped_ptr then
@Mgetz We are on C++03 then.
return (true + ... + args);
What a horrible example.
@caps that's a microsoft SEHish
are you targeting windows?
@Mgetz Yes. Almost certainly indefinitely.
@caps why would having an array of MyObject be less fragmented than an array of MyObject*?
18:39
@caps why not just use visual studio then?
s/array/vector/
@R.MartinhoFernandes lol
@Mgetz hahahahahahahahahahahahahaha...
Maybe he thinks a vector uses a linked list?
@caps VS2013 is a lot better than Embarcadero
@BenjaminGruenbaum No guarantee previously allocated memory is freed for this scope after a resize.
Borland C++ forever alive
@Mgetz That... says a lot.
@R.MartinhoFernandes IKR
@BenjaminGruenbaum Because the size of an int (pointer) is small, and the newed objects don't have to be allocated together.
18:41
How big are your lists?
600 unread messagtes
In my experience a vector<foo> is almost always much faster and more local than vector<foo*> not to mention the other issues with pointers.
@BenjaminGruenbaum s/vector/Vec/
@caps lol
18:41
@Mgetz I could get behind that, actually, but I don't think it would be feasible for us. Our codebase is too big to feasibly spend time moving over when there is new development to be done.
@BenjaminGruenbaum Often only 1-10 items large, but can occasionally be a few k.
@caps oh sure, your pointers are contiguous, but the actual data you care about.
@caps then I suggest you find another job if your management really thinks that
lol this caps guy
I feel for him
shitty codebases with shitty code are sometimes poor job choice
18:43
And if you have big objects, with on a small bit of data that helps determine if you want them, then consider a vector of some lightweight proxy object that have unique pointers to you big fat (probably wrong) main objects.
Wait
@Ell a is the first result, b the second, c the third etc.
@thecoshman Is scattered all over. Yes, less fast for iteration, but the objects aren't being re-allocated every time, so less fragmentation from that.
@caps benchmark, I'd bet you'll find that vector<foo> is not only much clearer, it's also much faster than vector<foo*> - it's not without losses though. You can't easily have polymorphism in a vector<foo>
otoh PHP developers choose to work with shitty codebases as a career choice
18:43
But hey look at the bright side
(At least not with inheritance)
Isn't C++11 supposed to be easy to move to?
@CatPlusPlus is there a bright side?
You could've had to deal with VC6 instead
@Jefffrey it is
18:43
@caps That's quite common, stupid attitude, and leads to nowhere (i.e. more crap until you have enough and leave)
@CatPlusPlus and be black, too.
Isn't that the whole backward compatibility idea that let us keep std::vector<bool>?
@BartekBanachewicz then why is this guy complaining about it?
@BartekBanachewicz Nah, I like this job. I like pretty much everything about it except working in this janky Delphi-hyprid pre-C++11.
it is, but people are dumb and terrible at programming
Upgrading compilers much is a lot of work for QA
18:44
@caps fyi vectors are contiguous. a certainly more so than the data pointed to, the data you acutually want.
@caps you write shitty code, too bad.
Esp because of UB
@BartekBanachewicz PHP code bases tend to be really simple though, and its execution model is trivial.
Unless you know 100% of the codebase really really well, and you're 100% sure there's no UB, upgrading compiler might break shit
@Jefffrey Yes and no.
18:45
Not to mention third party stuff
Because Embarcadero sucks.
@caps wait
@caps if you are spending time patching up a code base, you are wasting time. If you have to support it, support it properly, that means updating it as you go.
If you want C++11 you have to switch to 64-bit
Which is great!
Notice I say 'as you go', not rewrite the entire thing.
18:45
Except the IDE only runs in 32-bit
@caps So you got a job working with C++, but you have no idea what the implementation of std::vector is or what are its strength?
And yeah you have to have standard-compliant code in the first place
@CatPlusPlus ah sure, sup it and see :P
@caps That's not a problem
32-bit processes can spawn 64-bit processes :woah:
@Jefffrey lol
18:47
@BenjaminGruenbaum still shitty
Gah
Gah?
How do I search the freaking C++ lounge chat history for stuff I've said?
Gah!
Chat search sucks.
18:48
Hover over your profile, go to your profile.
on an unrelated note
Server-side Javascript is slowly reaching the levels of server-side Haskell... in 2009. #keepitgoing
I mean, I'm no C++ genius, but I'm also not paid to write C++.
When it comes to legacy code, you have three options. One; give up now, stop supporting it and move on, any bugs, though. Two; hack in solutions that just make more problems, this is very good as you'll be the only one who knows how it works, but so to did the previous guy and sooner or later this becomes option one. Three; any time you touch anything, take the time to think about what it is actually doing, update the code, start adding decent reusable code that you can slowly migrate towards.
I'm paid to write C++, but our code is pretty good.
At least you know what std::vector is
18:49
I'm paid to write Java AND our code base is shit!
But it's getting better slowly :)
@Jefffrey look at our room :)
@thecoshman Option one is never an option
Well almost
Option two is what everybody is doing, option three is what you dream about after doing option two and getting shitfaced to forget about it
2 days ago, by caps
I like a lot of things about my alma mater, and I even like my CS professors a great deal, but I feel like they failed in actually teaching me stuff I should have known.
I still can't believe anyone can get a Job in C++ without knowing what std::vector is. Did they review you at least?
@Nooble I do :D
@caps I share that feeling
18:51
@caps No, I'm not saying it's your fault.
Who doesn't know what std::vector is
@Nooble I know / knew what it is, but I don't think I ever thought much about the actual implementation details.
Rather, I knew how to use it and that it was way better than a raw array.
@CatPlusPlus caps
I mean
combo breaker
18:52
@caps "knew" ?
@CatPlusPlus Option three is what you have to do with out your bosses knowing.
the fuck is that supposed to mean
@BartekBanachewicz Still know.
also my tests pass yay.
> way better than a raw array
18:53
@BartekBanachewicz That I knew before the present time.
also I have to write JS now
5
@thecoshman lol
I'm actually taking a day next week with my team where we can basically look at pure improvement stuff.
@BartekBanachewicz yay!
18:53
@caps I think that should be "I had known" then
Like I want to improve shit from the goodness of my heart
std::vector is way better than a raw array
@BartekBanachewicz Fair enough. That is more clear.
wat
18:53
Haskell
Shit.
I'm still in the office.
also don't star my messages about javascript
2
it's not funny in the slightest
All the rage we have built over the last year focused on some decent structure. May take a while till it's in the production code, but at least we know it's there and being worked on. It'll be a regular thing.
for gods sake
That's not what you said on Facebook.
18:54
what did you expect
@CatPlusPlus oh no, we do it as part of bug fixing or the few 'features' we have to hack in somehow.
On Facebook @Bartek said he loves JavaScript and is really enjoying dynamic typing. That he wishes he could use it more.
3
Reviewing code from the TMP newb at 20.
Someone else will come and shit will be shit again
I should be at the pub.
18:55
Irish I were drunk too
@CatPlusPlus sure, but if they come in, either I will scold them for bad code, or I'm no longer working on it.
hehe
@CatPlusPlus So you were irish or drunk?
I'm surprised this compiled on MSVC.
wait, you are not irish
WHERE IS THE COMMA
@Xeo Btw, have you seen this?
It's pretty funny.
stop with this shit
The void stares back
POO, PILE OF
18:58
dafuq, Cat?
@CatPlusPlus Needs more pixelation.
@Jefffrey it's not shit it's art
same thing
guess so
18:59
It's shart.
@BenjaminGruenbaum the slut!
no one saw anything!

« first day (1487 days earlier)      last day (3686 days later) »