The Artima Developer Community
Sponsored Link

C++ Community News Forum
The Problem with Programming

212 replies on 15 pages. Most recent reply: Dec 8, 2006 6:12 AM by James Watson

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 212 replies on 15 pages [ « | 1 ... 2 3 4 5 6 7 8 9 10 ... 15  | » ]
Cedric Beust

Posts: 140
Nickname: cbeust
Registered: Feb, 2004

Re: rewriting history Posted: Nov 29, 2006 2:47 PM
Reply to this message Reply
Advertisement
> I can easily believe that JSP and JDBC are "Java
> innovations" on account of the J in the acronym - but
> suspect that templating frameworks already existed in Perl
> and PHP, and gosh darn there was that ODBC thingy with C++
> bindings.
>
> On-the-fly bytecode generation has been around for
> decades, Bill Opdyke's thesis was about refactoring C++,
> the 1997 Aspect Oriented Programming paper talks about "a
> medium-level language like C, C++ or Java" and "we used
> C++ as the base aspect description language" ... these are
> not "Java innovations".

The point of this enumeration was not to claim that any of these items was invented in Java. None are, and I'm sure every single feature of a programming language can be retraced to a prior invention, paper or article somewhere.

The difference is that Java not only packaged all these inventions in an approachable manner, it also popularized them to the point that if someone lists "Java EE" or even "Java SE" on their resume, you immediately know that they master (to a certain extent) all these API's and concepts.

Note also that Java is actually running even the most exotic sounding items of this enumeration in production somewhere.

> Have you heard about Google's search engine - it's really
> cool.

Can't agree more. Please keep clicking on the ads, it pays my salary :-)

--
Cedric
Oh and try Gmail for Mobile!
http://googleblog.blogspot.com/2006/11/gmail-mobile-client-is-live.html

Cameron Purdy

Posts: 186
Nickname: cpurdy
Registered: Dec, 2004

Re: The Problem with Programming Posted: Nov 29, 2006 3:28 PM
Reply to this message Reply
> I fail to see any significant language advances that have
> occurred outside C++.

To be blunt, that is because you _choose_ not to see any significant language advances that have occurred outside C++.

> Garbage collection? Google returns
> close to million hits. Generics? Yes, I know, long error
> messages and buggy compilers etc, but the bottom line is -
> STL is a decade older than Java generics which, please
> correct me if I'm wrong, boil down to a fancy casting
> syntax. Reflection? RTTI. Exceptions? Got it. Closures?
> They're coming in C++0x. So, what exactly are those
> "advances outside C++"?

You can find the same words in C++, but it is not at all the same thing. Language elegance and usability is not a series of check-boxes that one ticks off in a feature list. (Java made that mistake thinking it had to "keep up" with C#.)

Here is my personal experience, and as such I hope you find it interesting since I was working in C++ quite extensively:

Back in 1996, I downloaded the JDK, read all of the sources for the Java libraries, and that taught me both the language and the entire "platform" as it existed at the time, as well as the common approaches to programming in Java as illustrated by the authors of the language. Knowing C++, it literally took me only a few hours to learn all of Java (it was much smaller then). It was brilliant in its simplicity. Far from perfect, but brilliant nonetheless.

In terms of projects that I had worked on, writing a high-speed cross-platform (as it turns out, 16- and 32-bit Windows on x86 were the two primary platforms) data access and management library in C++ took me about 3000 man hours. Doing the same exact project in Java would probably take about 100 hours, except that the functionality is built in already.

I estimate that writing a reasonable optimizing C++ compiler in C++ to compile and link to a native executable would take about 20,000 man hours. (That type of project was simply too large to undertake, but I did build the emitter portion of such a beast.) I wrote (from scratch -- using nothing but the JDK) an optimizing incremental Java compiler in Java that compiles code that _runs_ as native code (via the JVM), and it took about 1500 man hours.

My point is simple: For tasks that I know in C++ that are natural to do in Java as well, Java has a significant edge for me in terms of productivity.

At the same time, there are many projects that I would not undertake in Java, and would choose C++ for. Those projects over time are being confined to smaller and smaller segments of the industry, such as hardware drivers and operating systems.

> Quite educating. Somehow I thought sloppy code was a
> consequence of poor programming practices and could be
> produced in any language. What else is Stroustrup's fault?
> JFK assasination? Alien abductions?

In terms of my own work, I can say that it is much more difficult to produce bug-free code in C++ than it is in Java, and for equivalent functionality in a system, my own estimate in 1996 as a director of engineering (making a decision to move to Java) was that C++ had 5x the LOC as Java for the same functionality, with the extra 4x (mostly error handling, memory management, etc.) being of no business value, and thus being a liability.

If anything, in retrospect I believe my estimate was low, and that the LOC savings is much higher, but that is likely because with Java we ended up doing things that we would never have attempted in C++.

Nonetheless, there are things that you can do in C++ in 10 lines of code that you cannot do in Java. No contest there.

> I really only wanted to point out that the interview topic
> was addressed properly but got dragged instead into
> endless "your language is root of all evil and my language
> is better than yours" discussion.

Yours? Mine?

I spent many years learning and theoretically mastering assembly, C/C++ and Java. They are all "mine".

However, I _enjoy_ Java much more than I enjoyed C++ (and I love programming, and I truly loved programming in C++ .. until I met Java ;-).

> So, I agree to disagree with you Java-guys.

I'm actually a Scala guy now. Someone mentioned it earlier in this thread, and it sounded like a hot new trend, so I jumped right on.

Those Java guys don't know what they're missing ;-)

Peace,

Cameron Purdy
http://www.tangosol.com/

Cameron Purdy

Posts: 186
Nickname: cpurdy
Registered: Dec, 2004

Re: The Problem with Programming Posted: Nov 29, 2006 3:38 PM
Reply to this message Reply
> > Google uses *a lot* of Java. A lot.
> >
> > And more every day.

> Same can be said for C++, but OK, where do they use it,
> besides in some of their APIs, obviously? Can you give me
> a link?

https://adwords.google.com/select/Login

BTW - It's responsible for almost all of Google's revenue.

Peace,

Cameron Purdy
http://www.tangosol.com/

Isaac Gouy

Posts: 527
Nickname: igouy
Registered: Jul, 2003

Re: rewriting history Posted: Nov 29, 2006 3:40 PM
Reply to this message Reply
Cedric Beust wrote
> The point of this enumeration was not to claim that any of
> these items was invented in Java. None are, and I'm sure
> every single feature of a programming language can be
> retraced to a prior invention, paper or article
> somewhere.

I'll just say that is very different from your original statement "here are some innovations that happened in the Java world first".

> The difference is that Java not only packaged all these
> inventions in an approachable manner, it also popularized
> them to the point that if someone lists "Java EE" or even
> "Java SE" on their resume, you immediately know that they
> master (to a certain extent) all these API's and
> concepts.

I don't think so - not even if we degrade master with to a certain extent.


> > Have you heard about Google's search engine - it's
> > really cool.
>
> Can't agree more. Please keep clicking on the ads, it
> pays my salary :-)

Oh I've never clicked on any of the ads - not even by accident.

Gregg Irwin

Posts: 16
Nickname: greggirwin
Registered: Jan, 2004

Re: The Problem with Programming Posted: Nov 29, 2006 3:50 PM
Reply to this message Reply
"Has anyone an explanation for the growth of interest in VB?"

I didn't know there was still growth, but I'm not surprised. My explanation would be that it's more accessible and usable than C#, unless you're coming from another C-like language. Under .NET, they've made it more like C, which is too bad; but the syntax in that environment isn't as important as being able to use the .NET platform effectively.

Seeing the comments about it being for front-end stuff, even after all these years, makes me smile. VB was a great tool--and still is for a lot of people it seems. Like BASIC/PDS and QuickBASIC before it, the stigma has lingered, but there are a lot of BASIC tools out there that are professional tools of the highest caliber.

If .NET hadn't driven me away, I'd probably still be specialzing in VB; it's a great tool and a serious lanugage. Of course, I'm biased like everybody else. :)

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: The Problem with Programming Posted: Nov 29, 2006 4:26 PM
Reply to this message Reply
> > To me, it is interesting how an interview with B.
> > Stroustrup has turned out into an avalanche of anti-C++
> > and pro-Java postings. To me, Stroustrup comes across as
> a
> > no-nonsense guy.
>
> For those of us who have used both C++ and Java
> extensively (I think Cedric was on the C++ standards
> committee for example), BS comes across as anything but
> no-nonsense. He is emotionally coupled to C++ and refuses
> to think objectively about the advances that have occurred
> outside of C++.
>
A few years ago I interviewed Bjarne Stroustrup back when I was doing long multi-part interviews here, and I found him to be quite reasonable in his opinions. I would do a lot of preparation for those interviews, and I was struck by the volume of material Stroustrup had written. He had a lot of interesting things to say and I personally got a lot out of that one conversation. Those old interviews are here:

http://www.artima.com/intv/bjarne.html

I did pick up on a frustration Stroustrup had with Sun's marketing of Java, in which he felt C++ was put down as "bad" to elevate Java up as "good." I think he felt that was unfair and it offended him. I think that may have also put him a bit on the defensive, i.e., that he felt he had to defend C++ against the Java marketing machine.

That said, the point of this discussion was supposed to be what Stroustrup said in the MIT interview, not Stroustrup himself, the extent of his responsibility for crop circles, etc. The one part of his comments that I was most curious about was how he said that "The snag is that often we do not know exactly how we did it: a system just "sort of evolved" into something minimally acceptable. Personally, I prefer to know when a system will work, and why it will."

I've never gotten the impression that developers often can't fully understand why their system works. The JSP that serves up this forum page is rather messy, but if need be, I could walk you through the code and explain how it all works. Does anybody here not understand why their system works?

The other thing is that despite this JSP's messiness, it works pretty well, and I can even make minor enhancements to it fairly easily. I personally don't like the mess, and am going to replace it eventually, but only because that work is justified by where we are going in the future. For the present, the messy code works just fine.

Back when I was using Windows 3.1, 95, and 98, I was very frustrated with the buggy state of software. Nowadays I use a Mac and Linux most of the time, and I don't have those frustrations anymore. Moreover my impression of Windows XP is that those quality problems have been cleaned up to a great extent. I use software all over the place nowadays--my cell phone, our new GPS device, airplane reseration systems, airplanes themselves, the web--I could go on and on and on. These days things seem to work pretty well, at least for me. The code underneath all these things might be messy, though, but in general I've noticed progress in software quality over the years.

Todd Blanchard

Posts: 316
Nickname: tblanchard
Registered: May, 2003

Re: The Problem with Programming Posted: Nov 29, 2006 5:13 PM
Reply to this message Reply
> One hell of a stubborn person is holding a major part of
> the computing programming world hostage for the last
> couple of decades by refusing to admit that the
> programming language used to write majority of the world's
> software is a failure.

I really don't think C++ gets much use outside of embedded, drivers, and OS development. Certainly all the apps on Mac OS X use Objective C - the real C with objects. Maybe Windows. I wouldn't know.

However, he's a guy who came out with a language that helped solve a few problems and seemed kind of neat. He got some attention and people started listening to him. He said a bunch of stuff that turned out to be wrong. Then the committee got hold of it, took the stuff he was spouting to its logical conclusion, and the monster got away from him. In retrospect, a lot of what he held important and many of the guiding principles he espoused turned out to be flat wrong. But its kind of like an urban legend - a lot of it is hard to kill.

> How the heck does this guy manage
> to do that? By embedding Gremlins into C++ compilers?

Oh - I see you've used the language. :-) Most of the problems with C++ can be traced to "too much magic". The compiler is a little too happy to convert types and generate code. The code it generates is usually not what you want, and the truly labor saving stuff you might want gets left out of the language leaving the programmer with a ton of hand written boilerplate. Its basically one bad design choice after another with that language.

> Moreover, some of the correspondents in this thread
> suggested that the high demand for C/C++ programmers

What demand? I haven't done C++ in 10 years - largely because the demand dropped off and with it, the pay rates. Java paid better. FWIW I don't do Java anymore either for the same reason. Plus the language is just dull dull dull.

> Yes, there is a problem with programming. It is because
> everyone and his brother think they can program computers
> and program well. This is resulting in enormous amounts of
> horrible code running in real world production and
> wreaking havoc.

I agree with much of this. But tools do matter. C++ was apparently designed along the principle of most surprise. No wonder so much of it is buggy.

> It has nothing to do with any programming
> language and everything to do with bad attitude, not
> enough effort and insufficient knowledge.

If it takes too much effort to write good software, then you really ought to rethink your tools and approach. It doesn't have to be that hard.

indranil banerjee

Posts: 11
Nickname: indranilb
Registered: Feb, 2004

Re: The Problem with Programming Posted: Nov 29, 2006 6:04 PM
Reply to this message Reply
I find all the these personal attacks on Bjarne Stroustrup quite disturbing, inexplicable and way off the mark.

Take the following quote from Cedric:-

> Fifteen years, I understood Bjarne's decision to not
> include a hashtable to the STL because it was hard to
> specify and we wanted to hit the deadline, but now...?
>

Bjarne didnt write the STL. The decision to exclude hashtable was taken by the committee in 1998 (I make that 8 years ago not 15). And hashtables were added to the standard TR1 in 2003.

If you guys like Java so much, good luck to you. But why spread so many flames in the C++ forum? This happened a few weeks ago on the C++ multi threading topic as well.

It seems some find the continued existence on C++ in 2006 unbearable. I wonder why?

"Peace"

Nemanja Trifunovic

Posts: 172
Nickname: ntrif
Registered: Jun, 2004

Re: The Problem with Programming Posted: Nov 29, 2006 6:31 PM
Reply to this message Reply
Is this forum moderated? All I read here is C++ bashing from people who obviously don't even know it. Heck, I did Java and C#, didn't like either of them and returned to C++, but I am not posting hate messages on either Gossling or Hejlsberg. Live and let live, people!



Posts: 19
Nickname: pmd
Registered: Oct, 2004

Re: The Problem with Programming Posted: Nov 29, 2006 6:55 PM
Reply to this message Reply
> https://adwords.google.com/select/Login
>
> BTW - It's responsible for almost all of Google's
> revenue.

Thanks. No, the search is responsible, I think. Without that you would have no place to hang your ads.

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: The Problem with Programming Posted: Nov 29, 2006 6:55 PM
Reply to this message Reply
> Is this forum moderated? All I read here is C++ bashing
> from people who obviously don't even know it. Heck, I did
> Java and C#, didn't like either of them and returned to
> C++, but I am not posting hate messages on either Gossling
> or Hejlsberg. Live and let live, people!
>
It isn't moderated in the sense of vetting each post before it goes live, but it is monitored. Posts deemed inappropriate will be deleted, but it has to be pretty bad before I delete. I haven't done any deleting here. I was a bit surprised by the vitriol aimed at Stroustrup, and rather than perform surgery I posted to try and guide the conversation back onto the substance of his interview not the man himself.

I'm not sure why people feel so emotional about languages. It would be nice to be able to have a discussion about how to improve the state of our art without worrying about pushing people's language--or language-designer--buttons.



Posts: 19
Nickname: pmd
Registered: Oct, 2004

Re: The Problem with Programming Posted: Nov 29, 2006 7:12 PM
Reply to this message Reply
> What demand? I haven't done C++ in 10 years

It's changed quite a bit in that time. The compilers have greatly improved, and there are quite a few very good quality, freely available libraries and frameworks available. Man, C++ was just hitting it's stride 10 years ago! The quality of books avalable on C++ has never been better. Many good ones have been published in the last 5 years. The demand for C++ may have dropped off and increased for Java 10 ears ago, but that was all driven by hype and marketing, not engineering. Maybe part of the problem here is that some people are comparing the C++ of 10 years ago to the Java of today.

Cameron Purdy

Posts: 186
Nickname: cpurdy
Registered: Dec, 2004

Re: The Problem with Programming Posted: Nov 29, 2006 8:13 PM
Reply to this message Reply
> I did pick up on a frustration Stroustrup had with Sun's
> marketing of Java, in which he felt C++ was put down as
> "bad" to elevate Java up as "good."

That's pretty funny, since Solaris and the Sun JVM are written in C/C++.

> The one part of his comments that I was most
> curious about was how he said that "The snag is that often
> we do not know exactly how we did it: a system just "sort
> of evolved" into something minimally acceptable.
[..]
> I've never gotten the impression that developers often
> can't fully understand why their system works.
[..]
> Does anybody here not understand why their
> system works?

Disturbingly, it is a common trait. You don't see it much in experienced software architects, systems programmers, etc., but you will often see it in application development. e.g. Comments that say:

// Don't change the following line ... it works but I don't know why!?!?!

> These days things seem
> to work pretty well, at least for me. The code underneath
> all these things might be messy, though, but in general
> I've noticed progress in software quality over the years.

The stuff that is well known and has been around for a while has generally reached an acceptable level of quality. That's mainly because it's been incrementally debugged (one bug encountered, tracked down and fixed at a time) over a period of years or decades.

On the BS interview, one of the commenters compared software to building a stadium, and said that you didn't worry about the stadium collapsing and killing you, but software wasn't anywhere near that quality. He went on to preach about the wonderfulness of engineering licenses and quality checks, etc. What he didn't point out is that humans have been perfecting building physical things for at least a couple of thousand years, while software is still only half a century old. Another difference is that physical things are over-spec'd to the point of being ridiculous. If a support in the stadium needs to bear a maximum of 1,000Kg, they will buy a support that is rated for 2,500Kg. That support in turn is rated at 2,500Kg, but will actually hold 6,000Kg even under poor conditions. In reality, the support ends up holding 25Kg on average, and on rare occurrence holds as much as 150Kg. It's over-spec'd by 40x. Compare that to IBM mainframes that -- with only a 2x typical overspec by executing all operations in parallel pipelines -- can [supposedly] run for several hundred years without a single parity or computational error.

The real problem was summed up in some old saying about computers: If builders built buildings the way that programmers built programs, the first woodpecker to come along would be the end of civilization. When it comes down to it, outside of the mainframe there's just not a whole lot of redundancy (for "safety margin" purposes) in most hardware and software. We know how to do it right, but no one wants to pay the cost.

Peace,

Cameron Purdy
http://www.tangosol.com/

Todd Blanchard

Posts: 316
Nickname: tblanchard
Registered: May, 2003

Re: The Problem with Programming Posted: Nov 29, 2006 9:07 PM
Reply to this message Reply
> All I read here is C++ bashing
> from people who obviously don't even know it.

That's naive. You don't get that kind of strong reaction from ignorance. It comes from deep knowledge. You can't truly despise what you don't know.

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: The Problem with Programming Posted: Nov 29, 2006 10:22 PM
Reply to this message Reply
> > I did pick up on a frustration Stroustrup had with
> Sun's
> > marketing of Java, in which he felt C++ was put down as
> > "bad" to elevate Java up as "good."
>
> That's pretty funny, since Solaris and the Sun JVM are
> written in C/C++.
>
Yeah, but I think I heard the anti-C++ marketing message back then. I've heard the same kind of thing more recently in the way Ruby on Rails has been marketed, but this time the target of scorn is Java. What goes around comes around.

Flat View: This topic has 212 replies on 15 pages [ « | 2  3  4  5  6  7  8  9  10 | » ]
Topic: Pantheios 1.0.1 full release approaching; beta 17 just released Previous Topic   Next Topic Topic: John Ousterhout on What Limits Software Growth

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use