Re: Java Philosophy



Roedy Green wrote:
I hate relaxed type languages. Yes strict typing takes more type to
type, but it saves time in the long run. It is much easier to
understand what the code is doing when you have the types clearly laid
out. Compile time checking excludes many errors.

I know I shouldn't do this but ...

It's all a matter of what you're used to. I usually don't care for the type of a variable, for the very reason that Python is designed around just that notion. I don't need to know what type a variable has, just what can be done with it, and that is usually obvious from the code.

I don't really see the benefit of writing

Thing foo = new Thing();

instead of just

foo = Thing()

OK, it might make more sense when it comes to interfaces, but here I don't see any benefit.

I can better understand the strict typing in method signatures. But again, Python does "duck typing", so usually the docstring right below the function definition is all you need, most if the time. This of course, depends heavily on programmers writing descent documentation, which is not to be expected.

So I agree and disagree.


It comes down to what you are doing. If you are whipping out little
one shot programs that you run once, then discard, and you are a slow
typist, then relaxed typing is the way to fly.

If you write systems that you keep coming back to for maintenance over
the years, approaching each time cold, largely forgetting how the
program works, with only your notes and the code to get up to speed,
then you appreciate the tight typing.

Reading that just breaks my little pythonic heart. :( (;))
Python was designed with the idea that code is usually read more often than it is written. So it is actually very easy to go (back) to a python program that you haven't seen in a long time if at all. Again, it is what you are used to reading and thinking that makes a particular type of program hard or easy to understand. If you expect to see type definitions everywhere, then of course you're going to miss them. If you're not used to them, they will bug the hell out of you. But I wouldn't claim that any aproach is generally worse than the other.



Learning to type quickly, using a high quality keyboard such as the
kinesis or Maltron, and an optimised layout such as DSK, can take much
of the pain out of the verbosity. A smart IDE helps too.
see http://mindprod.com/bgloss/keyboard.html

My problem is not really the typing (though I *am* slow at that), but the fixture. My mind just isn't used to deciding on the datatype of a variable. I'm used to trying one an then changing it if my initial descision was bad. That is of course possible in any language, but in Java you have to make changes in much more places.

I don't know, I'll get used to it sooner or later.

/W
PS. Thanks for the keyboard tips; I'm looking into touch typing but I've used my idiosyncratic method for years so that is hard to learn touch.
.



Relevant Pages

  • Re: Python or Java or maybe PHP?
    ... C#'s pretty close to Java, typing-wise, and C++'s not that far away. ... Runtime typing is enabled, as a productive programming approach, by the ... you code something like (in Python ... Once you've decided to give dynamic-typing languages a try, ...
    (comp.lang.python)
  • Re: Diff of opinion on dynamic stuff
    ... And Ruby for it? ... Certainly Python can't be against all dynamic stuff. ... against duck/latent typing that the blogger makes against open classes ... and open classes are too dangerous. ...
    (comp.lang.ruby)
  • Re: Newbie Q: Class Privacy (or lack of)
    ... It's not about typing without errors. ... The argument against this is that since development with Python is so ... everything in life. ... have much problem over-riding functions from the inside of the class. ...
    (comp.lang.python)
  • Re: optional static typing for Python
    ... this PEP is on track for Python 3.0. ... Note that annotations do not provide explicit typing, ... optimizing compilers for Python, like Shed Skin. ... Languages which enforce static ...
    (comp.lang.python)
  • Re: Automatic Generation of Python Class Files
    ... verbose as just typing the actual python code. ... Generated Python Class File: ... def class FireBreathingDragon: ...
    (comp.lang.python)