I need your opinion... (original) (raw)

Marek Kozieł develop4lasu at gmail.com
Sun Mar 22 03:48:35 PDT 2009


2009/3/22 Joseph D. Darcy <Joe.Darcy at sun.com>:

Greetings.

I find none of these compelling for Project Coin. -Joe

Could you tell what 'compelling' mean for you?

W dniu 22 marca 2009 08:02 użytkownik Joshua Bloch <jjb at google.com> napisał:

Mark, I have to disagree with my esteemed colleague John on this one.  I believe that every language has certain characteristics that make it what it is, and that these things simply shouldn't be changed.  I believe that one such attribute of Java is that all declared entities have an explicit declared type.  I believe it would do great harm to the language to change this. Josh

I agree with you, but in my opinion Java is not on last step of it's evolution. At simple code language gain powder to focus on logic, but while I started to use generics or multi-thread applications my focus moved to much to types. when you see code: return arraylist.get(arraylist.size()-1).getIdentificator().getName();

You can count that there are 4 valuse without explicit types: return arraylist.(Container get( (int arraylist.size()) -1)) .(Identificator getIdentificator())).( String getName());

As you see i added explicid types but it decreased redability of code, same thing programers need to deal with every day.

Now second example: a) Standard code (+/-): String name = arraylist.get(arraylist.size()-1).getIdentificator().getName(); Data data = arraylist.get(arraylist.size()-1).Data(); ...

b) Proper code: String name; Data data; { final Container lastPerson = arraylist.get(arraylist.size()-1); name = lastPerson.getIdentificator().getName(); data = lastPerson.Data(); } // lastPerson == you shouldn't use it ...

c) with final (& forget): final lastPerson = arraylist.get(arraylist.size()-1); String name = lastPerson.getIdentificator().getName(); Data data = lastPerson.Data(); // forget lastPerson; // if you shouldn't use it any more

Most peoples will not explicit declare lastPerson and write code in (a) form ( more compact code, do not have to deal with new variable on all method) , while in (b) case final and block is almost always overlooked, (c) force people to use proper style because if they will use final they will know that 'it is what it is' and, will think twice before make it value.

-- Pozdrowionka. / Regards. Lasu aka Marek Kozieł

http://lasu2string.blogspot.com/



More information about the coin-dev mailing list