views:

330

answers:

6

Is it just me or is there an almost perfect correlation between the level of bondage-and-discipline a language inflicts and the verbosity of the language? Ada, Java, and Pascal are horribly verbose, and have the reputation as extreme bondage-and-discipline languages. On the other hand, Perl and to a lesser extent C are pretty terse and have a reputation as extremely loose, anything goes types of languages. The only exceptions I can think of are non-mainstream purely functional languages like Haskell and Erlang, which are terse but bondage-and-discipline. Do you believe that this correlation truly exists? If so, what do you believe is the reason?

A: 

I dont know ruby and rails are rather verbose but extremely dynamic and flexible and forgiving

klyde
I have heard that r-n-r only seems verbose because it is so productive it proponents verbosely produce code. But I'd love to be shown wrong. I personally have graduated from Rails to Ruby/Merb and pure Ruby. But Rails is threatening to catch up.
Joe Soul-bringer
+1  A: 

I think your terminology is defining your outcome here.

A language which is not verbose is powerful - it allows you to express a lot of logic in a relatively few bytes. By negation, a language which is verbose will require a lot of bytes. If you feel bound by those bytes, then you have your B & D. But think this is in the eye of the bolder.

Joe Soul-bringer
A: 

Wouldn't this go more by specific language features?

  • Static typing is verbose
  • functional constructs (map, filter) tend to be more succinct because they omit the manual loop traversal
  • closures are more terse than creating separate functions, objects
Steve B.
A: 

I don't know about "perfect", but there is a correlation. Languages that express constraints (e.g. types on variables and methods) typically do so by syntactic constructs.

Therefore, it's not surprising that notations that have more to say will take more bytes to say it.

joel.neely
A: 

@Steve.b - static typing is verbose (is not correct) entirely. if you do have automatic type inference it's "free" e.g Haskell product :: (Num a) => [a] -> a

You can of course add type annotations but if you don''t Haskell and most other functional languages do quite a good job on type inference.

However if you look at languages like C, C++, Eiffel, Java, the .Net languages than you have a lot of typing in front of you.

I think you have to write a lot of code for languages without "templates" in C++ speak or Generics in Eiffel speak. Of course you get by in C with the void* but that's of course abandoning "any sort of" type-safety.

Eiffel is an example of an extreme verbose language because of "Design by Contract" not necessarily because of all the "types" you have to declare. In well written Eiffel a third of the lines can be attributed to DBC alone....

I'd conclude the following. In langauges where you have to write down the type stuff code itself you will of course have to write more lines of code than in other languages.

If it's worth it and whether it implies higher or lesser quality, can not be judged IMHO

Friedrich
Sorry, indulging in making utterly unsupportable generalizations - you know, the kind you agree with until you find the quick counterexample;)
Steve B.
A: 

To echo what Friedrich said, the bondage you are referring to is either not having a language that can take advantage of the structure inherent in the code you write (a great example is pattern matching for dispatch or the lack of specific type declarations for Haskell). But that bondage can also be cases where you have more knowledge about how data or code is used than the language but cannot take advantage of that (see linkage of static functions declared in a class in a function).

In other words, verbosity isn't the only aspect of bondage you refer to. It can also be unnecessary restrictions that prevent higher order optimizations.

MSN

MSN