The Artima Developer Community
Sponsored Link

Weblogs Forum
The departure of the hyper-enthusiasts

262 replies on 18 pages. Most recent reply: Dec 20, 2006 2:11 PM by Carlos Neves

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 262 replies on 18 pages [ « | 1 ... 15 16 17 18 ]
Isaac Gouy

Posts: 527
Nickname: igouy
Registered: Jul, 2003

Re: The departure of the hyper-enthusiasts Posted: Jan 13, 2006 7:14 PM
Reply to this message Reply
Advertisement
Bruce Eckel wrote:
> The only thing I've seen that shows promise as an OO
> process model is Active Objects/Actors.

You may be interested in Zonnon's Active Object approach
http://www.bluebottle.ethz.ch/Zonnon/papers/The_Concepts_of_Zonnon_6_y041123.pdf


> On the other hand, I haven't seen how Erlang deals with
> objects -- or does it support objects?

They like to say that Erlang supports "Concurrency Oriented Programming"
http://www.sics.se/~joe/talks/ll2_2002.pdf

Erlang programs are structured around lightweight processes - that's fundamental to their notions of how to build reliable distributed software.
http://www.sics.se/~joe/thesis/armstrong_thesis_2003.pdf

piglet

Posts: 63
Nickname: piglet
Registered: Dec, 2005

Verbose Java Code Posted: Jan 17, 2006 2:19 PM
Reply to this message Reply
This is only slightly related, but I have to make a rant about incredibly bad Java code. In the project that I am currently assigned to, I'm about to correct about 700 occurrences of code like the following:
 
public ArrayList getObjectList(String command) throws Exception {
try {
ArrayList list = new ArrayList();
list = dao.getObjectList(command);
return list;
} catch (Exception e) {
throw new Exception(e);
}
}


Of course this should be only one line of code in the method body instead of 7. While that is an outrageous example, I think it reflects some bad habits that are widespread among inexperienced, and even among some experienced Java coders and which may have contributed to Java's reputation of being such a verbose language. Sometimes I wonder whether newbies are deliberately taught that Java code has to contain as much redundancy as possible in order to be right. Book authors not striving for elegance, and often restrictive and inflexible coding guidelines make matters worse.

Exception handling is obviously one of the worst culprits. Java checked exceptions are often blamed (not least by Bruce) but in my eyes, the problem really is that too many developers don't understand the concept (as in the code snippet above) and courses and books don't give good, standard-setting examples. Java exception handling does force us to write some more code than we would otherwise have to but in my experience, the majority of catch handlers are redundant and could have been avoided if the programmer had spent a few minutes designing the appropriate flow of exception handling, rather than just mindlessly coding some handlers to please the compiler.

Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: Verbose Java Code Posted: Jan 18, 2006 3:17 AM
Reply to this message Reply
> This is only slightly related, but I have to make a rant
> about incredibly bad Java code. In the project that I am
> currently assigned to, I'm about to correct about 700
> occurrences of code like the following:

I concur, that is horrible code not only from a verbose
stand-point but also from the decision in what to return.
It doesn't allow for the flexibility enabled by Java to
at some later stage change the underlying implementation
by returning the interface instead of the actual object.
i.e. returning java.util.List allows for greater code
flexibility (from a maintenance stand point).


> Exception handling is obviously one of the worst culprits.
> Java checked exceptions are often blamed (not least by
> Bruce) but in my eyes, the problem really is that too many
> developers don't understand the concept (as in the code
> snippet above) and courses and books don't give good,
> standard-setting examples. Java exception handling does
> force us to write some more code than we would otherwise
> have to but in my experience, the majority of catch
> handlers are redundant and could have been avoided if the
> programmer had spent a few minutes designing the
> appropriate flow of exception handling, rather than just
> mindlessly coding some handlers to please the compiler.

The fact that only one line is needed in the try block
makes the code verbose - I agree with that. But I don't
think catching Exceptions in the code snippet makes it
verbose at all. Actually specifying the type of exception
in my opinion would make the code easier to understand -
in terms of Oh, at some point such and such an operation
occurs, e.g. interaction with hardware, or a datasource,
etc, this would only be evident by the type of exception
being thrown.

return dao.performSomeOperation();

doesn't really tell you much as to what type of operation
and what object is being returned, one may take a shot by
the variable name but I still don't think that helps much.

IMO there's a thin line between code
clarification/readability and verbosity.

piglet

Posts: 63
Nickname: piglet
Registered: Dec, 2005

Re: Verbose Java Code Posted: Jan 18, 2006 12:15 PM
Reply to this message Reply
"But I don't think catching Exceptions in the code snippet makes it verbose at all."

Verbose is not the right expression - the whole try-catch is redundant in that example. The programmer chose not to handle the exception, so he shouldn't catch it anyway. He obviously doesn't understand the concept. Creating a new exception instead of rethrowing makes matters worse, and declaring Exception instead of the specific exception is bad, but that's almost negligible in this case.

Thomas Gagne

Posts: 3
Nickname: tgagne
Registered: Aug, 2003

Re: The departure of the hyper-enthusiasts Posted: Feb 7, 2006 4:07 PM
Reply to this message Reply
Bruce, what do you mean when describing Fowler as being a Smalltalker that, ".. because the Smalltalk relationship never really worked out in the real world?"

Fred Grott

Posts: 105
Nickname: sharemefg
Registered: Nov, 2005

Re: The departure of the hyper-enthusiasts Posted: Feb 9, 2006 10:36 AM
Reply to this message Reply
Could it be the move to Ruby is meging of trends?

No one has touched on the economics..

Standard seed capital fro a new venture averages around $15,000

Obvioulsy, if one devloper can put together a product prototype that is production ready in 4 months than he has a chance to succeed with $15,000


I do not think the semantics of Ruby alone is the full set of trends in pick up of Ruby and Ruby on Rails..

Oscar Lee

Posts: 1
Nickname: xennest
Registered: Feb, 2006

Re: Ruby / Java Comparison Posted: Feb 9, 2006 11:50 PM
Reply to this message Reply
Cordially I invite you all to visit

http://210.17.173.101:8080/genandrun

GenAndRun 0.2 which is a Java on rails attempt to simplify Java development.

Now we offer a 3-min video demo which may prove that Java development can be EQUALLY elegant as RoR.

Oscar Lee
Xenium (Hong Kong)

Carlos Neves

Posts: 1
Nickname: lusosis
Registered: Dec, 2006

Re: The departure of the hyper-enthusiasts Posted: Dec 20, 2006 2:11 PM
Reply to this message Reply
Sorry, I have no experience in Ruby, Perl or Pyton, Java not more only C family (C++ and C#, C# 3.0 seems to evolve in good directions http://en.wikipedia.org/wiki/C_Sharp), but for my humble view Java syntax is “identical” to C++, I am not talking about any library of functions sets available in the different platforms, like the .Net Framework.

For mandatory indentation I worked, and I liked, OCCAM (http://frmb.org/occtutor.html and http://www.wotug.org/occam, born with the Transputer a very good parallel processor but fortuneless, good engineering is not enough to success in the market, but it as “reborn“ in the form of the CELL http://cellsupercomputer.com/transputer.php). The indentation in OCCAM (http://freespace.virgin.net/martin.mamo/dissert.html#intro) facilitates the understand of the program flow, and OCCAM is for real parallel or concurrent programming, so to see what parts of the program run in parallel OCCAM uses indentation in a very effective way. Before using OCCAM I also indent C and C++ programs for easy of understanding and today I do the same with SQL and C#, so I agree with indentation but also I understand that some Developers prefer “free text” than the mandatory indentation.

About Java and C#, some inside information at http://www.codeproject.com/dotnet/CSharpVersusVB.asp .

In the end C# is a Ecma and ISO standard (including the executable format - CLI), and Java is Sun proprietary, strange no ?

Flat View: This topic has 262 replies on 18 pages [ « | 15  16  17  18 ]
Topic: The departure of the hyper-enthusiasts Previous Topic   Next Topic Topic: Java Applets + Ajax = ?


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us