Re: thoughts on gtk, after Hexsweeper (Ada)



> Okay, I gotta ask.. why "ugh, Ada"

Okay, I'll respond, but I do _NOT_ want to get into a language war (yawn).
Clearly, different people have different personal criteria for a language.

Personally, I _like_ Ada, but I use a lot of different languages.
I think the "ugh" is more deserved for C++, which has evolved into a
hodgepodge language with more "gotchas" than any other I can think of.
The C++ language spec is now MUCH larger than the Ada spec, and
C++ doesn't even have any language support for threading (Ada does)!
And yes, I write in lots of different languages, and I pick my
languages based on the problem at hand.

Ada was designed to maximize automatic error detection (compile-time
where possible and run-time otherwise), performance, and code readability.
Some may quibble about the readability (though I think it's very readable),
but the others Ada clearly delivers.  If you have other higher-priority
requirements, then maybe you want something else.

I think a lot of people are turned off because Ada compilers tend to be
"pickier".  On the other hand, I find that my Ada programs, once they
compile, often "work the first time."  Even if the program fails at run-time,
it's usually caught early (e.g., a number goes out-of-bounds & is caught then).
So, do you want the compiler & run-time to find the problems, or for you to
debug the mysterious error afterwards? No compiler can catch everything,
but I find that maximizing automated error detection is often a good thing.

Walking through Owen Taylor's comments:
>There is nothing _wrong_ with Ada from my perspective; I've just
>never liked what I've seen about it very much:
>
> - The syntax is distinctly inelegant - it manages to look both
>   overpunctuated and oververbose

 Obviously this is in the eye of the beholder.  Ada's syntax is
 pretty standard Algol-language-descendent stuff, with a clear influence
 from Pascal.   Ada does use Pascal's
 begin ... end keywords, rather than {}.  One nice thing about this
 approach is that the compiler can check for block structure errors
 that curly brace languages don't.  For example, in:

 procedure Blah is
 begin
   -- Stuff here.
 end Blah;

 The "end Blah" is checked by the compiler.
 The equivalent C convention isn't, so if your braces count correctly
 the C compiler won't catch that that the code "wasn't what you meant".
 Even when it's detected, often give lousy error messages because
 they don't have enough information to properly resynchronize:

 void blah()
 {
   /* Stuff here */
 } /* blah */


 Typical Ada constructs actually read quite well:

 if condition then
  ...
 end if;

 while condition loop
  ...
 end loop;

> - The type system is rather non-standard in terminology and features,
>   and a bit limited; as far as I know it has no concept of interfaces
>   (or multiple inheritance). Types aren't first-class objects.

The type system isn't non-standard, just "different than C++".
You're correct, Ada doesn't have interfaces nor multiple inheritance.
Generally the same thing is done using generics (like C++ templates) instead;
look up "mix-ins" in the Ada documentation.

> - The user base (especially in the open source world) is quite
>   small, so I wouldn't expect a lot of contributions on a project
>   I started in Ada.

The user base is certainly smaller than C++.
Still, there are a number of enthusiastic open source Ada users; see
http://www.gnuada.org/alt.html and http://www.adapower.com.

In the end, I find "language wars" really uninteresting.
Decide on the language(s) you want to use for your application, based on
the kind of application you're creating, and get going.
If your application is interesting, people will find a way to run it
and improve it.

This discussion is getting a little off-topic
for gnome-devel, so let me add a comment to put it back on-topic.
I believe that language neutrality is one of the
_REALLY GOOD_ things about GNOME/Gtk+. Programmers should get to
choose the language for the job at hand.  GNOME makes it at least possible
to choose.  I'm looking forward to more GNOME bindings for more languages.
Choice! Choice! Choice!


-- 

--- David A. Wheeler
    dwheeler ida org





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]