The Artima Developer Community
Sponsored Link

Weblogs Forum
What's up with Diggins?

36 replies on 3 pages. Most recent reply: Jan 18, 2006 10:50 PM by Robert Parnell

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 36 replies on 3 pages [ « | 1 2 3 | » ]
Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: What's up with Diggins? Posted: Jan 16, 2006 9:08 AM
Reply to this message Reply
Advertisement
> > I believe GP in Java and C# has some serious problems,
> and
> > it will take another language to really bring GP to the
> > mainstream.
>
> If you have moment, can you elaborate on what those
> problems are? I too feel there are major issues with
> Generics but I when I try to make my case, it's not all
> that convincing.

There are some good arguments at:

http://www.mindview.net/WebLog/log-0061
http://www.langer.camelot.de/GenericsFAQ/JavaGenericsFAQ.html
http://www.artima.com/weblogs/index.jsp?blogger=beckel

Steve Donovan

Posts: 24
Nickname: stevedonov
Registered: May, 2005

Re: What's up with Diggins? Posted: Jan 16, 2006 11:00 PM
Reply to this message Reply
> ... C++ was a bit of a phase for me, I
> feel like I now know about as much about the language as I
> care to. At one point, you stop caring whether technique X
> conforms to the standard, or not. I just want to write
> software

I can relate to that. Wrote a book (which did not do so well in the tech downturn, alas) wrote a C++ interpreter, and realized that the language was far too complicated for one person to implement, or even keep in their head without constant use.

There are two main kinds of foolishness; that done out of stupidity and that done out of cleverness. A lot of the advanced template techniques fall into the second category. The standard libraries are a incredible intellectual achievement, but the first rule of good library design is broken; the user of the libraries is not protected from the complexity of the implementation. (Consider list<int,std::allocator<int> > etc, and that's a simple type.).

A general observation about templates is that they are often premature optimization. It's difficult to control rampant inlining and this is often for code where the performance is hardly effected (e.g. iostreams).

This may seem trollish, but more in sadness than in anger, as they say. Most programs can be more productively written in higher-level languages.

steve d.

Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: What's up with Diggins? Posted: Jan 17, 2006 4:16 AM
Reply to this message Reply
The weekly blogs have been an enlightment. You gave it a
good go being a one-man show. Unfortunately most of us are
too far into our respective careers and too deep into sorting
out retarded Null Pointers and Event Queue crashes (amid other
crazy challenges) to learn a new tool. Though a lot was
gained from the weekly blogs.

Good luck with the job hunt and all the best with Heron.

Terje Slettebø

Posts: 205
Nickname: tslettebo
Registered: Jun, 2004

Re: What's up with Diggins? Posted: Jan 17, 2006 7:07 AM
Reply to this message Reply
> There are two main kinds of foolishness; that done out of
> stupidity and that done out of cleverness. A lot of the
> advanced template techniques fall into the second
> category. The standard libraries are a incredible
> intellectual achievement, but the first rule of good
> library design is broken; the user of the libraries is not
> protected from the complexity of the implementation.
> (Consider list<int,std::allocator<int> > etc, and that's a
> simple type.).

The second parameter is defaulted, so you don't have to provide it (and allocators are debated in the C++ community, as they are typically not used). What's complicated about:

list<int>

?

Or, to put it another way, do you have a better example?

> A general observation about templates is that they are
> often premature optimization. It's difficult to control
> rampant inlining and this is often for code where the
> performance is hardly effected (e.g. iostreams).

This one-sided view is unfortunately all too common. Early binding is not all about efficiency, and that may not be the most important factor (if it is a factor, at all) in using them. By having early binding, you also get early error messages, rather than (as in Java before it, too, got generics) being able to insert an Apple into a list, and try to extract it as an Orange, and get a ClassCastException at run-time...

> This may seem trollish, but more in sadness than in anger,
> as they say. Most programs can be more productively
> written in higher-level languages.

Languages such as?

In my experience, with C++, using the right libraries, you can get any level of abstraction as you like. I think the problem in the programming field has more to do with people, than with languages. What I'm talking about is Jim Coplien's remark about the state of the software development field: "Incompetence is rampant."

We can get very far with what we have, much farther than what is typically done (judging typical production code), than what we currently do, using any language at our disposal.

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: What's up with Diggins? Posted: Jan 17, 2006 7:51 AM
Reply to this message Reply
> > This may seem trollish, but more in sadness than in
> anger,
> > as they say. Most programs can be more productively
> > written in higher-level languages.
>
> Languages such as?

Woohoo! Another language war about to erupt. Seriously, Terje, by responding to that statement you are accepting the validity of the original claim. Can't you see where this kind of debate goes?

I don't mean to insult Steve Donovan at all, but it goes without saying that some programs can be more productively written in a higher-level language. Any assertion about "most programs" is too much of generalization to be meaningful, and the ensuing debate never resolves anything.

> In my experience, with C++, using the right libraries, you
> can get any level of abstraction as you like.

Except the expression of crosscutting concerns as done in aspect oriented programming. This is one of the only fundamental limitations of the language that I have identified.

> I think the
> problem in the programming field has more to do with
> people, than with languages. What I'm talking about is Jim
> Coplien's remark about the state of the software
> development field: "Incompetence is rampant."

I loathe generalizations about incompetence and stupidity. Humans are fallible, until we learn to accept this and compensate, rather than pointing fingers at everyone else (I doubt Coplien included himself among the incompetent) than the software development industry will continue to flounder.

I have been coding for 20 years, and I make tons of mistakes. It is easy to wag your finger when I, or anyone else, make a mistake and say that I am incompetent or stupid, but when it comes down to it, who doesn't make mistakes? What I find a telling observation is the fact that I make a hell of a lot more mistakes when using a language like C++ than other languages. My conclusion is that a well-designed language will reduce the chance of programmers making mistakes at the level of design and coding.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: What's up with Diggins? Posted: Jan 17, 2006 8:07 AM
Reply to this message Reply
> I loathe generalizations about incompetence and stupidity.
> Humans are fallible, until we learn to accept this and
> compensate, rather than pointing fingers at everyone else
> (I doubt Coplien included himself among the incompetent)
> than the software development industry will continue to
> flounder.
>
> I have been coding for 20 years, and I make tons of
> mistakes. It is easy to wag your finger when I, or anyone
> else, make a mistake and say that I am incompetent or
> stupid, but when it comes down to it, who doesn't make
> mistakes? What I find a telling observation is the fact
> that I make a hell of a lot more mistakes when using a
> language like C++ than other languages. My conclusion is
> that a well-designed language will reduce the chance of
> programmers making mistakes at the level of design and
> coding.

That sounds good but the problem is that most software is of very poor quality. I have personally worked with developers who don't understand basic concepts of how computers work. When I came to my current position, there was code running in production (for more than a year) that had never executed succesfully. An 'expert' consulting firm had created this module. When I looked at the code, it became obvious that the developers did not understand what causes a NullPointerException in Java. A lot of the code in our baseline does absolutely nothing but create possibilities for failure.

If that's not incompetence, I don't know what is. The thing is that from what I can tell from talking to other people and my own previous job experiences, this is not an uncommon story.

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: What's up with Diggins? Posted: Jan 17, 2006 10:26 AM
Reply to this message Reply
> That sounds good but the problem is that most software is
> of very poor quality. I have personally worked with
> developers who don't understand basic concepts of how
> computers work. When I came to my current position, there
> was code running in production (for more than a year) that
> had never executed succesfully. An 'expert'
> consulting firm had created this module. When I looked at
> the code, it became obvious that the developers did not
> understand what causes a NullPointerException in Java. A
> lot of the code in our baseline does absolutely nothing
> but create possibilities for failure.
>
> If that's not incompetence, I don't know what is. The
> thing is that from what I can tell from talking to other
> people and my own previous job experiences, this is not an
> uncommon story.

Here is another anecdote. 10 years ago I had to port a 100,000 line program from Pascal under Dos to Delphi with a Windows GUI. I spent the whole time cursing the code. It was spaghetti code of the worst kind which violated every known software engineering principle. Modules were named "Module1", "Module2", etc. and were created only because memory limits were reached. I was convinced the guy who wrote it was incompetent. After three years of trying to port the code, and enhance the functionality, I realized that there was a big difference between him and me: his code worked, mine was still in production. When it came down to it, I was actually the incompetent one with all of my high-falluting university education and big ego.

My point is that incompetence is only part of the problem of the industry. Ego has its own role to play as well.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: What's up with Diggins? Posted: Jan 17, 2006 12:14 PM
Reply to this message Reply
> Here is another anecdote. 10 years ago I had to port a
> 100,000 line program from Pascal under Dos to Delphi with
> a Windows GUI. I spent the whole time cursing the code. It
> was spaghetti code of the worst kind which violated every
> known software engineering principle. Modules were named
> "Module1", "Module2", etc. and were created only because
> memory limits were reached. I was convinced the guy who
> wrote it was incompetent. After three years of trying to
> port the code, and enhance the functionality, I realized
> that there was a big difference between him and me: his
> code worked, mine was still in production. When it came
> down to it, I was actually the incompetent one with all of
> my high-falluting university education and big ego.

And you were in the software industry, were you not? Actually, that you had not completed the task doesn't mean he was more competent than you. That the code was so difficult to port was a sign of it's poor quality. Saying that his code works and yours did not proves his competence was higher than yours is very similar to an old comedy sketch about "Worthington's law: a person that makes more money than you is better than you and above criticism... Who's better than van Gogh? Adjusting for inflation... Just about everybody, the guy made nothin'!"

> My point is that incompetence is only part of the problem
> of the industry. Ego has its own role to play as well.

No doubt and I've seen a strong correlation between ego and incompetence, or at least the incompentent egotist is the most dangerous type of developer. Interestingly, there's a way more than enough ego in the artima developer blogs than the software industry will ever need.

Before you seemed to equate incompetence with mistakes. Incompentence doesn't mean making mistakes, if that were the case everyone would be incompetent. In competence in this context is the inablity to perform the required duties of a given role at a sufficient level.

I do not agree that people are the problem when it comes to C++. I think that too many people equate compentence in software development with mastering arcane and overly-complicated syntaxes. I don't think being able to explicitly manage pointers is a necessary skill for a developer in much the same way that great mathemeticians don't need the ability to do immense calculations in their heads like certain savants. I think languages like C++ tend to keep skilled individuals who are not good at remembering volumes of esoterica out of the development process. The problem with this is that this ability doesn't correlate to highly abstract thinking or problem solving ability.

Gregor Zeitlinger

Posts: 108
Nickname: gregor
Registered: Aug, 2005

Re: What's up with Diggins? Posted: Jan 17, 2006 1:45 PM
Reply to this message Reply
> Consider how Java implements anonymous inner classes.
> They compile to 'normal' classes with generated names.
> . If you refactor an interface, the IDE is able to
> refactor these anonymous classes.
Yes, I just realized that I got that part wrong. I had thought that this would not be possible, because I was thinking at how duck typing is implemented in Java.
Now that I see it in this light, my first concern is less of an issue, too. Even if you don't have the implements clause, the IDE can show you all traits that a given class participates in.

MB 2sync

Posts: 3
Nickname: mb2sync
Registered: Nov, 2005

Re: What's up with Diggins? Posted: Jan 17, 2006 9:20 PM
Reply to this message Reply
Dear, Mr.Diggins.

Rightly or wrongly, your YARD offspring Biscuit
is still making feedback for Boost.Range and Boost.Foreach
which are revolutional part of C++.

I hope that everything goes well.
When you write a C++ article, let me preview it. :-)


Regards,
MB
p-stade.sourceforge.net

Kresimir Cosic

Posts: 34
Nickname: kreso1
Registered: Jan, 2006

Re: What's up with Diggins? Posted: Jan 17, 2006 10:15 PM
Reply to this message Reply
> In my experience, with C++, using the right libraries, you
> can get any level of abstraction as you like.

This is not true. C++ doesn't have the right mechanisms to do abstraction properly.

Then a programmer usually has to wory about lots of completely unnecessary "gochas", resulting in more effort for programmer and more bugs in code.

And, also, it's too hard to write a well-designed library in C++. And this is where C++ has failed most.

Steve Donovan

Posts: 24
Nickname: stevedonov
Registered: May, 2005

Re: What's up with Diggins? Posted: Jan 17, 2006 11:10 PM
Reply to this message Reply
Ah, I think I may have written more from emotion than reasoned analysis, but some of the points can be clarified.

> The second parameter is defaulted, so you don't have to
> provide it (and allocators are debated in the C++
> community, as they are typically not used). What's
> complicated about:
>
> list<int>
>
Which is of course how 99% of time lists are declared. The trouble is when there's an error; most compilers will present you with the full type name. I think a better example is std::string, which really does go on and on. The cleverness is how std::string is implemented as a parameterized type, but the foolishness is revealed when one gets an error message involving map<string,string>. That is what I meant by the standard library not encapsulating complexity.

> Early
> binding is not all about efficiency, and that may not be
> the most important factor (if it is a factor, at all) in
> using them. By having early binding, you also get early
> error messages

Very true, but it is a point of pride of the generic programming people that a call to for_each will expand to pretty optimal code. My point is that I/O code does not need that kind of aggressive space/time trade-off.

> Languages such as?

Cdiggins is right; 'most programs' is too vague to be useful. It is more honest to say 'that most of the programs I have worked on would be less trouble to write in languages other than C++'. So, I make no claims about universality ;)
For instance, a little utility is often better done with Python, Boo, awk, whatever. A GUI program is often less work in Delphi or C#. But when I write serious numerical code, it's C++, unless I have to use FORTRAN (argh!).

> "Incompetence is rampant."

That's always true, for a given value of 'incompetence'. And there is no incompetence-safe language.

I'm sorry if my little fit of depression threatened to cause a flamewar. I've come to the impression that perhaps C++ tries to stretch too much, between low-level and high-level, between small programs and programming-in-the-large. But then there is no other language that can stretch that far.

steve d.

Steve Donovan

Posts: 24
Nickname: stevedonov
Registered: May, 2005

Re: What's up with Diggins? Posted: Jan 17, 2006 11:34 PM
Reply to this message Reply
Seeing as I have thrown a cat among the pigeons, I should qualify my criticisms. It isn't really about C++, which is a very flexible language which can accomodate multiple paradigms. (Some consider this a foolishness, but I think it is a freedom. C++ itself never prescribes a 'one-size-fits-all' programming paradigm such as OOP.) But I do take issue with some library decisions, and the general tendency to templatize everything. The generic programming paradigm is perhaps too dominant. For instance, I take issue with the assertion that explicit loops should not be used if there is some generic algorithm that can do the job. Fine, if C++ was a true functional language, but there are no anonymous closures. (Boost::lambda ain't the real thing.) The functional idiom to call a method of a collection of objects is IMHO less clear than an explicit loop, and less flexible. FOR_EACH macros do very nicely, especially if one has the 'typeof' extension available, but there seems to be a generalized prejudice against macros.

One has of course the freedom to make different technical decisions about the style of one's own designs, but sometimes I feel that 'old-fashioned' styles are becoming deprecated. Most C++ programming experiences would be easier with a non-templatized std::string and std::wstring, and the old iostreams. Would a person choosing such a style be considered 'incompetent'?

BTW, I am a great fan of generic containers - wouldn't go back on them!

steve d.

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: What's up with Diggins? Posted: Jan 18, 2006 7:13 AM
Reply to this message Reply
> The weekly blogs have been an enlightment. You gave it a
> good go being a one-man show. Unfortunately most of us
> are
> too far into our respective careers and too deep into
> sorting
> out retarded Null Pointers and Event Queue crashes (amid
> other
> crazy challenges) to learn a new tool. Though a lot was
> gained from the weekly blogs.
>
> Good luck with the job hunt and all the best with Heron.

Thank you very much for the kind words. For the record I do plan on continuing my work on Heron, and writing on the blog, even if employed at a 9-5. I'll simply have to scale back on my crazy ideas. :-)

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: What's up with Diggins? Posted: Jan 18, 2006 7:16 AM
Reply to this message Reply
> Dear, Mr.Diggins.
>
> Rightly or wrongly, your YARD offspring Biscuit
> is still making feedback for Boost.Range and
> Boost.Foreach
> which are revolutional part of C++.

That is great news.

> I hope that everything goes well.

Thank you.

> When you write a C++ article, let me preview it. :-)

I will, but I think the next article will be a Heron article. Would you be interested in previewing that? I am planning on next writing about a VList based implementations of Stacks but using Heron as the example language.

Flat View: This topic has 36 replies on 3 pages [ « | 1  2  3 | » ]
Topic: Static Behavioral Subtyping and Heron Traits Previous Topic   Next Topic Topic: Error in

Sponsored Links



Google
  Web Artima.com   

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