java 5 could like python?

more i squawed ruses at users.ch
Wed Jan 12 11:42:28 EST 2005


vegetax wrote :
> I was a java developer one year ago ,before i moved to python i realy liked 
> it at the beggining, but i got very disapointed lately since my 
> previus two python proyects where relatively big,and python didnt feel 
> well suited for the task.
> 
> The reasons are mainly due to the standard library,the language
> performance was aceptable, but the library, in my opinion has several grave
> issues:
> 
> -No naming convention. The speech of "it fits in my head" is no longer valid
> when i use a lot of functionality,modules,classes in a large proyect.
> 
> For example if i remember a function i want ie:get attribute, i dont
> remember if the module implementer coded it as
> getAttribute,GetAttribute,get_attribute, then i have to go and check the
> doc, every time,which is a waste of time.

I believe this is a rather ill-suited example. People will react.

> 
> -library Organization,we have modules that can have 20 classes(I imagine
> that is because of the commodity of having all in one file)

I challenge you to comparative statistics with Java.

> which makes
> reading the doc horribly painfull and is very hard to find the stuff
> coupled with the "pool" of modules that is the python installation
> directory,all throwed away at the installation directory without a
> categorization.

Well, for the soothing it can provide, I often feel nostalgic of the 
python documentation when I use javadoc.

> 
> -Is python library half object oriented? half functional oriented? I can
> understand that python allows some functional programing components when
> they are necesary,but there are libraries that totaly ignore object
> orientation which makes them problematic to use.for example,Whats with the
> os.path module and files? why do i have to say os.path.getfilesize(f.name)
> all the time? why cant i say f.size? Why does urlparse returns a tuple of 7
> items instead of an URL object? why there isnt an URL object? and so on.. 
> 
> I havent figured out a way to overcome those factors,the delaying and lost
> of focus that is having to check the docs all the time,every 5 seconds and
> having to make object oriented wrapers for several libraries or having to
> go and read the source code to know what the heck a function returns or
> what are its arguments makes coding unpleasant an very slow , i often have
> 15 pydocs windows open at the same time. What should i do?

First, you should believe the newsgroup when you get told that reading 
the source code "to know what the heck a function returns" is a not a 
need the python documentation leaves most pythoneers with.

> -Realying on ides is imposible due to python dinamic nature,very litle(next
> to nothing) assistance can be espected from them.
> 
> -Memorazing all the function names,parameters,return values,conventions of
> the modules i use doesnt look like a good solution.
> 
> Join it with poor and outdated documention and we have a very unpleasant
> standard library.

You would be much closer to the mark, imho, by admitting that the main 
issue with "knowing a programming language" is knowing its standard 
library while feeling at home with the documentation thereof; *and* then 
admitting that changing languages generally implies the unpleasant 
experience of loosing touch with the content and style of one's beloved 
standard library and docs.

> 
> In the other hand, with the recent changes in java 5 i can pythonize
> java,And take advantage of a well designed library that coupled with the
> "apache commons" libraries has no match,not even .Net.
> 
>  for example with the static import feature i can say:
> 
> import static mylib.Toolbox.print;
> import static mylib.Console.run;
> // or import static mylib.Toolbox.*;
> 
> class C{
>  public void func(){
>    print("hello world"); // instead of System.out.println("hello world");
>    print(run("ls /tmp"));
>  }
> }

Well you should provide the complete python equivalent, and I anticipate 
that you will be hard pressed to find someone on clp who will share your 
feeling that this java version is evidently better.

Regards.



More information about the Python-list mailing list