Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Haha, I love this guy xD
@matanl then you're using it the wrong way^^ once you get the hang, it's fairly easy -
matanl26448y@Krokoklemme I have 2 years industrial experience with it, still find it much tougher than other languages
-
@matanl that's weird... May I ask what exactly you think is hard about it? Because I can't really think of anything ._.
Pointers aren't that hard, templates aren't that hard (tend to be pretty verbose though), memory management isn't hard (easier than Java's IMHO) -
matanl26448y@Krokoklemme
1. string and file manipulation in the "right" way is pretty unintuitive (could never read a file in a non-C way without looking it up on stackoverflow)
2. move semantics are very probe to mistake
3. I don't know about you but making my templated program compile well takes more time than a java/python program (or even a C one)
4. memory management, I again disagree with you, remembering where each variable resides (for example where an object goes when you return it from a function) is not trivial, especially when multithreading
5. Operator overloading tends to confuse me because it usually has side-effects which I need to remember
And there are more.. -
@matanl 1.) Yeah, string manipulation sucks in C++, but it's even worse in C
And for the files:
std::ifstream file("myfile.txt");
std::stringstream s;
s << file;
std::string file_content = s.str();
2.) Never did much with move semantics, admittedly
3.) That depends on how complex you're making your templated classes/functions, but personally I never had much trouble with them (except when I was learning them)
4.) It goes to the assigned value, or more specific to the EAX/RAX register
5.) What side-effects? What types were you using? Never had any trouble with that either
To be fair: I don't have any business experience with it, therefore we probably made different things anyway. -
matanl26448y@Krokoklemme
1.) I agree about C.. Yesterday I've tried to tokenize a string and it took about 3 nests (if, while, if). In python it would take 1 at most.
3.) Yeah I mean when they get complex, compiler errors become unreadable
4.) I meant returning complex and not primitive types, like a full vector.
5.) Well if you overload an operator, you customize its behavior. Then you need to repeat this customized behavior in head each time you call that operator otherwise your code will be logically wrong and you will not know why.
And well C++ gets tough when you get into an existing project, more than building one from scratch. Especially when it's full of alien undocumented C++14/17 code -
Celes6878y@matanl all your current problems have solutions. But basically, you thought C++ tough when you're trying to do something that you never see outside C++ I guess. Template for exemple like you mentioned (by the way error template are no longer that crazy, and will be easy to read soon). Not sure thats a good idea to start a deep discussion like that here.
-
matanl26448y@Celes it could be that it's eventually not hard, but the learning curve is shallower definitely
-
magnusi5828y@matanl 1) did you use strtok()/strsep() or wrote something own? I think it could be done simpler than if/while/if
-
matanl26448y@magnusi yeah I edited the C in there and only after 10 minutes I figured out it's not very clear..
-
matanl26448y@Celes some guys at my univ wrote a balanced tree data structure which works in compile time, it was nuts
-
magnusi5828y@Celes Yea, I think that C is actually quite good for string proceesing, but it requires a different mindset than languages like C#, Python etc
-
matanl26448y@Celes I have no idea how they did that though, seems like a code which has to be right on the first time
undefined