News for hackers. Stuff that matters.
Re:C++ in Coders at Work by rabc on Tuesday February 15, 2011 @08:13AM (#2221052)
I think the problem is in fact that nowadays developers jump into languagens like Python, Ruby or PHP because it's easy to learn, easy to install and run the environment and easy to code (you don't have to deal with memory or code optimization).

C/C++ are the base for everything you code today. People start learn how to code with languages like Java, jump straight into OOP. That's wrong.

Every developer should build at least a "hello world" in C, to know what's a real code. Ever developer must know about memory management, to scale optimize the code in any language. Other languages compilers do that for you, but you really need to know how it works.

Re:C++ in Coders at Work by statictype on Tuesday February 15, 2011 @08:48AM (#2221138)
I think the problem is in fact that nowadays developers jump into languagens like Python, Ruby or PHP

People have disliked C++ long before those languages existed or became popular. A lot of people who have written and maintain large C++ code bases will tell you straight up that they prefer C to C++.

Re:C++ in Coders at Work by copper on Tuesday February 15, 2011 @09:19AM (#2221240)

    A lot of people who have written and maintain large C++ code bases will tell you straight up that they prefer C to C++.
Perhaps that's the problem right there. As someone who has written a lot of C++ for quite some time, the most nightmarish aspect tends to be working with antique codebases.

The way people program in it has changed drastically over the last ten or so years. It's possible to have a reasonably painless experience with modern C++ that is pretty much impossible with codebases with significant history.

A lot of that is because the compiler support simply wasn't mature enough, so people did what they had to do to ship. If all you're dealing with is old C++ code, it's extremely easy to find that you prefer coding in C rather than C++ (which is almost what that old code really is).

Re:C++ in Coders at Work by agentultra on Tuesday February 15, 2011 @11:20AM (#2221770)
The true test of a language, IMO, is how it will rot over a decade or so.

I'm maintaining a C++ web application written 12 years ago. It's not pretty. I cannot describe the difficulties even an experience C++ developer would have in trying to understand and maintain it.

Fortunately modern C++ is pretty good. We've managed to tack on a legacy compatibility layer via the Boost libs to give us a Python wrapper. It's still running in production and is still pretty useable.

However, C/C++ still requires a fairly high cognitive load for a diminishing return, IMO. There are other languages that are easier to understand and maintain whose implementations are getting increasingly better at competing in areas where C/C++ used to be the go-to choice. There are simply fewer cases where I will reach for C++ these days where it used to be the only choice.

Re:C++ in Coders at Work by copper on Tuesday February 15, 2011 @12:26PM (#2222174)
You're absolutely right, of course - a webapp in C++ is not something that I'd want to even volunteer to help maintain.

I'd just say that it's not the language that rots, but the libraries, and preexisting code. There are still some areas where C++ is a good choice, but for things like a webapp, there would have to be a really compelling reason to choose it.

Re:C++ in Coders at Work by kenjackson on Tuesday February 15, 2011 @09:40AM (#2221331)
And as someone noted earlier, a lot of people formed their opinion of C++ a decade ago. A decade ago C++ compilers generally sucked. Templates were usually broken, exceptions were usually broken, and the STL was generally broken.

EDG was the first front-end to really get solid. Then Visual C++ got its act together and started releasing highly standard comformant C++, and then GCC did.

Now if you're writing standard compliant C++ it will likely work on the big 3 front-ends.

With that said there are some complexities in C++, but fortunately you can largely be oblivious to it until you need to use them.

Crockford correctly points out that Javascript has a very solid core. C++ shares that. With that said, I still prefer not to program in it... Just not a fan of non-GCed languages for the most part.

Re:C++ in Coders at Work by szx on Tuesday February 15, 2011 @11:09AM (#2221702)
I, for one, got fed up with C++ long before I ever heard of Python or Ruby. I pretty much quit programming because I got frustrated with the amount of boilerplate code I had to write/the bending over I'd have to do in order to get the simplest ideas fleshed out "idiomatically".

A language is a means of communication, and C++ fails miserably at that.

Re:C++ in Coders at Work by marshray on Tuesday February 15, 2011 @11:31AM (#2221837)
I pretty much quit programming because I got frustrated with the amount of boilerplate code I had to write/the bending over I'd have to do in order to get the simplest ideas fleshed out "idiomatically".

Don't take this the wrong way, but programming isn't for everyone. For some of us, it's in the blood. It's what I do during the work week and on the weekends for fun too.

Your complaints are valid of course, but take a look at all the systems developed for boilerplate elimination. I have used preprocessor metaprogramming, template metaprogramming, and "external Ruby script" metaprogramming - sometimes all in the same project.

But it's not everyone's cup of tea.

Some people swear by Python.

Re:C++ in Coders at Work by szx on Tuesday February 15, 2011 @03:15PM (#2223063)
Oh, you misunderstood me - I used to be on just like you, for 10 years or so, before I quit. I must've written tens (hundreds?) of thousands of LOCs in C++, but I was gradually getting sick of it and eventually almost stopped completely.

I still code, but it's not what I do for living, and incidentally, I do enjoy using Python (and also Scheme)!

Re:C++ in Coders at Work by marshray on Wednesday February 16, 2011 @06:33PM (#2228855)
How did I know...

I really fell in love with the cleanliness and simplicity of Lua for a bit there. Used it to prototype stuff that I'm not rewriting in C++ with great pain. I sure would benefit from having a good debugger though.

Re:C++ in Coders at Work by fogus on Tuesday February 15, 2011 @08:47AM (#2221130)

    Every developer should build at least 
    a "hello world" in C, to know what's 
    a real code.
I'm not following. Are you saying that "Hello World" is emblematic of "real world" C code?

My opinion is that "Hello World" serves one purpose only in C, to show how much the C compiler agrees with the host OS.

Re:C++ in Coders at Work by rabc on Tuesday February 15, 2011 @09:03AM (#2221183)
That was just an example.

Developers should know what's a pointer and how to deal with it, because this is what happens everytime you hit the 'Build and Run' in compiler or run your Python script.

And even a hello world in C can show all of that.

Re:C++ in Coders at Work by l0nwlf on Tuesday February 15, 2011 @09:40AM (#2221326)
And why should developer bother to know how to deal with pointers ?

And since when does writing "Hello World" in C teaches you how to use pointer and how to deal with it.

Re:C++ in Coders at Work by roel_v on Tuesday February 15, 2011 @11:19AM (#2221756)
"And why should developer bother to know how to deal with pointers ?"

Because if you don't even know the most basic things like the stack and the heap and memory addressing and the mechanics of calling functions, how can you expect to be a "developer"? Fine, let people start learning with languages that abstract all of that away, but for a well-rounded, complete education as a programmer (I'm not talking school-eduction, I'm talking general education) you need to know about these things.

Re:C++ in Coders at Work by marshray on Tuesday February 15, 2011 @11:35AM (#2221868)
Perhaps he uses the term "developer" to include "web developer" or "suburban residential housing division developer".