5 ms·
I find this post to be a little bit like saying: "Why running with one leg is great" - written by someone who run each days with one leg. Of course, if you're
by d0m 16y ago
I find this post to be a little bit like saying:
"Why running with one leg is great" - written by someone who run each days with one leg.
Of course, if you're using C++ each days of your life, you become quite good at it. You know the downside, you learn to use external libraries, etc. However, it's when you actually switch to another language that you can look behind realize all the time and effort you lost.
It's when you actually start running with 2 legs that you know for sure that, yes maybe one leg is ok, but 2 legs is easier, simpler, faster and safer.
Oh, some says it's better to use a car, well, I don't care because 2 legs is ok for me. [to be completed]
- ramchip 16y ago> Of course, if you're using C++ each days of your life, you become quite good at it. You know the downside, you learn to use external libraries, etc. However, it's when you actually switch to another language that you can look behind realize all the time and effort you lost. I work on a real-time visualization application for microscopes. Main requirements: 1) Performance (DSP and image processing involved) 2) Decent GUI 3) Must be maintainable by students in engineering physics What I am supposed to use that's easier, simpler, faster and safer than C++/Qt for this? Even dropping the "maintainable" thing, I don't see any language that would let me code faster. And my app doesn't have very unusual requirements...
- d0m 16y agoThe fact that you are forced to use C++ for all the reasons you said doesn't make it a better language. Again, to continue my comparison with legs: If you lose one of your shoes and need to walk in the street, you might be better to jump with only one leg.. it doesn't make it better than 2 legs. In the same way, if you needed raw performance, need to control your memory, etc. C++ might be the only way to go. However, for your particular problem, I don't know if it's possible, but a mix of Python for GUI and C for the raw algorithm could have been easier. And, for students in engineering physics, Python is way simpler than C++. From my experience, I helped students in other concentration than computer at university, and they had all kind of: #include <iostream.h>, lots of global variable named with only one letter, etc.. in their code. But don't get me wrong, C++ has its use and I keep using it again and again for various project. I know however that when I can use other language such as python, I'm way more effective and the final code is really prettier and simpler. Sadly, as in everything in life, nothing is black or white.. if C++ fits you well for a project, uses it. It's nobody's business anyway. I think it's important however to know that if you only use and know C++, you miss something.
- cousin_it 16y agoWhat about C#?
- deleted 16y ago[deleted]
- nickelplate 16y ago> "Why running with one leg is great" - written by someone who run each days with one leg. He is not saying that C++ is great. In fact he mentions several issues that bother him in his day to day use of the language. The problem with a lot of the anti-C++ rants is that they make it sound like it is impossible to get anything done in C++, which of course is not the case. Memory management for example is often brought up as a major issue with C++. I have been in 200+kloc projects that never leak memory and very, very rarely have to call delete. Just use RAII - it's not rocket science.
- joe_the_user 16y agoWith c++ programs, there is a well-understood model for how memory works and decent tools/method for finding memory leaks. A garbage collected program should never leak memory but if it does, then your problem is nastier - for example, how do you find memory leaks in C# in Mono? The tools are not sufficient. And standard Ruby, btw, doesn't official leak memory but simply never return allocated memory to the main pool - it keeps it in a private pool for future allocation. But allocate 1Gig and your Ruby instance will keep that 1Gig forever.
- rubashov 16y ago> when you actually switch to another language When I'm using some scripting language and not Qt, I wish I was using Qt. Qt is the shit. If you haven't used it you can't criticize C++. I've whipped up several things I know would have taken me ages longer to achieve the performance requirements with anything else.