LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-08-2008, 11:52 PM   #16
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50

Quote:
Originally Posted by mannclay View Post
So, why is OOP pushed so hard?? hard enough to make me question my own interest in learning programming basics from C?
Well, some people have a bug up ...

There are fanatics of any programming language or even programming concept. At one time Pascal was the king of languages and all other computer languages will be forgotten in only a few years. Yeah - and where's Pascal now?

Then there's OOP - but don't confuse OOP and C++ - read about 'smalltalk' if you want some clue about the OOP inventor's ideas. So there are OOP fanatics tied to one language or another (and they are possibly more hostile to the other language than to a language which doesn't claim to be OO). OOP is the best thing on the planet and all other programming languages will die in just a few years.

You will also see fanatics of other concepts such as strict type-checking, magic garbage collection, and so on. The trick is to know what you're doing and what you're trying to achieve - and if you're really good you'll learn to ask the fanatics all sorts of simple but fundamental questions which they will not be able to answer...
 
Old 11-09-2008, 02:15 AM   #17
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Quote:
s*** java is on top, I sense the end of the world
LOL, yeah, that could explain why some people think the LHC is going to end in apocalypse. Nearly all of it is programmed in java. So far for anyone pretending that java is slow and unreliable. Or they may be right - oh no, here comes the black hole!

Last edited by jay73; 11-09-2008 at 08:00 AM.
 
Old 11-09-2008, 03:28 AM   #18
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Quote:
Originally Posted by jay73 View Post
LOL, yeah, that could explain why some people think the HCL is going to end in apocalypse. Nearly all of it is programmed in java. So far for anyone pretending that java is slow and unreliable. Or they may be right - oh no, here comes the black hole!
Programmed in Java? OH! *That* must be the 'beast' referred to in the Book of Revelations! We *are* doomed! For people who remember ancient comedies from the UK, imagine John Laurie staring into the distance and muttering "doomed ... doomed ..."
 
Old 11-09-2008, 10:04 AM   #19
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by jay73 View Post
LOL, yeah, that could explain why some people think the LHC is going to end in apocalypse. Nearly all of it is programmed in java. So far for anyone pretending that java is slow and unreliable. Or they may be right - oh no, here comes the black hole!
I have a very hard time believing this.

I would quickly believe that the component that is intended to use otherwise unused CPU cycles in machines around the world would be in Java, but that certainly isn't "nearly all" of that system, and I seriously doubt that the major components of the system - the components that control and monitor the LHC itself and collect the data - have any Java in them.
 
Old 11-09-2008, 10:19 AM   #20
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Straight from the horse's mouth:
http://cerncourier.com/cws/article/cnl/34848

Last edited by jay73; 11-09-2008 at 10:22 AM.
 
Old 11-09-2008, 11:39 AM   #21
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
All I can say is "wow!"
 
Old 11-09-2008, 02:20 PM   #22
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Quote:
Originally Posted by jiml8 View Post
All I can say is "wow!"
Yeah, there's no accounting for taste in programming language, eh? Now - is it compiled Java or pseudo-code? Put it on Winduhs and you have an excuse to buy a few thousand more cores for that supercomputer.
 
Old 11-09-2008, 02:25 PM   #23
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Quote:
Originally Posted by jay73 View Post
LOL, yeah, that could explain why some people think the LHC is going to end in apocalypse. Nearly all of it is programmed in java. So far for anyone pretending that java is slow and unreliable. Or they may be right - oh no, here comes the black hole!
I know, mostly I thought it was nonsense until I heard they used java ... prepare for the end
 
Old 11-09-2008, 02:37 PM   #24
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by H_TeXMeX_H View Post
I know, mostly I thought it was nonsense until I heard they used java ... prepare for the end
At least, the end should be slow - due to Java performance issues .
 
Old 11-10-2008, 12:31 AM   #25
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by Sergei Steshenko View Post
At least, the end should be slow - due to Java performance issues .
Nice to know that we are gonna have a slow and painful death

Well, besides jokes from those of use who dislike Java and sometimes are a little more biased that I would like to be, this demonstrates that ultimately is the skill of the programmer which counts.

However, not all language are good for everything, and Java is not an exception.
 
Old 11-10-2008, 03:51 AM   #26
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Don't expect that a slow death. Quoting the CERN guy:
Quote:
In the past, Java had a reputation for being slow compared with traditional languages, such as C++ and Fortran. Today, however, with advances in compiler technology, it equals and sometimes outperforms C++ in many benchmarks.
I definitely agree with that statement.

Java has superseded C, C++, Fortran, Cobol and the likes in many areas. C is slowly becoming a niche programming language while Java is now amongst the general purpose ones.

Unlike the java bashers I read in that thread, I feel very comfortable with Java. I used to program in C twenty years ago and I love this language. I occasionnaly still write code in C and have fun doing it.
However, I slowly switched to Java in the late nineties. At that time, Java was indeed a poor performer but its other qualities were already worthing the move. I'm always disappointed to see people having such a negative and misinformed opinion about Java.
 
Old 11-10-2008, 04:40 AM   #27
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by jlliagre View Post
Don't expect that a slow death. Quoting the CERN guy:

I definitely agree with that statement.

Java has superseded C, C++, Fortran, Cobol and the likes in many areas. C is slowly becoming a niche programming language while Java is now amongst the general purpose ones.

Unlike the java bashers I read in that thread, I feel very comfortable with Java. I used to program in C twenty years ago and I love this language. I occasionnaly still write code in C and have fun doing it.
However, I slowly switched to Java in the late nineties. At that time, Java was indeed a poor performer but its other qualities were already worthing the move. I'm always disappointed to see people having such a negative and misinformed opinion about Java.
AFAIK, Java runtime is implemented in "C", not even in C++.

And from programmer's point of view, just have a look at, say, the right column (compared to the left) here:
http://www.ultimatepp.org/www$uppweb$vsswing$en-us.html .

Admittedly, part of the overhead is not Java itself, but the strange desire to first declare private variables and then to declare public methods to set/get them, but prevalent fashions tell a lot about the ecosystem ...

Interestingly enough, C# has default setters/getters which can be later overridden, so, at least, no private members <-> public methods default craze.
 
Old 11-10-2008, 05:36 AM   #28
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Quote:
Admittedly, part of the overhead is not Java itself, but the strange desire to first declare private variables and then to declare public methods to set/get them, but prevalent fashions tell a lot about the ecosystem ...
So what happens if you write a library and you provide direct access to all your variables? If you see a reason to refactor - and it happens more often than you think - you are bound to the current interface because client developers have come to depend on it. Change the interface and you cause massive code breakage and treat yourself to a stream of angry mails. In other words, you have tied yourself by the hands and the feet. On the other hand, if you use setters and getters, you can strip out/ reimplement nearly anything and you have greatly reduced the risk of incompatibilities

Quote:
Interestingly enough, C# has default setters/getters which can be later overridden, so, at least, no private members <-> public methods default craze.
What is the point of using default setters and getters if your members aren't private in the first place?

Last edited by jay73; 11-10-2008 at 06:27 AM.
 
Old 11-10-2008, 09:19 AM   #29
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by jay73 View Post
So what happens if you write a library and you provide direct access to all your variables? If you see a reason to refactor - and it happens more often than you think - you are bound to the current interface because client developers have come to depend on it. Change the interface and you cause massive code breakage and treat yourself to a stream of angry mails. In other words, you have tied yourself by the hands and the feet. On the other hand, if you use setters and getters, you can strip out/ reimplement nearly anything and you have greatly reduced the risk of incompatibilities



What is the point of using default setters and getters if your members aren't private in the first place?
"Refactoring" is my favorite word among OOP proponents - it means:
  1. we first do, then think;
  2. when we realize we've screwed up; we rewrite the code;
  3. we use the "refactoring" euphemism to cover our screwup.

Regarding

Quote:
what happens if you write a library and you provide direct access to all your variables
I did _not_ write this.

In fact, I'm very much _for_ encapsulation.

Logically first to encapsulate a variable by making it private and then to allow access to it using public methods is, at least, funny.

Again, the difference between

Code:
instance.a = foo;
and

Code:
instance.set_a(foo);
is purely syntactic.

And the point of default setters/getters is that if instead

Code:
instance.a = foo;
behavior you suddenly want

Code:
instance.a = 2 * foo;
one you add an explicit setter for 'a' in the class description, i.e. the compiler will use overloaded '=' for the 'a' data member.

I think it's a good idea - because writing all those 'set' and 'get' methods the way it is done in Java is simply brain dead.
 
Old 11-10-2008, 01:27 PM   #30
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Quote:
In the past, Java had a reputation for being slow compared with traditional languages, such as C++ and Fortran. Today, however, with advances in compiler technology, it equals and sometimes outperforms C++ in many benchmarks.
I'll believe it when I see it...
http://shootout.alioth.debian.org/gp...ient&lang2=gcc
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Chrome grabs 1% of browser market in under 24 hours LXer Syndicated Linux News 0 09-03-2008 11:41 PM
LXer: Ingres grabs Thinking Instruments LXer Syndicated Linux News 0 07-26-2006 06:54 AM
Screen Grabs and The Gimp Jongi SUSE / openSUSE 2 12-20-2005 10:32 AM
Realplayer grabs *.rpm on download jackdoll Linux - Software 4 06-22-2005 06:04 PM
reading gdesklets/rss-grabs in new tab in firefox sterrenkijker Linux - Software 0 09-22-2004 01:29 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration