Re:Parody of an interview with Bjarne Stroustrup, the creato...
by point on Wednesday January 28, 2009 @04:46PM
(#455206)
If you cannot learn C++, you are either plain old stupid or you don't belong in programming. C++ is very easy, the syntax is picked up in a week, and you can work without any libraries, you mostly just need to learn the API of the host system. If you can program in Ruby, you are capable enough to program in C++, and the only thing stopping you is just this 'myth' that C++ is hard.
Re:Parody of an interview with Bjarne Stroustrup, the creato...
by kragen on Thursday January 29, 2009 @04:59AM
(#456136)
You can learn a part of C++ in a week or two weeks, but really internalizing all the subtle gotchas takes longer. Static initialization order fiasco? Exception-safety without needing catch (...) { ... throw; } clauses? Why X-is-a-Y implies pointer-to-X-is-a-pointer-t-Y but not pointer-to-pointer-to-X-is-a-pointer-to-pointer-to-Y? Why do I get a long pause when I exit this scope where I destroy just one object? How do I debug a segfault? How do I debug multithreaded deadlock? When should I use a virtual base class? Etc.
You can't learn all that stuff in a week or two. And maybe you shouldn't learn it at all; for many applications there are things that will work better than C++ without so much complexity, whether that's C or Java or Python.
Re:Parody of an interview with Bjarne Stroustrup, the creato...
by TooMuchNick on Thursday January 29, 2009 @04:24AM
(#456097)
In college, where I majored in English, I thought I'd have an adventure and take a class in programming. They taught us C++. I never tried programming again.
Re:Parody of an interview with Bjarne Stroustrup, the creato...
by allenbrunson on Thursday January 29, 2009 @04:28AM
(#456103)
the appropriate language for any given situation is largely dependent on the environment you're writing for. writeroom is a macosx program, so it's overwhelmingly likely that it was written in objective-c. you can google up beginner's guides all day long.
Re:Parody of an interview with Bjarne Stroustrup, the creato...
by point on Thursday January 29, 2009 @02:13AM
(#455984)
What's the hard part of the syntax compared to a language like ruby? Interfaces? Classes? Inheritance? Templates? Exceptions? Ruby has equivalent interface elements, and there is not much of a difference in difficulty level between learning the one or the other.
I learnt C++ in 2 weeks 7 years ago, and it was easy. The difficulty comes with learning to use the libraries and host APIs, but that is exactly the same for every other language I've learnt since then.
- ugly libraries (STL, ATL, MFC, COM) yeah, i said STL is ugly.
- templates (Ruby doesn't need templates since everything is dynamic)
- No language level string data type (our product has at least six representations of strings here and there that need to be converted at the bit level).
Re:Parody of an interview with Bjarne Stroustrup, the creato...
by ramchip on Thursday January 29, 2009 @03:26AM
(#456042)
I've seen several 'hard' engineers (physicists with Matlab experience) learn C++ in a couple of weeks. It's doable but... as you might expect, the code they pump out is terrible. There's a huge difference between doing basic C++ and being productive and efficient in it.
Re:Parody of an interview with Bjarne Stroustrup, the creato...
by lliiffee on Wednesday January 28, 2009 @04:58PM
(#455257)
Most C++ haters (e.g. me) can program in C++ and probably even do program in it sometimes, but just don't like to. I can certainly do anything in C++ I could do in any other language, just with a hell of a lot more cursing and kicking things.
Re:Parody of an interview with Bjarne Stroustrup, the creato...
by kingkongrevenge on Wednesday January 28, 2009 @06:32PM
(#455433)
C++ has many flaws. Let's have a C++ bashing party, hooray. However, a discussion of the merits of C++ boils down to C++ vs C as far as getting things done in the real world and in the domains where C++ and C are applicable. C is absolutely horrible. I cannot imagine why anyone would start a new program or module to a higher level language in C rather than C++. It's like choosing BASIC over a modern scripting language.
Re:Parody of an interview with Bjarne Stroustrup, the creato...
by lliiffee on Thursday January 29, 2009 @09:56AM
(#456393)
I largely agree with you. If I "hate" C++ so much, why do I program in it? The answer is that sometimes I need my code to be very fast, and C++ has language features making abstraction easier than C or Fortran. I think the main reason people choose C instead of C++ is that it is common to overuse C++'s language features, and if you target C, this is impossible. Otherwise, just take "new" and "delete" and write the rest of your program in C...
Re:Parody of an interview with Bjarne Stroustrup, the creato...
by point on Thursday January 29, 2009 @02:14AM
(#455987)
This does not mean that C++ is difficult. It just means that you may be used to easier languages, and your brain is not flexible enough to deal with C++.
Re:Parody of an interview with Bjarne Stroustrup, the creato...
by hairsupply on Thursday January 29, 2009 @10:33AM
(#456456)
Entrenchment. The main product I work on is 3.5 million lines of C++, built with MCF and ATL. We can frankestein other technologies into there, but its expensive and clunky. The cost of rewriting the whole thing is prohibitive, so C++ it is.
Most of us have held this to be a true confession
You don't know C++.
You can't learn all that stuff in a week or two. And maybe you shouldn't learn it at all; for many applications there are things that will work better than C++ without so much complexity, whether that's C or Java or Python.
Say I was foolish enough to try again on my own. Say I wanted to write my own version of Writeroom: http://www.hogbaysoftware.com/products/writeroom
What language would I want to learn, and is there a good beginner's guide?
I learnt C++ in 2 weeks 7 years ago, and it was easy. The difficulty comes with learning to use the libraries and host APIs, but that is exactly the same for every other language I've learnt since then.
- No compiling or linking phase in Ruby. Linking problems can be hairy in large systems.
- Header file hell
- The static keyword (there are four different contexts)
- Difference between a pointer and reference
- public, private, protected inheritance
- Differences between dispatch (and underlying impl) of virtual and nonvirtual methods
- method hiding
- diamond of death
- visibility vs accessibility
- casting idioms (static, dynamic, const, reinterpret)
- ugly libraries (STL, ATL, MFC, COM) yeah, i said STL is ugly.
- templates (Ruby doesn't need templates since everything is dynamic)
- No language level string data type (our product has at least six representations of strings here and there that need to be converted at the bit level).
Linus gives very good reasons for C vs. C++ here: http://thread.gmane.org/gmane.comp.version-control.git/57643...
I personally don't have anything against C++, it is a perfect solution for some problems, but sometimes C may be a better choice.
C++ is objectively a far more powerful and expressive language than C.