IT/Software career thread: Invert binary trees for dollars.

Khane

Got something right about marriage
19,933
13,472
Aside from the things you already mentioned it being better for it's also incredibly good at making the people who work with it think they're smarter than anyone who uses managed code.
 

Deathwing

<Bronze Donator>
16,446
7,460
Point taken, forgotten about for_each. In this case, no, because I want to iterate over the vector I have stashed in the value. But, that does potentially cut down on a considerable amount of clutter. My main problems with having to work in C++ again is readability and how much easier a lot of stuff is in other languages. I'll admit it may be a bit of rustiness too.


Tenks, you get the job yet?



Wow, didn't even know about 'auto'. Looks relatively new...C++11. I think this is another problem with C++ is the lack of centralized/authoritative documentation. If I google "iterate map C++", why am I shown examples of that bullshit from my previous post instead of for_each or auto? Having to maintain backwards compatibility of over two decades?
 

Vinen

God is dead
2,783
490
Point taken, forgotten about for_each. In this case, no, because I want to iterate over the vector I have stashed in the value. But, that does potentially cut down on a considerable amount of clutter. My main problems with having to work in C++ again is readability and how much easier a lot of stuff is in other languages. I'll admit it may be a bit of rustiness too.


Tenks, you get the job yet?



Wow, didn't even know about 'auto'. Looks relatively new...C++11. I think this is another problem with C++ is the lack of centralized/authoritative documentation. If I google "iterate map C++", why am I shown examples of that bullshit from my previous post instead of for_each or auto?
You mean the standard which nobody follows?

Fuck I don't miss C++. Macros were full blown aids to a codebase unless you have a strong technical lead that says NO YOU CANT DO THAT.
 

Tenks

Bronze Knight of the Realm
14,163
606
I haven't heard about the job and almost wouldn't expect to until later this week or next week realistically. They told me on average it takes about a week.

I would almost imply silence as a good thing this early on. Knowing I didn't curbstomp the interview the only way they could reach a consensus opinion quickly would be "This guy is functionally retarded."
 

Tenks

Bronze Knight of the Realm
14,163
606
Ah so C++ 'auto' is basically like var/def. I fucking hate duck typing. I can only imagine trying to read and understand C++ mixed in with duck types.
 

Deathwing

<Bronze Donator>
16,446
7,460
You mean the standard which nobody follows?

Fuck I don't miss C++. Macros were full blown aids to a codebase unless you have a strong technical lead that says NO YOU CANT DO THAT.
Yeah, think I complained about macros earlier. Want to read your code? TOO BAD! The amount of ifdefs needed just to get things to compile cross-platform is staggering.



Tenks, I would need a lambda function with the for_each, right?
 

Tenks

Bronze Knight of the Realm
14,163
606
I don't program C++ I have no idea what you do in that bizzaro world. I just saw your syntax and knew C++ supported collection iteration. But I'd have to assume you'd have to pass in your actual "what to do" somewhere so lambda seems like a proper fit.
 

Deathwing

<Bronze Donator>
16,446
7,460
Yeah, doesn't matter much. This stupid project I'm working on doesn't support C++0x(so no lambdas) nor C++11(so no range-based for loops).

frown.png


I agree that duck typing can be weird in strong typed languages. In this context, eh, not so much. You know the container's type and you know that the code is just iterating over each element, you don't really need strong typing there.

What about duck typing in languages that aren't strong typed?
 

Tenks

Bronze Knight of the Realm
14,163
606
Doesn't std::for_each pre-date the actual baked-in for each loop? Not that the std::for_each syntax looks too much prettier.
 

Tenks

Bronze Knight of the Realm
14,163
606
I can't speak to C++ since like I said I don't program in it but in Java before Lambdas existed you'd have a Function interface the method would accept and you'd define your logic in an anonymous inner class.

This appears similar

for_each
 

Deathwing

<Bronze Donator>
16,446
7,460
I can't speak to C++ since like I said I don't program in it but in Java before Lambdas existed you'd have a Function interface the method would accept and you'd define your logic in an anonymous inner class.

This appears similar

for_each
for_each - C++ Reference

has to be a unary function it seems.
Yeah, doing this without lambdas or even anonymous inner classes is pointless. I'm not going to create another function just to iterate over the vector inside the map. More localized clutter is better than disjointed clutter.

and here I am in C... still...
I'd almost prefer C...maybe. Would have to try it out first before really making up my mind which is the lesser evil.
 

Noodleface

A Mod Real Quick
37,961
14,508
Id rather use C than C++

One of the codebases for some drivers at my last job was C++ but then for the low level stuff it was just plain C. It was awful...
 

Tenks

Bronze Knight of the Realm
14,163
606
IMO its easier (far easier) to bastardize C++ than it is to bastardize C. But don't blame the language for an incompetent programmer writing terrible code.
 

Deathwing

<Bronze Donator>
16,446
7,460
That sounds familiar...didn't Torvalds say something similar to that. Something like C > C++ because most C++ programmers suck(proud member reporting)?
 

Vinen

God is dead
2,783
490
That sounds familiar...didn't Torvalds say something similar to that. Something like C > C++ because most C++ programmers suck(proud member reporting)?
The problem is the flexibility. C++ gives you enough rope to hang yourself and your neighbors unborn children.
 

Noodleface

A Mod Real Quick
37,961
14,508
So I think only Vinen knows where I work so I'm gonna post this awesome story.

Today was my first day back. Boss rushes over in a panic "are your local repositories up to date???"

Of course, they almost always are.

They went to backup and replicate our companies stash over the holiday weekend and somewhere something bad happened and they lost all the data. Still assessing damage and performing forensics but everything is gone and last snapshot was June 7th.

For me it's a little alarming since I'm the only person working in my code base. Could've lost a fuck load of commits.


Our company is primarily software driven though and some teams actually have real members and real working code.

I guess stash went down Friday and it's still down as of now. Not only could this be fairly catastrophic but also the loss of engineering hours. Daaaamn