why java is not pure object oriented?

T

Thomas Weidenfeller

Chris said:
Hopefully, no one here is that up-tight. Topcoder is great fun, and I'd
recommend it to anyone looking for a way to spend an evening. Don't
just do the practice problems, though; that would be missing the best
part.

I would recommend to check their terms and conditions thoroughly. Some
time ago I gave Topcode a look. Their terms and conditions put me of.
Stuff about US tax forms to provide, reference to some Chines laws,
reserve the right to change the terms without any notice, request to
waive juristication. That, and their desire to gather and display more
data than I would like.

I decided not to do "business" with them.

I am not saying that there is anything wrong with them. They are upfront
with their Ts and Cs. It is just not my cup of tea.

/Thomas
 
D

Denis Nikiforov

(transmit-message (Hello 'James)
(You-wrote :eek:n "Tue, 21 Mar 2006 20:06:55 -0700")
(Say '(

JM> Many books. Without knowing your aptitude or preferences it's hard to
JM> make recommendations.

I have some experience in different languages from assembler (x86)
through c++, haskell, python, ... to Lisp. And my favorite language is
Lisp (but for now I'm newbie to Lisp) ;) I don't need a book about
Java's syntax (I can find it in the specification) or algorithms (I can
find it in a book like "Concepts, Techniques, and Models of Computer
Programming"), but I need some knowldge about effective use of
BeanShell, JDEE (or other DE), interactive development, modification of
running applications without their restart, debugging and etc. For
example, in Lisp I can connect to the remote Lisp process and make some
modifications without recompilation or even without restarting of this
application. It would be great, if I could develop webapps for Cocoon
without it's restarting after each small modification (it takes too
much time).

JM> Just get Eclipse and the current Sun JDK and jump into it.

Actually, I prefer Emacs. But JDEE doesn't work in my GNU Emacs 22.0.50
;( Thanks, I'll try Eclipse. Does it support interactive development
(using BeanShell or something else)?
 
D

Denis Nikiforov

(transmit-message (Hello 'Luc)
(You-wrote :eek:n "Tue, 21 Mar 2006 21:46:23 -0700")
(Say '(

LTP> I'm trying to do that by doing top coder practice programming assignments.
LTP> I have a feeling that after I have done several hundred of them I will be
LTP> faster than I am now. (Seriously I have done half a dozen and I'm already
LTP> feeling faster)

LTP> Our schooling system is extremely limited in the mere quantity of
LTP> assignments that they put out. If you want to code well, and fast you need
LTP> to train.

LTP> Pick an algorithm that interests you. Mazes fascinate me - but I realize
LTP> not everyone shares my conviction.
[...]

Ohh... ;( I'm afraid Java isn't best language for learning of
programming. IMHO, it's based mainly on engineering tradition and uses
top-down approach. For learning I preffer language like Lisp based on
designer tradition with bottom-up approach. There is no problem to
program fast in latter, but, imho, it's very hard in former (like Java).

PS: It's all IMHO!
 
C

Chris Uppal

Denis said:
Ohh... ;( I'm afraid Java isn't best language for learning of
programming. IMHO, it's based mainly on engineering tradition and uses
top-down approach. For learning I preffer language like Lisp based on
designer tradition with bottom-up approach. There is no problem to
program fast in latter, but, imho, it's very hard in former (like Java).

There's some truth in what you say. Certainly no Java environment has anything
like an acceptable level of interactivity. OTOH, Java isn't really about
"top-down" development -- it's about OO programming which is neither top-down
nor bottom-up (though it's closer to the latter).

Please don't take this as an insult, but from the languages you list (and
especially from your preference for Lisp[*]) I doubt whether you have
experience of OO programming. Or at least, I think it's entirely possible that
you don't have that experience.

BTW, programming web applications must be just about the worst possible way to
learn Java programming -- as you are discovering...

-- chris

([*] Lisp is a fine language for those who like it, but it appears to me, as an
outsider -- and despite CLOS -- to be antithetical to OO thinking)
 
T

Thomas Weidenfeller

Denis said:
I don't need a book about
Java's syntax (I can find it in the specification)

Famous last words :) Did you have a look at the JLS (The Java Language
Specification)?. Using that one as a textbook for learning the syntax is
masochism. Sure, it is all in, but it is really not in a form for easy
consumption.

What a simple reference might answer in seconds can take hours to figure
out from the JLS.

/Thomas
 
D

Denis Nikiforov

(transmit-message (Hello 'Thomas)
(You-wrote :eek:n "Wed, 22 Mar 2006 11:45:46 +0100")
(Say '(


TW> Famous last words :) Did you have a look at the JLS (The Java
TW> Language Specification)?. Using that one as a textbook for learning
TW> the syntax is masochism. Sure, it is all in, but it is really not
TW> in a form for easy consumption.

TW> What a simple reference might answer in seconds can take hours to
TW> figure out from the JLS.

But I didn't assert that specification is a good textbook ;) I guess
Java syntax isn't so different from others (for example, Lisp differs
from others much more)... JLS looks ok and I couldn't find in it
something completely new to C++, Python and others. The problem is that
at least all books about programming languages, which I saw, describes
syntax and just syntax. Books like "Concepts, Techniques, and Models of
Computer Programming" and some books about Lisp are exceptions of this
rule.
 
L

Luc The Perverse

Chris Smith said:
Hopefully, no one here is that up-tight. Topcoder is great fun, and I'd
recommend it to anyone looking for a way to spend an evening. Don't
just do the practice problems, though; that would be missing the best
part.

Too bad I've had so little time for the last year or so...

I am usually referring people who are far below competition level - so I
defintely think the practice problems are the place to begin and almost
always say that.

To be honest - I've never myself gone beyond them (too afraid of utter
humiliation) But I will see about changing that the next open enrollment
round that comes up.
 
S

Stefan Ram

Chris Uppal said:
([*] Lisp is a fine language for those who like it, but it
appears to me, as an outsider -- and despite CLOS -- to be
antithetical to OO thinking)

Alan Kay coined the term »object-oriented« in 1967.
In 2003, he wrote:

»OOP to me means only messaging, local retention and
protection and hiding of state-process, and extreme
late-binding of all things. It can be done in Smalltalk
and in LISP. There are possibly other systems in which
this is possible, but I'm not aware of them.«

http://www.purl.org/stefan_ram/pub/doc_kay_oop_en
 
D

Denis Nikiforov

(transmit-message (Hello 'Chris)
(You-wrote :eek:n "Wed, 22 Mar 2006 10:31:32 -0000")
(Say '(

CU> There's some truth in what you say. Certainly no Java environment
CU> has anything like an acceptable level of interactivity. OTOH, Java
CU> isn't really about "top-down" development -- it's about OO
CU> programming which is neither top-down nor bottom-up (though it's
CU> closer to the latter).

For me OO is mainly a way of code organization. I agree that OO could be
used like _one of_ the ways of thinking. In Lisp then I want to extend
language to support some cool feature (special form of loop, coroutine,
continuation or something else) I just write it. I call it bottom-up,
creative approach. In Java smart engineers (somewhere in the sky) wrote
a language specification for me and some little closer and a little less
smart engineers writes specifications for my (assumed) work. My
(assumed) work is to implement this specifications. I call it top-down
approach. Both approaches sometimes good, sometimes bad. As I guess, in
learning former approach is better, and I can't agree that Java supports
this approach well. But, first, it doesn't mean that Java is a bad
language, it's just hard to learn to think learning just Java and,
second, my opinion means absolutly nothing because I'm a newbie ;)

CU> Please don't take this as an insult, but from the languages you
CU> list (and especially from your preference for Lisp[*]) I doubt
CU> whether you have experience of OO programming. Or at least, I
CU> think it's entirely possible that you don't have that experience.

CU> BTW, programming web applications must be just about the worst
CU> possible way to learn Java programming -- as you are discovering...

But learning Java isn't my main target, it's just a tool. For now my
undertaking is a model-based webapp design. I can use any adequate
language I want, and I choosed Java because it has some good
characteristics.

CU> ([*] Lisp is a fine language for those who like it, but it appears
CU> to me, as an outsider -- and despite CLOS -- to be antithetical to
CU> OO thinking)

I agree with it. Lisp gives you absolute freedom, it doesn't force you
to use special way of thinking (like OO). I guess OO isn't an overkill
approach.
 
D

Denis Nikiforov

(transmit-message (Hello 'Denis)
(You-wrote :eek:n "Wed, 22 Mar 2006 17:39:17 +0500")
(Say '(

DN> In Lisp then I want to extend language to support some cool feature
DN> (special form of loop, coroutine, continuation or something else) I
DN> just write it.

Actually, it's not so cool features, during Java learning my imagination
became doze ;) Cool features are new type systems based on something
like ACL2, object system extended with something like Lisa, mathematics
calculations formalized using Axiom, different emdeded DSLs and etc. ;)
I can extend Lisp with all this apps or can write something similar but
much simpler by myself.
 
P

Patricia Shanahan

Thomas said:
Famous last words :) Did you have a look at the JLS (The Java Language
Specification)?. Using that one as a textbook for learning the syntax is
masochism. Sure, it is all in, but it is really not in a form for easy
consumption.

What a simple reference might answer in seconds can take hours to figure
out from the JLS.

/Thomas

I think JLS reading may depend on how much practical language lawyering
one has done in the past, and on fluency in formal grammars. I find it
easier to get answers about Java syntax from the JLS than from any other
reference.

Patricia
 
M

Monique Y. Mudama

I think JLS reading may depend on how much practical language
lawyering one has done in the past, and on fluency in formal
grammars. I find it easier to get answers about Java syntax from the
JLS than from any other reference.

It may also depend on the depth of understanding needed. Most
references will give you a close enough approximation for most uses.
The JLS is the real deal. The only reason the JLS is difficult to
read is that it must cover every possible circumstance. Philosophy
books are hard to read for the same reason.
 
R

Roedy Green

What a simple reference might answer in seconds can take hours to figure
out from the JLS.

It is a book for language lawyers, for those writing compilers to
decide fine points. There are some with oracular powers at divining
its meaning. When Patrician Shanahan is about, I turn to her for
enlightenment on its intent.

For most simple things, a few experiments settle the matter quickly.
The nice thing about such experiments is you don't have to be able to
formulate your questions in English or decipher someone else's. It is
all very much legal/not legal.

The disadvantage of an experiment is that if there is a bug in the
compiler, you won't detect it.
 
R

Roedy Green

Is there any tutorial/book like "How to program in Java fast." or "How
to setup environment for interactive and effective Java development."?

The key is to find a book that matches your current skill level well.
Ideally, you want one that does not tell you anything you already know
and does not presume you know something you don't. Nothing beats
reading a few pages at a bookstore to narrow down the candidates. If
the book is opaque in the bookstore, it will be opaque when you get
home.

I love books with complete source code. That I can generally figure
out even if the author's prose is atrocious.

For a painless intro to Java, try Peter van Der Linden. Most books
feel like a slog, his like a romp. I am a little biased since I helped
edit the sections on generics and enums.

Just Java 2, Sixth Edition
http://www.amazon.com/exec/obidos/ASIN/0131482114/canadianmindprod


see http://mindprod.com/jgloss/gettingstarted.html for other
recommendations.
 
W

Wibble

Chris said:
Denis Nikiforov wrote:

Ohh... ;( I'm afraid Java isn't best language for learning of
programming. IMHO, it's based mainly on engineering tradition and uses
top-down approach. For learning I preffer language like Lisp based on
designer tradition with bottom-up approach. There is no problem to
program fast in latter, but, imho, it's very hard in former (like Java).


There's some truth in what you say. Certainly no Java environment has anything
like an acceptable level of interactivity. OTOH, Java isn't really about
"top-down" development -- it's about OO programming which is neither top-down
nor bottom-up (though it's closer to the latter).

Please don't take this as an insult, but from the languages you list (and
especially from your preference for Lisp[*]) I doubt whether you have
experience of OO programming. Or at least, I think it's entirely possible that
you don't have that experience.

BTW, programming web applications must be just about the worst possible way to
learn Java programming -- as you are discovering...

-- chris

([*] Lisp is a fine language for those who like it, but it appears to me, as an
outsider -- and despite CLOS -- to be antithetical to OO thinking)
I'm an old Lisp hack, now a java programmer.
I think you're wrong about lisp being anti-oo.
Symbolics had a completely OO window system in the 1970's
and CLOS is a more complete object system than
java has. Most lisp programmers I know are
writing entirely OO apps these days.

As a general rule, you trade compile time type
checking for interactivity. There's probably
no fundamental reason this has to be true but
languages with some type safety, like java & C++
are not interactive while perl, python, ruby &
lisp are interactive but not type safe.

I prefer programming in lisp too, and every now
and then I write myself an emacs macro, but
its essentialy a dead language.
 
C

Chris Smith

Roedy Green said:
[The JLS] is a book for language lawyers, for those writing compilers to
decide fine points. There are some with oracular powers at divining
its meaning. When Patrician Shanahan is about, I turn to her for
enlightenment on its intent.

That's considerably overstated. It's certainly not a book to learn
from, nor for a relative beginner... but I'd doubt someone's
understanding of Java if they can't comprehend the spec and claimed to
be an accomplished developer. When one rejects the idea that a good
developer needs to memorize the language, the next logical option is
that the good developer has the tools to look things up quickly and
easily and authoritatively.
For most simple things, a few experiments settle the matter quickly.
The nice thing about such experiments is you don't have to be able to
formulate your questions in English or decipher someone else's. It is
all very much legal/not legal.

This is very dangerous whenever you might run into undefined/unspecified
behavior or portability issues. For that reason, I'd recommend such
experimentation only when combined with a rudimentary understanding of
what is and isn't guaranteed. In Java, the problematic bits are nicely
isolated: file paths and other OS stuff, and multithreading, mainly.
You just need to be careful about relying on experimentation all the
time.

In other languages, you have to be more careful. Java is unique in
that, for the most part, the only choices are between well-defined
behavior or a compile error. That is most assuredly not true, for
example, in C.
The disadvantage of an experiment is that if there is a bug in the
compiler, you won't detect it.

That's really the least problem in the list of problems with that
approach. I've only ever seen one compiler bug in a compiler that I
actually used at the time, and it was in an Eclipse milestone and
pertained to code that no one would probably see. (Early Eclipse
"Cheetah" releases were pretty bad, but no one used them either.) The
bigger problem is explained above.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
C

Chris Uppal

Stefan Ram wrote:

[me:]
([*] Lisp is a fine language for those who like it, but it
appears to me, as an outsider -- and despite CLOS -- to be
antithetical to OO thinking)

Alan Kay coined the term »object-oriented« in 1967.
In 2003, he wrote:

»OOP to me means only messaging, local retention and
protection and hiding of state-process, and extreme
late-binding of all things. It can be done in Smalltalk
and in LISP. There are possibly other systems in which
this is possible, but I'm not aware of them.«

http://www.purl.org/stefan_ram/pub/doc_kay_oop_en

I agree that Lisp is one of the few languages possessing the necessary
flexibility (and I more or less agree with Alan Kay's view that it /is/
necessary), but I still think that Lisp is (in practise) antithetical to OO
thinking. It appears to promote a code-centric mindset rather than an
object-centric one.

Witness Denis's reply in this sub-thread:

Denis said:
For me OO is mainly a way of code organization. I agree that OO could be
used like _one of_ the ways of thinking. In Lisp then I want to extend
language to support some cool feature (special form of loop, coroutine,
continuation or something else) I just write it.

The specific thing that I consider typical of a Lisper is Denis's assumption
that extending the expressible domain is as matter of extending the language,
rather than of extending the domain to which the existing language applies. To
reduce it to a caricature, where a Lisper implements abstraction by extending
the semantic tower upwards[*], an OO-er just adds another object or two.

([*] possibly, but by no means necessarily, invoking Lisp's macro facility)

BTW, Denis:
Actually, it's not so cool features, during Java learning my imagination
became doze ;) Cool features are new type systems based on something
like ACL2, object system extended with something like Lisa, mathematics
calculations formalized using Axiom, different emdeded DSLs and etc. ;)

Agreed that these ideas are cooler[*] than your first bunch ;-) I'm afraid
that you'll just have to accept that in Java these kinds of ideas are so out of
range that they'll never be achievable. The language designers' heads are not
in anywhere like that kind of space. And I don't think they ever will be.
Java is /designed/ to be a limited, boring, language.

BTW, you might find OpenJava interesting:
http://www.csg.is.titech.ac.jp/openjava/
one attempt to open up Java's MOP.

-- chris


[*] Just for interest, and maybe for illustration, here's how your examples
strike a hard-core OO-er.
new type systems based on something like ACL2
Type systems are about code, not behaviour, so who cares ? Now if you were
talking about incorporating ACL-like concepts into the runtime /behaviour/ of
objects, then that /would/ be interesting. The MOP-ery needed is way outside
what's possible in Java, of course.
object system extended with something like Lisa
Just more objects. Maybe some MOP-ery required too if you want to apply these
concepts to /arbitrary/ pre-existing objects.
mathematics calculations formalized using Axiom
Just more objects.
different emdeded DSLs
Just more objects.
 
C

Chris Uppal

Denis Nikiforov wrote:

[me:]
But learning Java isn't my main target, it's just a tool. For now my
undertaking is a model-based webapp design. I can use any adequate
language I want, and I choosed Java because it has some good
characteristics.

Unless the "some good characteristics" give Java a quite overwhelming advantage
(for your purposes), I suspect you may be using the wrong language. You might
find that either Rails (over Ruby) or Seaside (over Squeak or VW Smalltalk)
suits you much better.

-- chris
 
T

Timo Stamm

Wibble said:
I prefer programming in lisp too, and every now
and then I write myself an emacs macro, but
its essentialy a dead language.


Do you know why that is so?

I have never used Lisp, but I think I have a grasp of it's concepts, and
I think that it is far superior to a lot of languages that are common
today, and at least a very solid alternative to the better ones.


Timo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,588
Members
45,094
Latest member
PollyBlau4

Latest Threads

Top