IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Tilting at windmills: classes vs objects
I've been learning java lately. According to convention, everything in java is an object. But there are things in there that I don't think really are objects, even if the syntax is the same and that's what Sun calls them.

For example, you write a "Bycycle" class. Not only does it have methods and properties, but it represents a "thing". You can create an instance of "a bycycle". Then you have the "Math" class. Ummm ... can I have an instance of "a math"? What the hell does that mean?

Everyone from the people who wrote the language to the slavering hordes who use it may call it an object, but it's not. It's a class. I know there's a difference.

There may be some advantage to using the same syntax for both, and for describing them the same way. But I'm convinced it's more expressive to recognize the difference between the two, even if it's only calling one "a class" and the other "an object".
===

Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats].
[link|http://DocHope.com|http://DocHope.com]
New Er, no.
Everything in Java (except primitives) is a class. Instances of classes are objects.

Classes can be instantiated. You can do someObject.getClass(), which returns the instance of the Class class for that class. That instance is an object, and can be manipulated, passed around, etc. just like an object.

Classes can have static methods, which are essentially the same as C functions with a namespace: you call them directly, and don't need an instance to make the call. What happens behind the scenes is that a Class object for that class is instantiated (if it isn't already), and that's what gets called. Class objects are singletons; only one Class instance of any class will ever be instantiated in the VM.

And if you understood that the first time through, you're better than I am. ;-)
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Well ...
I did understand it all the first time through. But only because it's exactly the same as in PHP. Except that php doesn't enforce most of the rules of private, static, etc until php5.

But my little rant up there was in response to someone's insistance -- no, I don't remember whose -- that everything in java is an object.
===

Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats].
[link|http://DocHope.com|http://DocHope.com]
New They're wrong.
The existence of primitives falsifies that claim immediately.

As far as the VM is concerned, everything that you *use* (apart from primitives) is an object. How you access them varies according to instance calls vs. static calls.

Sounds like PHP has Java Envy...
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New I'd say parallel development
Shows the difference between an OSS project and a corporate gig. Java started with a design. PHP grew up from a hack.
===

Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats].
[link|http://DocHope.com|http://DocHope.com]
New I dispute that claim
Java started as a hack - a toy language to run in VCRs and such.

Since it was meant to be a throwaway, not a lot of thought went into it I think.



"The significant problems we face cannot be solved at the same level of thinking we were at when we created them."     --Albert Einstein

"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses."     --George W. Bush
New Exactly.
I usually summarize my view of Java something like this: "Java was some one's neat little school project that other people took entirely too seriously and foisted upon more people who didn't deserve to be so encumbered."
bcnu,
Mikem

Eine Leute. Eine Welt. Ein F\ufffdhrer.
(Just trying to be accepted in the New America)
New History of PHP in question
Shows the difference between an OSS project and a corporate gig. Java started with a design. PHP grew up from a hack.

My impression is that OOP was added on to PHP as an afterthought because one of the cofounders of it does not think much of OOP. As PHP became more popular, more people wanted Java-like OOP capabilities, perhaps out of habit.

Similarly the originators of Java didn't give much thought to meta abilities in Java, and the later changes to add it seem hacky to many. It is a matter of priorities of the originators.
________________
oop.ismad.com
New PHP started as less then a scripting language
The first version of PHP was just a way to embedd server side tags in pages for things like hit counters.

People wanted more and more features added, till somebody eventually added an IF tag and the race was off to create a real languages.

As PHP was used for more and more complex projects, the capacity for OO programming was more desirable.

OO is overkill for a lot of trivial web projects. But if you need to create a truely complex and powerful system, it is a big advantage.

There is a reason PHP is on version 5 when most other languages only have two or three versions no matter how old they are.

Jay
New Them 'er fightin' words
OO is overkill for a lot of trivial web projects. But if you need to create a truely complex and powerful system, it is a big advantage.

Yeah right. Wherezduproof. Let's not go there today.
________________
oop.ismad.com
New I think PHP's upgrades are just practical.
I've done some things in PHP4 that butted up against what the language could do with objects. V5 largely moves those fences further out. For example: PHP4 has class functions, but no class variables. This is a distinct lack. V5 remedies that.

Wade.

Is it enough to love
Is it enough to breathe
Somebody rip my heart out
And leave me here to bleed
 
Is it enough to die
Somebody save my life
I'd rather be Anything but Ordinary
Please

-- "Anything but Ordinary" by Avril Lavigne.

Expand Edited by static Jan. 13, 2005, 12:15:54 AM EST
New By "class variables" you mean "static" class variables?
===

Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats].
[link|http://DocHope.com|http://DocHope.com]
New Er, yes.
As opposed to instance (or object) variables. The PHP terminology calls them class functions and object functions. I think I picked up "instance variables" from Smalltalk.

Putting aside any potential puns, that is.

Wade.

Is it enough to love
Is it enough to breathe
Somebody rip my heart out
And leave me here to bleed
 
Is it enough to die
Somebody save my life
I'd rather be Anything but Ordinary
Please

-- "Anything but Ordinary" by Avril Lavigne.

New What to say if someone says that...
Ask them what methods you can call on 1 in Java.

As Scott was getting at, 1 is a primitive, not an object.

By contrast in a TRUE object-oriented language like Smalltalk or Ruby, 1 IS an object and you CAN call methods on it. Heck, in Ruby if you want you can even add methods to class FixNum and then call them on individual numbers.

Cheers,
Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New Nit
Technically, there's one class object per ClassLoader per JVM, so it's possible to have multiple instances of a Class object in a single JVM (sorry for the nit).

Dan
New Actually, that's not a nit
That's an important clarification if you're doing J2EE programming. Thanks.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New a class is a type of object
a bycicle class is an object of bycicles. Just like an index class is an object of tables /me/dux :-)
regards,
daemon
that way too many Iraqis conceived of free society as little more than a mosh pit with grenades. ANDISHEH NOURAEE
clearwater highschool marching band [link|http://www.chstornadoband.org/|http://www.chstornadoband.org/]
New It's tables all the way down. :-)
Ain't that an LRPD already?
New ICLRPD (new thread)
Created as new thread #190018 titled [link|/forums/render/content/show?contentid=190018|ICLRPD]
--
Steve
New Very astute observation
Classes aren't objects in Java. Sort of. Its confusing because there is a class called Class. This isn't really the class though. A better name would have been ClassDescription. Its an object that allows you to dig through the definition of a given class (examine method names, arg lists, and such).

But this class description thing isn't really THE class (even though its called Class).

If you define this:
\nclass Foo\n{\n    public static void f() { System.out.println("Foo.f() - I think"); }\n}\n\nclass Bar extends Foo {}\n

It is not possible to determine from within f() the difference between Foo.f() and Bar.f(). IOW, you can't tell whether the message f() was sent to the class Foo or the class Bar.

That's because there is no "this" pointer that points to the "receiver" of the invocation BECAUSE there is no object that represents the class Foo (or Bar, for that matter).

So classes aren't objects in Java much like they're not objects in C++. They are figments of the compiler's (and Gosling's) imagination.

Just one more annoying (and pointless) inconsistency and complication in the language. Right up there with the idiocy of primitives.

I'd switch to [link|http://croquet.doit.wisc.edu/wiki/tiki-index.php?page=TeaTime|Tea] myself.




"The significant problems we face cannot be solved at the same level of thinking we were at when we created them."     --Albert Einstein

"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses."     --George W. Bush
New Re: Tilting at windmills: classes vs objects
Yes classes are one thing and object are another.

A class is the description on some characteristic,
if an object have those characteristic, you can say
that this object can pass as a member of that class.

XOTcl, a Tcl base OO extension, recognize this difference
this is why you must know, that learning as many programming
languages as you can is the only way to learn many things
about programming, Tcl must be on your list, Tcl is like
the best kept secret in IT

XOTcl have two commands, Object and Class
You create generic objects out of Object
and classes out of Class, and from those classes
you can create objects that are member of those classes
by birth!

But if you thing deep about it, Object is just another Class
used to create generic or pure object that don't belong to any
particular class, except for Object (you can see I am running in
circles here)

And Class is just another object, used to define objects, that
can create objects, just like Object!

So even if you are pure typeless, you are not really pure
you are of type typeless.

If you can tell, which type I belong to, you know
what I can do, and you can use me.
If you can name my attributes you know they exist
If you know they exist, you can use them

And this is how OOP is different from procedural
You don't create procedures, sequences of action

You just name names, and call those names when you need them!
Majic, the majic of OOP
New I suspected that programming would eventually converge
on its roots - - > \ufffd
freed At Last of George Boolishness
by Kurt G\ufffddel - -

to operate freely in 6-D phase-space
as Cthulhu intended:

via Zen koans.














Aaauuummmm
New Do you honestly believe that this is from TCL???
TCL may have borrowed the design, but it is not the first (or even a particularly good) implementation of it.

Incidentally TCL isn't a "hidden secret of IT". It is well known in the IT world. It isn't particularly popular because it isn't particularly good. Perhaps someday you'll have enough experience to understand why from direct experience...

Cheers,
Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New Amen
TCL sucks
New Re: Do you honestly believe that this is from TCL???
First sorry for the late reply

I am not sure what you mean when you say, that I really believe this comes
from TCL?

What does "this" refer to?

But I am guessing you probably mean the object, class separation thing!

And in that case no, not at all

XOTcl is just one of several OO extension for Tcl

And the designer of XOTcl made it that way!

I don't know how the other extension are made

But for example I heard of another OO extension for Tcl called Snit, which does not implement inheretence and advocate using delegation as a replacement!

And there is Incr Tcl, which I heard was designed after C++ OO model


I still think Tcl is a great language, and currently the one I am decide to learn, and XOTcl is the OO extension I am also decided upon!


I am slow, I know, and I quit half ways a lot, but for now and considering my career objectives to become a Developer/SysAdmin, or a SysAdmin/Developer, I think Tcl will work for me wonderfully


I said it's a best kept secret, for many reasons, one I heard other people call it that, two it's not very popular, three it's a lot better than most people think ...


That's all
New think you had better be a developer
clear lacking in logic and common sense for a sysadmin
regards,
daemon
I love her dearly, far beyond any creature I've ever known, and I can prove it, for never once in almost seventy years of married life have I taken her by the throat. Mind you, it's been a near thing once or twice.
George Macdonald Frasier
Clearwater highschool marching band [link|http://www.chstornadoband.org/|http://www.chstornadoband.org/]
New Funny; I was thinking the opposite ;)
New Ive met lots of developers that have no clue
not around here though but have/am working on the stupidest way to do things in java, perl, ksh (not my work mates they are very good)
regards,
daemon
I love her dearly, far beyond any creature I've ever known, and I can prove it, for never once in almost seventy years of married life have I taken her by the throat. Mind you, it's been a near thing once or twice.
George Macdonald Frasier
Clearwater highschool marching band [link|http://www.chstornadoband.org/|http://www.chstornadoband.org/]
New Neither
He needs to be an academic.

All puffery, no experience, no proof, no running applications required.

Not that ALL academics are like that, just it is easier to get away with it for the long haul.
New Let me get this straight
You want to be a developer, so you're learning a language that is little-used. How do you plan on being employed?

In case your market share isn't small enough, you're then limiting yourself even more by focussing on an OO extension that fragments that miniscule market even further.

And you're arguing that TCL is great with a group of people, many of whom are developers who've used TCL in the past and deliberately don't use it any more. And you don't see any cause to wonder if they might have a reason for that?

Yes, I'm sure that there are people who still think that TCL is great. They're wrong. I know that it is no longer popular. And I'm positive that you lack the experience base needed to really judge its quality.

Here's some background information for you.

The object model that you're so impressed by? That's straight from Smalltalk. Except that it works better there than in TCL because OO isn't an extension - everything in the language can be leveraged that way. People have only been playing with this since the 60's, which is probably before you were born.

And some TCL history for you. TCL originally was a scripting language based on the idea that the only real datatype that you needed was the string. Properly delimited strings can be interpreted as anything that you want. Arrays, hashes, etc. And, better yet, if you did everything this way then it is really easy to interface with C programs - you just pass a string. Which was the point, the language is Tool Command Language - the tools that made it useful are supposed to be extensions written in C.

The idea was fairly reasonable circa 1990, and the rapid emergence of some useful tools like Expect and Tk proved its value. Adoption was quick.

However the language ran into a few stumbling blocks.

First of all it didn't do the whole scripting language thing very well. At about the same time that TCL was becoming popular, so was Perl. And Perl was a lot better than TCL - you could write real programs in it. For instance while you were supposed to extend TCL in C, you were supposed to extend Perl in Perl. (You could extend Perl in C but doing it in Perl was a lot easier...) Perl avoided a lot of parsing overhead. It came up with a lot of big improvements in what regular expressions should do. And as a result, Perl wound up resetting expectations about what a scripting language should be.

Secondly many of the tools, while useful, were bad ways to develop software. For instance Expect makes it easy to automate an existing console program. However if you do that, the result is very fragile - unanticipated errors cannot readily be trapped. This is not a good way to develop complex software. It is a good way to build a quick and dirty bandaid but it will fall apart later.

Thirdly it turns out that while it was easier to build tools and integrate them with TCL, building bindings to other scripting languages isn't that hard in the end. As a result the big tools that made TCL popular, namely Tk and Expect, wound up with bindings for every other major scripting language. And with popularity the other scripting languages (particularly Perl) wound up with bindings to every useful library under the sun - including many which TCL did not get (or at least not as promptly).

The result is that by 1999 it was fairly obvious that TCL was on its way out as a major scripting language. TCL 8 was a major rewrite that, as I recall, made TCL internally move away from the "everything is a string" philosophy, which greatly improved its performance. However they didn't give up the stupid idea of trying to be POSIX compliant on regular expressions. (Hint: POSIX and Perl's extensions do not play together in any reasonable way.) And they didn't manage to turn around TCL's long-term trajectory.

So lots of people here have used TCL. We used it because at one time it was the only way to access some genuinely useful tools. But it wasn't very good, and as soon as those tools were available in a different environment, we moved away from TCL.

Cheers,
Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New very loud VD (clap clap clap)
I love her dearly, far beyond any creature I've ever known, and I can prove it, for never once in almost seventy years of married life have I taken her by the throat. Mind you, it's been a near thing once or twice.
George Macdonald Frasier
Clearwater highschool marching band [link|http://www.chstornadoband.org/|http://www.chstornadoband.org/]
New Then let me elaborate
Again thanx for your interest, your long elaborate replies are always sincere and humbling!
I am kinda shy to expose stuff that might be personal and not very interesting for others to hear, but again, maybe this will help me ...
I have to say a lil about my history to justify my choices, my degree is MIS, during the last year, it became clear to me, I AM A DONKEY, after 3 years in business school, and 2 years in engineering, I am going to graduate late and graduate without a skill!
Being skillful is very important to me, I don't want to do work that require no skill.
The net became my saviour, I surfed to learn, who is doing what, why, what is the best tool, what is systems analysis and design, what is a programming language, what does terminology x mean, how important it is to learn terminology x, etc ...
Of course nowadays we are living the dream, the net have all the answers and all the tool I need and they are free, I am saved, all I need it to take advantage of what is there and learn, and I can give back!
You know, I told you before, that I know you from your posts on perlmonks! your post on programming paradigms was enlightening to me.
There are many way to do programming, and to be good and skillful you should learn them all.
No excuse!
The best way to learn a paradigm is to learn a language that implements this paradigm.
I learn a little about a lot, I am extremely generalist, and I get bored really really fast, I get more excited over learning a solution, understand it, thinking about it than building it!
So did this lead me to Tcl?
Well, Tcl is easy to learn, so before I get bored, I would have probably learned enough to build something interesting!
There is many interesting extension for it, and many very interesting tools that uses it, OpenACS, SqlLite, AOL Server.
Tcl have many deployment facilities, starkits.
Tcl is fun, and thats key.
Some languages are good, others are fun.
Java is good, Java is widely used commercially, many frameworks built with it, a major corporation behind, improved constantly ...
You can't go wrong with Java
But Java is boooooooooooooooooooring
You have to learn a lot before you just can see anything!
I started with Java, read the first few chapters in learning Java in 21 days
And honestly, Java sucks ass!
Java is just not intelectually rewarding at all
So I moved to Python, the interactive interpreter was a blast!
Wow..
But after a lot of time with python, I realized that python was as dull as java better of course, less dull wouldn't disagree.
But still, it was just not intelectually rewarding!

So I had to move on, OCaml, programming for the smarties!
Spent many nights, trying to read the french book, on programming with OCaml!
Many new terminology, many new concepts, I still have no clue or real understanding of many of it's features, but I do believe OCaml is great and fun, and intelectual!

I also spent a lot of time with C, you know regardless of what you think, C is fun, it was fun to understand how to dynamically allocate memory for a mutlidimension array, tryin to visuallize it and rationalized, this was fun!

Then came the time, I just have to see more, investigate ways.
It was time for GUI and event based programming, I first looked at GTK, but that's where the C fun stopped, and Tcl seemed where I should go!

I still have not learned the Tk extension, but as far as I am concerned, it will be fun, and intlectually rewarding!

Plus Tcl is fun, the idea that everything is a string, is super fun to think about it, my intel processor is a machine, that think everything is a binary number, my Tcl program is a machine that think everything is a string!

Could this be another way to look at polymorphism?
Yea, I think so, maybe I am wrong
But I get to think about it, and it's fun!

Lisp should be fun, I learned a lil elisp, and well, being able to imagine how the intepreter is executing/substituting your program every step of way is fun and rewarding!

I wonna have skill, and I want to know it all, but I walking alone here, if my mind is not going to entertain me, well, I just wouldn't last!

It must be usefull and fun, I cannot afford to pick a commercial choice, if I want to last!
Plus, this will in a way go against my principal, my savior the net, the free software, all the free papers, all the forums, all the chat room!
If it wasn't for the free software, I would have never gone after programming sysadmin skills, not that I have them yet, but this is where I chose to go!

So, do I want a future in a big commercial firm! I am not rich by western standard, but thank God I am also not poor!
So I do not know, I don't think I will ever qualify for work in such a place, but I see a future in small teams, building solutions using free software!

I expect to be paid for the solution! not the tools used in building the solution!
I do not expect the user care for the tool as much as the solution!

So, this is how I think!
I want to develop the skills to build the solution!
Without strong moral principals, and tools that are fun and intelctual, I won't last! I will quit!

Sorry for the personal stuff, I don't think I am dumb or bad, I am just slow!
New "Systems", you should meet Bryce. Bryce, this is "Systems".
New BTW, "Systems": Lay off the exclamation marks. Have some ...
.............................................................................
.............................................................................
.............................................................................
.............................................................................
.............................................................................
.............................................................................
.............................................................................
.............................................................................
.............................................................................
.............................................................................
.............................................................................
.............................................................................
.............................................................................
.............................................................................
.............................................................................


HTH!


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]
New You sound like the Rincewind of programming
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New For scripting, TCL is poo.


Peter
[link|http://www.ubuntulinux.org|Ubuntu Linux]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home]
Use P2P for legitimate purposes!
     Tilting at windmills: classes vs objects - (drewk) - (35)
         Er, no. - (admin) - (14)
             Well ... - (drewk) - (11)
                 They're wrong. - (admin) - (9)
                     I'd say parallel development - (drewk) - (5)
                         I dispute that claim - (tuberculosis) - (1)
                             Exactly. - (mmoffitt)
                         History of PHP in question - (tablizer) - (2)
                             PHP started as less then a scripting language - (JayMehaffey) - (1)
                                 Them 'er fightin' words - (tablizer)
                     I think PHP's upgrades are just practical. - (static) - (2)
                         By "class variables" you mean "static" class variables? -NT - (drewk) - (1)
                             Er, yes. - (static)
                 What to say if someone says that... - (ben_tilly)
             Nit - (dshellman) - (1)
                 Actually, that's not a nit - (admin)
         a class is a type of object - (daemon) - (2)
             It's tables all the way down. :-) - (ChrisR) - (1)
                 ICLRPD (new thread) - (Steve Lowe)
         Very astute observation - (tuberculosis)
         Re: Tilting at windmills: classes vs objects - (systems) - (15)
             I suspected that programming would eventually converge - (Ashton)
             Do you honestly believe that this is from TCL??? - (ben_tilly) - (13)
                 Amen - (broomberg)
                 Re: Do you honestly believe that this is from TCL??? - (systems) - (11)
                     think you had better be a developer - (daemon) - (3)
                         Funny; I was thinking the opposite ;) -NT - (FuManChu) - (2)
                             Ive met lots of developers that have no clue - (daemon)
                             Neither - (broomberg)
                     Let me get this straight - (ben_tilly) - (5)
                         very loud VD (clap clap clap) -NT - (daemon)
                         Then let me elaborate - (systems) - (3)
                             "Systems", you should meet Bryce. Bryce, this is "Systems". -NT - (CRConrad)
                             BTW, "Systems": Lay off the exclamation marks. Have some ... - (CRConrad)
                             You sound like the Rincewind of programming -NT - (ben_tilly)
                     For scripting, TCL is poo. -NT - (pwhysall)

It's hard to be religious when certain people are never incinerated by bolts of lightning.
145 ms