Language syntax’s, performance, PHP, Ruby, Java and who’s better? Ahhhh! -
I was reading on The Server Side and came across this post:
which is part of this overall discussion:
Tim Bray: Java is less scalable than PHP
The overall topic is interesting, especially since the premise is further clarified by the person who did the presentation, who goes on to point out that, what heâ€™s attributed to having said, is not what he actually said! Making a good point of the idea that context, presentation, etc. all affect the meaning of any statement whether itâ€™s with humans or computers.
Having said, that, my post starts off dinging him on a better syntax for the Lisp and Smalltalk he shows or mentions and then goes into a rant on our current state of affairs.
So here it is:
The Lisp and Smalltalk can be just as simple.
Here is an example:
(loop for n from 1 to 10 do
(format t "i is ~A~%" n))
i is 1
i is 2
< removed for brevity >
i is 9
i is 10
Smalltalk is just as easy:
1 to: 10 do: [:each | Transcript show: "i is ", each]
The post also had this quote:
These last 30+ years have taught us that most programmers feel reasonably >comfortable with languages that follow the syntax pioneered by C and >Basic.
Iâ€™m not so sure Iâ€™d agree with that. There are many programmers that did quite well with Lisp, COBOL, ADA, Smalltalk, RPG, Perl, shell, Fortran, etc. The things and ideas your exposed too, along with the multitude of ways that you learn to think, affect more about which languages you are comfortable with than syntax. I started with Basic, Forth and Assembler, but once I learned Lisp and Smalltalk, I found that they allowed me to think in much more flexible and effective ways and to solve problems of greater magnitude. I continue to find that true to this day.
While I can get things done in Java or C++, the work and bastardization of my ideas that must take place due to the constraints of the language structures and features, make me do much more work than Iâ€™d like. And this is even with all the frameworks etc., I can not easily encode many ideas without ending up in pattern-itis and code bloat. And on top of that quite a few of those frameworks have there own views of the world and structures/patterns I must conform too.
I think it is lost on todayâ€™s programmers and enterprise developers that the Smalltalk and Lisp systems of the late 70â€™s and going through the early 90â€™s did windowing, networking, email, threading, document systems, etc. all on systems that used about 1/5 th the code as compared to C/Unix versions of similiar tools. We also get many of the techniques for optimization of the JVM and OO systems from work on or inspired by those early systems. (Hotspot came from Strongtalk and Self work) To this day those systems can perform just as well or better than the JVM.
But like I said, I think a lot of this is lost on most programmers today. They tend to worry about IDE refactoring across many hundreds of files (what happened to loose compling??), type inferencing (they donâ€™t know that HotSpot doesnâ€™t use most of the typing in the code, but chooses the best code path from cached run-time generated native code), theyâ€™re interface and delegation happy (while not learning from the bloat that caused in the MS COM world) and a lot refuse to open their minds to learn from many other languages, tools and approaches because itâ€™s not the religion of today!
Iâ€™ve see a lot of this cycle and rhetoric before though, so history is just repeating itself. The C++ prgrammers poo-pooed the Smalltalkers and at first the Java guys as well, till they themselves became Java users. As Java pulled in VM technology from Lisp and Smalltalk and got faster, and started to run on as many platforms as Smalltalk (most people donâ€™t know that in the early 90â€™s that Smalltalk ran on approximately 40 platforms in a true write-once run-anywhere mode not the dream Java had for the first few years), more and more programmers jumped on the bandwagon.
Now the Java world is being shacken up, but this time, they are sounding like the C++erâ€™s of old, but itâ€™s funny, because some of the Java old guard are leaving the religion and seeing the bigger world again. Not only that, theyâ€™ve seen that you can get more and more dynamic and still perform and have safe tested systems. Theyâ€™ve also seen that all those patterns and work arounds theyâ€™ve been applying to try to get back that dynamic behavior theyâ€™ve so wanted arenâ€™t needed as much or at all in some of these new languages and systems.
We still here a common theme though! Most still want type safety. Lisp proves you can have both worlds and people are going that way. I think people want a language that lets you add type safety as needed. Itâ€™s the future and even the guys as SUN know that other languages are coming and they are maneuvering to try to be ready for the next big thing.
Am I saying Java dead or less useful? Not at all! What I am saying is that as we wish for more and challenge Java more, we are wanting more of what we already have great examples of. We must continue to open our minds to not only what is new, but to what is old but new to us! We need to see the power of that old stuff, and remember to be humble, b/c the reality is that a lot of what we think is new has already been done almost 30 years ago by some very smart people, many of whom still go to work today like you and me, but who are very patient, knowing that great things have a way of reappearing.
Keep your eyes open and remember just as Java has opened peoples eyes and incorporated many lessons from what was done before it, it can continue to do so, but it may well be passed by, by some new language and toolset. SUN is trying to make sure they are a part of that revolution or evolution whichever one it is.
Java brought together in one package a lot of the things that people needed and wanted at the time, such as familiar syntax, platform portability, basic abilities to do netowrking and web work, then added everything that people learned from the old CICS systems and CORBA enterprise knowledge. Thatâ€™s a big chunk of computing and they assembling it all together in Java and it is a great feat! Great for all of us!
Now some people are looking back at other things that were learned and achieved and hoping to add the best of those other ideas as well. Quite a lot of these â€œnewâ€ things were again found in those old research systems. (Not suprising really). I for one canâ€™t wait. Theyâ€™re awesome systems.
In the interest of disclosure, I have two Lisp Machines, several Smalltalk systems and am a devout believer in the dynamic, exploratory programming style that those systems encourage. I have worked on and solved many large mission critical and corporate applicaitons with said tools as well doing the same for similiar systems in Java and C++.
Off the high horse nowâ€¦ and I hope youâ€™ve found this thought provoking!