ShoeHorn writes: "Here is a good article (1st of a 4 part series), that introduces you to the Ruby language. If you are currently a programmer coming from the likes of C++, Perl, or Python, you will see some strong similarities (especially to Python)."
345 comments
Why worry about importing IT workers,
by
niekze
·
· Score: 1, Insightful
when you have to deal with another stupid language every 6 months. You should only need 3 languages:
Pick one from each of the following:
(C/C++) (Perl/Tcl) (sh,ksh)
Now for the 'bonus' round. [pass go and collect $200 more a month] (php,python) and for the MS route, you only get 3:
(C++/C#) (Visual Basic/there is no other option) (Java/no other language is as useless to compete with Java)
Re:Why worry about importing IT workers,
by
garett_spencley
·
· Score: 1
Now...how far off am I?
I'm sorry but you're very off. To succesfully program on a computer system there is only one program that you need: assembly.
When it all boils down it you get assembly. All programs execute CPU instructions. And while those instructions may be just 1's and 0's I don't consider the binary numeral system to be a "programming language". Instead it's just assembly instructions being represented as binary numbers.
Heck, even interpreted languages may not translate directly into assembly, but their interpreters still execute assembly the desired assembly instructions on the CPU.
Well, as long as the interpreters are compiled anyway. I suppose you _could_ have an interpreted interpreter. Heh that got me thinking: a ruby interpreter which is written in python which is interpreted by a perl script which is interprted by a PERL implementation in Java. Oh no! I'm goign to give my self nightmares!
Anyway to bring this dumb rant to a close and to get back on topic: When it all boils down to it the only language that you _need_ to get by is assembly.
Thank you.
--
Garett
Re:Why worry about importing IT workers,
by
Anonymous Coward
·
· Score: 0
And this will help you learn the Java language. 27 issues of JDJ. Ends in just over an hour!
Re:Why worry about importing IT workers,
by
nomadic
·
· Score: 2
You forgot LOGO. Those squares won't draw themselves you know.
Re:Why worry about importing IT workers,
by
thefogger
·
· Score: 1
Okay, here come the obvious reasons NOT to use assembly:
1) It is as platform dependant as any language can possibly get.
2) It is very hard to read.
3) It is relatively hard to learn. Don't tell me assembly isn't hard, it is definetely _MUCH_ harder than Ruby which has e.g. those nice and _easy_ string manipulation possibilities.
4) Source code is huge.
Reason 4) is probably not that important. But still, if somebody wants to program a simple program to get a job done quickly, assembly is really not the language to use.
And while those instructions may be just 1's and 0's I don't consider the binary numeral system to be a "programming language". Instead it's just assembly instructions being represented as binary numbers.
I'd say this the other way arround: Assembly is a way to represent the raw binary format of 1's and 0's in a sort of human readable format.
--
Um... I didn't do it!
Re:Why worry about importing IT workers,
by
Blue+Neon+Head
·
· Score: 2
Only 3 languages? Sure, you could plausibly get by with C, Perl, and sh alone. For that matter, you could get by on C alone.
But it is NOT the case that these tools will always be the best tools for the job. A while back an excellent essay by Paul Graham was posted on/. which detailed how LISP came to be extremely handy in coding Yahoo!'s online store.
Certainly one can learn a few tools well, but there is frequently a best tool for a job, and when it comes, it's nice to have it around.
Re:Why worry about importing IT workers,
by
jeffy124
·
· Score: 3, Informative
and for the MS route
[...]
(Java/no other language is as useless to compete with Java)
I think you're under the false impression that Java was written by Microsoft. You also probably don't use java for anything hence feel it's unnecessary. If you want a good, easy to maintain and robust app on multiple platforms then use java, but if you need that app ready to go into production quickly, then java is not your best choice, scripting languages like Perl are. I havent learned Python as of yet, but based on what I'm told, it's good for getting an app done quickly.
-- The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
Re:Why worry about importing IT workers,
by
Col.+Panic
·
· Score: 1
LISP came to be extremely handy in coding Yahoo!'s online store.
Yeah, but they have to be confined to a padded cell since the experience.
My new language called "SoWhoFsckenCares"
by
Anonymous Coward
·
· Score: 0
I have invented a new language called "SoWhoFsckenCares". It has the same features of existing languages, but with a slightly different syntax. It really offers no improvements, but it is new!
It can do comparisons, branching, and looping - just like every other language! The syntax is familiar but just different enough that experienced programmers must relearn it!
Of course it is incompatible with billions of lines of existing code, but it is mine so it clearly must be better!
Please stop development in all other languages so that I can stroke my ego with my marvelous new invention!
Re:Time for an icon....
by
Anonymous Coward
·
· Score: 0
Considering how much time Taco spends on AnimeFu I don't think there should be any question at to what/. is gonna use for the icon.
Let's pretend you were writing an "rcurses" library.
Need a line of 20 "-". No problem.
Anyway, from now on we'll all contact you before adding a feature to a language.
There seems to be something about schools that systematically damps down any enthusiasm for any subject. I'm really glad that programming doesn't feel much like math to me.
Perhaps it's because most school in America, both secondary and tertiary, seems to be geared towards producing employees, and not thinkers? It used to be that you'd learn many ways of thought, and usually, many languages when persuing a CS degree. Now, they teach you C, C++, and Java. Forget that you may not learn any real science or how to think and synthesize, you're taught how to use the tools. At least they still teach students to experiment in Biology, rather that just showing them how to follow procedure and use the microscopes.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
You are raising extremely interesting questions. If people don't like many features, should language designers provide subsets that people can access easily? Could a compiler switch make C++ like Java?
Is the dislike people have for a language partly due to poor explanation of the features?
I'm not saying I know the answers. I'm just thinking that we could do better for ourselves than create an average of one big language each year.
Maybe the ideas of Perl, SmallTalk, C++, Lisp and Icon are just a subset of a larger truth that, if we recognized it, would simplify all languages.
You raise an interesting question about the politics. My guess is that, if someone knew enough to lead us in a better direction, the politics would eventually be changed to fit the new situation.
If people don't like many features, should language designers provide subsets that people can access easily?
I'm not sure that would help. People are forever sniping at C++ because it has feature X that they don't like, and yet there is no need to use operator overloading, multiple inheritance, exceptions, etc. if you don't want to.
Could a compiler switch make C++ like Java?
No. The problem isn't the differences in syntax or compilation model, so much as the underlying philosophy. C++ gives you a lot of power, but you have to work a bit to use it at times. Java is easier in some ways, but sacrifices a little of the power in exchange. Each language suits a different style of programming (and programmer) better, and neither will ever be right for everyone.
Is the dislike people have for a language partly due to poor explanation of the features?
A lot of the time, yes. Again, Java and C++ are prime examples. Many Java programmers bash C++ for not having a built-in garbage collector, and yet most of them clearly don't appreciate that you should rarely need to use new and delete in C++ anyway -- they aren't required for every class instantiation, as is the convention in Java. Poor understanding such as this is behind the vast majority of "I hate language X" rants I have seen; sadly few of them are based on any actual objective flaw in the language concerned.
Maybe the ideas of Perl, SmallTalk, C++, Lisp and Icon are just a subset of a larger truth that, if we recognized it, would simplify all languages.
I doubt it. As noted above, even comparing "similar" languages such C++ and Java, there are major underlying differences in philosophy, and as a direct result, in the programming problems each language solves best. A serious programmer working on different types of problem simply needs to have more than one tool in his box. Some problems are best solved with a "scripting" language like Perl, others with a "high-performance" language such as C, others still with an "application programming" language like Java, and still more with functional or imperative languages. As ever, you pick the right tool for the job, but no one tool has the right strengths and weaknesses for every job. Even C++, the "Swiss army knife" of programming languages, is very limited for certain types of problem.
Having said that, I think there are a limited number of understood larger truths (plural). For example, good OO design is good OO design, whether that design is implemented in Smalltalk, C++, Eiffel or Java. Each language provides different mechanisms to implement it, but there are many common underlying principles. Languages that support these features well should be seen as providing a guiding light for those that do not (yet).
Equally, a nasty OO problem (such as the infamous "deadly diamond of destruction") is a nasty OO problem, regardless of language. Some languages have better solutions than others: Eiffel lets you rename things explicitly to resolve ambiguities, C++ has the concept of virtual inheritance, and Java ducks the problem by forbidding multiple inheritance of implementation. I see Java as lagging behind here; although it avoids the problem, it does so at the expense of a useful tool, and it can force the programmer to break good OO design principles as a result. Java evangelists would do well to stop claiming that "multiple inheritance is a Bad Thing!" (clearly it isn't, in and of itself) and look to Eiffel, C++ and others for possible ways to solve the problem instead of hiding the symptoms.
You can make a similar case for most other styles of programming. Structured programming (in the technical sense of the term) in place of goto-based logic has shown its advantages clearly in procedural languages. Newer languages are adopting structured programming constructs instead as a result.
As a final example, the expressive power of functional languages is becoming more widely understood, and the principles learned there can be applied to subjects as superficially unrelated as template metaprogramming in C++. Here again, those writing the next C++ standard, looking to support generative and metaprogramming techniques better, would do well to look at how ML or Haskell approach certain problems.
So, while there may not be a single universal "truth" in programming, I think there are optimum ways to solve certain programming problems. To an extent, what you suggest is already happening, as languages dealing with those problems "learn" from others that have gone before, and move closer to providing the optimum solutions.
-- If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Re:RUBY=SUCKS
by
Anonymous Coward
·
· Score: 0
Using namespaces will save you TONS of time. It's a real pain typing out java.this.that.blah.yah.foo.bar.add(x).
You're kidding me... Microsoft is *intentionally* cripping C# by adding cruft from C++ to it? How bizarre.
Re:word math
by
_Stryker
·
· Score: 2, Informative
It could have some interesting uses. How about this (in pseudocode since I don't know Ruby):
good idea. I particularly like the pics by John Kaurin, the ruby slippers are good, but we could always go with that anime-chic to preserve Ruby's Japanese heritage:)
-- The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
I find it thoroughly annoying when I have to write little VBA dodads in Access when there always has to be an English specifier at the beginning and end of statement. a simple for loop becomes one of the following: "do while... loop" or "do... loop until". On top of that, having to throw "End Function" or "End Sub" at the end of a block of code ticks me off just as much. I'll stick to "}" thanks.
--
"Nature doesn't care how smart you are. You can still be wrong." - Richard Feynman
Re:missing the point
by
rowland
·
· Score: 2, Insightful
Wow! I nominate you for the "Sweeping Statements Award." I especially like the way you say "The object models of Python, Perl, and Ruby."
So far, I haven't heard anyone nominate these languages for "large system development," but a lot of large systems are made out of small systems, and while it is tempting to create these large systems in a uniform language (*cough*)Java(*cough*), this can be a mistake. I read a magazine article recently about a shop where they were replacing shell scripts with Java for automating tasks--which turned out to be a big mistake, considering the overhead of the Java VM.
You're right about compilation to native code being of limited benefit to these languages. For the most part, it is a "benefit" they don't need. Take, for example, creating a complex web site in C or another statically-typed, and therefore easily-compilable, language. By the time you're on your third page, you'll realize you need some kind of templating system. Next, you'll discover you need to vary the appearance of pages based on aspects of your business logic, so you add conditions to your templating system. Next, you'll find management wants to be able to update the site quickly using cheap HTML monkeys and is reluctant to spend expensive programmer time recovering old ground, so you make the site entirely data-driven. So now you have a buggy, ad hoc, poorly-documented excuse for PHP! Sure, the code you wrote is compiled, but the system as a whole is slower, and it took a whole lot longer to write.
You said, "If the scripting languages ever evolve into something like Lisp or Smalltalk, their object models, syntax, and semantics will have to change dramatically and incompatibly."
Have you ever considered that maybe these languages ARE the evolution of Lisp and Smalltalk? With all due respect to Lisp and Smalltalk, their creators didn't have the benefit of Lisp and Smalltalk when creating their languages. Larry and GVR and Matz didn't create their languages in a vacuum. Even PL/1 must be of benefit to current language designers (here's what NOT to do!).
Perhaps it would be of benefit to aspiring language designers if you could elucidate exactly how "objects models, syntax and semantics" could be improved and what the benefits would be--keeping in mind the purpose(s) of these languages.
Granted, the best programming language doesn't always win out, but the purpose of evolution is to thrive, or at least survive. I am therefore equally suspicious of praise for highly-evolved-yet-dead languages and snubs of unevolved-yet-wildly-thriving languages.
Brent
-- 100,000 lemmings can't all be wrong.
Re:so many choices
by
Anonymous Coward
·
· Score: 0
Español?? I thought they called it castalleno.
Re:word math
by
Anonymous Coward
·
· Score: 0
The '*' is not a math operator, idiot.
huh?!
Python 2.1 (#1, Jul 13 2001, 14:25:58)
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> 3 * 2.5
7.5
Oh yeah, I guess so...
Re:Strict languages vs. hacked languages
by
JimWeirich
·
· Score: 1
It seems "hack"-like features are defined as "things that could have been done in a library but ended up as part as the syntax instead".
Strictly speaking, the "*" operator is part of the standard library in Ruby, and not part of the language. If you wanted to write it yourself, rather than using the library version, you could use the following code...
class String
def *(number)
result = ""
number.times { result << self }
return result
end
end
-- -- Jim Weirich
Re:Why learn another language?
by
helixcode123
·
· Score: 2, Insightful
I appreciate and share your view that by learning multiple languages
you enlarge your toolbox, and in the big picture all languages are
intertwined. (Jeez. I sound like I'm rambling on about "The Force"
or something.)
I've noticed a similarity in my "night job" as a musician, where
playing different types music acts in a similar way to programming in
different languages. You pick up stuff in one style that can enrich
your playing of another style. Well I sure am staying on topic, eh?
One comment I wanted to make regarding Picking up another language
in a day. I agree somewhat. There was no question that after
programming in (time order) Pascal, C, Fortran, Ada, Lisp, Clips, and Scheme
I was able to "pick up" Perl pretty quickly. That said, it took some
time to really learn the Perl idioms and to do things in the "Perl
Way". I've seen my share of C code that was really Fortran written in
C, or Java code that was really C written in Java (procedural vs OO).
With appologies to Heinlein, it takes longer than a day to grok
a new language.
Re:Strict languages vs. hacked languages
by
TheTitan
·
· Score: 1
WOA WOA WOA! Hold on a sec, Ruby is far from a hacked language. If you look at its design, the underlying language/structure, and its approach to solving problems, you'll find it significantly more elegant and well designed than both Perl and Python. Please read the source code or use the language before you start tossing around opinions. Having used all three languages and extended all three using C, I strongly suggest you step back and re-evaluate your position: you might be surprised. I know I was when I did....
It's even easier. The numbers in Ruby are all objects with interesting iterator methods.
0.upto(20) {|x| puts x}
Re:Strict languages vs. hacked languages
by
Jonathan
·
· Score: 2
What's wrong with Smalltalk being "the next level"?
Well, there is a place for scripting languages and "normal" programming languages. Smalltalk competes with Java and C++. It complements scripting languages.
Re:I think this said it all...
by
RevAaron
·
· Score: 3, Insightful
Speeds up development my arse.
Heh. Does perl speed up development? Everytime I've tried to use it, I had to have multiple browser windows open for docs and other people's code, in an attempt to figure out what the hell it's goofy syntax stood for. The small script I ended up making kind-of worked- doing the same read, search-and-replace, and write back to file only works some of the time on some of the files- I try it on a different and directory and BAM it doesn't work!
I'm not saying perl is completely flaky and useless- but contrary to Wall's silly assertions, perl isn't a language you can pickup gradually, there are simply too many rules and funny symbols ($/, @_, $_ anyone?) to learn just to do simple things.
And why the hell can you only store scalars into hashes? Pffft! And don't tell me I can just use references to non-scalar data, as refs are scalar- if I wanted to deal with C's bullshit, I would.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Re:word math
by
Anonymous Coward
·
· Score: 0
Like d00d Ruby can d0 w0rd m4tH!!!!
That's s0 3l33t!!
Perl sux0rz!!
(ya you got a nice arguement going to guy, that logic is unbeatable)
Re:Strict languages vs. hacked languages
by
Woko
·
· Score: 1
Python lacks metaclasses, lacks a true unified object hierarchy, and supports multiple inheritance (considered a very bad idea by most experts in OO. Like the "goto" statement, multiple inheritance may seem useful at times but it leads to unmaintainable code).
I'd argue exactly the opposite. The OO purists insist on MI, while languages that get-by without it aren't truly OO.
Maintaining code is a pretty thankless job, but at least with MI the changes only have to be made in one place. Java's interface based MI either forces similar code to be included in each class that implements an interface or the inclusion of lots of little stub routines that to call the smae named routine on a different class.
This totally breaks the ISA relationship and turning it into more a sort of ISA, but I've also got a copy of the class as a private member as well.
In languages that implement MI sanely and give you explicit options on resolving name clashes (eg Eiffel) means there is no ambiguity about the class structure or which routine is called. http://www.elj.com/elj/v1/n1/gew/ provides a good evalutation of Eiffel's implemenation.
I can understand people being damaged and mentally scarred by C++'s implementation of MI, but to say its as bad as the goto statement is surely a troll.
--
--- Silence is consent.
Re:Is there a tutorial for perl that is simalar ?
by
Col.+Panic
·
· Score: 1
Oh yeah, thanks! Damn colons:)
Re:Strict languages vs. hacked languages
by
RevAaron
·
· Score: 2
I'm not sure how importing 'frederick' other than 'freddy' shows how Ruby is dynamic, but I'll assume you meant something that you didn' ttotally illustrate.
Smalltalk is just as (and more) dynamic. I work on an IRC client that's part of Squeak. Without restarting the client once, I added an a plug-in system and wrote a few sample bots. Pretty amazing. Change a method, and the next time it's called, it's using the new version. That's kind of difficult to do using Ruby, without an interactive environment, but I suppose it can be done with a TkListener or a thread taking irb-like evals on a socket.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Re:Strict vs. hacked languages (THIS IS A RANT)
by
Anonymous Coward
·
· Score: 0
In smalltalk the hello world is in its entirity:
'hello world' prinNl!
the string object knows how to printNl itself.
No, these three
by
Anonymous Coward
·
· Score: 0
Right, you only need 3 languages, but they are:
Fortran,
Cobol,
PL/1.
Re:Strict languages vs. hacked languages
by
harryo
·
· Score: 1
Yes. Ruby is totally dynamic. It's the only language
I know about (and that doesn't mean there aren't
others) where you can do things like...
if familiar
require 'freddy'
else
require 'frederick'
end
(Sorry about the strange format of that, but I
couldn't get a pre tag to work in/.; can someone
tell me how to get preformatted stuff into HTML posts?)
The "require" is similar to C's #include or Java's
"import".
So, this code potentially pulls in completely
different definitions of things depending on a
run-time variable.
One might ask whether this is useful in practice?
I've used it to allow
dynamic changes to a long-running program without
having to shut it down and re-start it.
Re:Strict languages vs. hacked languages
by
fgp
·
· Score: 1
> I agree Ruby and Perl seem to be like the latter type
So, have you ever actually looked at ruby?
Or are you just another troll?
Ruby actually has a lot in common with smalltalk (classes are fist-class-objects, as well as functions, you can pass code-blocks,...)
I has some "syntatic sugar", but you don't have to use it.
Please just SHUT UP if you don't really know what you are talking about. Nobody forces you to program in ruby, and nobody (well, at least nobody who knows what he is talking about) says "phyton is better than ruby/ruby is better than phyton/perl is better/perl is worse/.....).
Each language has is strenght and weaknesses, and ruby is IMHO no more or less hacked than the other two major scripting languages.
Calling a language "hacked" is always problematic(ok - lets forget about BASIC;-) ).
One could call C++ hacked - it's "features on top of features". But than- it's the most widely use language, so I guess it _MUST_ have is strengts...
Really? Could you tell me where I can obtain it then? The MSDN site only seems to have a badly written spec, dated 5/7/2001, with a large "this is incomplete" disclaimer on it...
On the other hand, I can just go visit Sun's Java site and get about as much information as I could possibly want about Java. Furthermore, Sun has demonstrated a consistent level of trust in making this information available, reliable and up-to-date over a period of several years now. While still a lesser level of security for the developer than a formal ISO standard such as C and C++ would provide, this is enough for many people to work with.
You're not just, well, blatantly falling for Microsoft hype, are you?
-- If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Re:Java has won *nothing*
by
netnic30
·
· Score: 1
Java seems to be going in the right direction but it has a long way to go before the "write once run anywhere" statement will work. Using Visual Age Java on an IBM AIX system a translated application from c -> java runs about 2x slower when ported. The JVM crashes a fair amount and requires faster CPU and gobs more memory to get the same job done.
Re:Strict languages vs. hacked languages
by
fault0
·
· Score: 1
Python can do this also, afaik
if foo:
import bar
else:
import foobar
Re:Strict languages vs. hacked languages
by
Anonymous Coward
·
· Score: 0
> FWIW, within a week you'll learn to love whitespace.
No kidding, that's why I like using pretty-printers, not being forced to be one.
Re:Strict languages vs. hacked languages
by
mj6798
·
· Score: 1
Actual programming language researchers" are typically not even interested in designing languages for general purpose use.
Neither are scripting language developers. But many good, powerful languages were developed for real-world use by people with a lot of background in programming languages:
Lisp: symbolic AI
Scheme: planning
Smalltalk: Dynabook, educational software
SML: proof systems
How were Kernighan and Richie programming language researchers but not Van Rossum and Wall?
They weren't, which is probably why C/C++ are as flawed as Perl. All three share an almost complete disregard for error checking and safety. And all three of them are closely tied to the environments where they were developed, with little regard for long-term evolution. Their approach is quite successful: do a quick-and-dirty job and fix things up later.
Re:Strict languages vs. hacked languages
by
Peaker
·
· Score: 1
Python has many advantages over Smalltalk or LISP.
Its code is highly readable even by newbies, and it has many syntatic sugars that make the code elegant and clean.
Python saves every bit of redundancy:
- Variables aren't declared beyond their assignment, whereas in Smalltalk, they are.
- There are no explicit indentation-markers, indentation itself is used. This means there is no redundant and error-prone representation of the code which may lose sync with the real representation of the code hierarchy, whereas in Smalltalk (and LISP, btw) this redundancy is there.
And there are various other points where Python saves you, and increases the elegance of the code - at the expense of making the language perhaps less 'pure'.
Python also has MUCH more practical code available - graphics, 3d, gaming engines, COM object interaction, etc.
LISP is a whole other story - its probably more powerful - but its mostly unreadable by code illiterate - and I'm not sure about the practical library availability either.
Re:Strict languages vs. hacked languages
by
RevAaron
·
· Score: 2
As a follow up mentioned, GNU Smalltalk fits in with the usual Unix environment fairly well. Squeak can run headless and run a Smalltalk text file and has a package called OSProcess that allows you to do piping and such. Furthermore, I believe VisualAge/Smalltalk and/or VisualWorks has facilities for this.
I don't use Smalltalk to script in the old-fashioned way, however. I spend a lot of my time with an image (meaning, a Smalltalk environment) open, and write, run, and debug my scripts directly out of it, rather than using an external editor.
You can look at this in the way some people spend a goodly amount of time in nothing but (X)Emacs, writing scripts in elisp.
Regardless, no where in the definition of "script" is it specified you have to be working with pipes.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
"most teaching of C++ at the moment is terrible, which is the single
biggest problem the language has"
I agree with this. My city, Portland, Oregon, U.S., has an extremely large
technical bookstore, Powell's (http://www.powells.com/technicalbooks), and I have spent several
afternoons looking through all the books on C++. There is a strong tendency in
most of these books to explain without truly explaining, or to mystify without
explaining at all.
It is great to know that C++ will eventually be extended. But the 2 to 4 human
years that you mention is equivalent to 14 or 28 technology years.
You mention "better support for interfacing with other programming
languages".
This is not a controversial addition to the C++ language. It seems to me that
it should have been finished 2 years ago, not 2 years from now.
-- Bush's education improvements were
15 languages is enough.
by
Futurepower(tm)
·
· Score: 2, Insightful
I'm just guessing, but I think I have learned at least 15 programming languages. Maybe it is 30, if you count assembly languages. At some point, learning languages must come to an end. At some point, I would like to see all the good features put into one or two languages. I have no intention of using my life learning languages that then die very quickly, like Pascal.
It seems that, at some point, every skilled programmer becomes interested in writing either an editor or a computer language. I wrote one myself, for use with some H-P data acquisition equipment. Now both the equipment and language are obsolete.
With every new language, there are years of extending the language, finding and curing the bugs, and wrestling with incompatibility problems. At some point, this must stop.
Language writers should put their creativity into extending C++ rather than abandoning it.
Consider Java, for example. There have been literally years of hassle and discussion about Java, when it could have been implemented merely as a compiler switch to a C++ compiler. The compiler switch could have provided automatic garbage collection, given error messages for use of pointers, and provided the other features of Java.
Microsoft, following its usual abusive practices, put many ease-of-use features into Visual Basic, while keeping them out of Visual C++. The result was that there are maybe 1,500,000 programmers who know Visual Basic, but don't know a real language. And what language is Visual Basic itself programmed in? C++, of course.
When you write in Visual Basic, you are just a dog on a leash. Anytime Microsoft wants to yank your chain, it can. If Bill Gates happens to lose interest, Microsoft can kill this one-OS language, the way it killed xBase (dBase, FoxPro), for example, by making quirky additions that no other vendor could/would follow, and then abandoning development.
It is a shortcoming of the U.S. culture that so many men feel that they must play King on the Mountain, and try to knock everyone else down, rather than cooperate.
Like everyone, Bill Gates has inner conflict. But don't let his anger and obsessive desire to make money reduce the quality of your life!
So now it is Ruby, supposedly the next big thing. How long will it be until the books are all written? How long until we discover the shortcomings? Is there some feature in Ruby that can't possibly be added to another language?
I reviewed Ruby a little about a year ago, but came to the conclusion that the documentation was extremely poor. The overall value of a language is the value of the language itself, plus the quality of documentation of the language.
At some point, I want the merry-go-round to stop, so that I can get off.
Is there something in C# that simply could not be made a compiler switch to C++? Do we really need more syntax? I'm not saying I know all the answers to some of these issues. But I sense that something bad is happening.
For a few years, languages were interesting to me. But now, I just want to do the job, not discover other ways to do the job. Let's move on, rather than repeating what we have done before. Let's improve what we have, rather than starting again.
-- Bush's education improvements were
Re:15 languages is enough.
by
HiThere
·
· Score: 2
If C++ were extended in the direction of making it easier to call from other languages, and of making it easier to call routines in other languages, then this would become easier. But as I understand it, the C++ standard doesn't even talk about this. The closest it comes is with the extern "C" construct, which allows C programs to call a subset of the programs.
I would not want to claim that this is an easy problem, but the C++ justifications of "Well, we can't tell the C compiler how to do things, so we'll just leave that unspecified." grates on my nerves. If you can't decide on the proper specification, at least you could define a way that would be guaranteed to work. And I don't believe they even talk about any language other than C (though that would be a reasonable lingua franca if it were better defined). But a C interface is sort of guaranteed to be a bare minimum that leaves out all of the OO features. I'ld like it to be something that would open up C++ templated routined to being called from Smalltalk, etc. Then I might agree that C++ could be worked on as the "only needed" language. Currently it doesn't have anything approaching that state. Java comes closer, despite its single inheritance and clumsy interpreter.
Note. Much of the foregoing is wrt Standard C++. gcc is a somewhat different beast. It is aggressively much more compatible between languages than the C++ standard requires. But it suffers the problem that its features are non-standard. And this is a problem. Standards are the fixed posts around which designs evolve, so if the standard doesn't proclaim that "this should be a feature of the language" then it's quite easy to evolve away from it.
Condider, e.g., purely virtual C++ compilers. For awhile there were several C++ compilers that would preferentially make all class methods virtual calls, so that they could be overridden by inheritance. That seems to have slipped away. I don't know the precise reason, but the result is that code written for those compilers is often broken with the currently common compilers. Because they were using a useful extension that wasn't in the standard.
So for working code, rather than experimental code, it's important to only depend on features specified by the standard. Which means that as long as the C++ standard doesn't specify decent methods for connection to other languages, then such a feature can't be depended upon.
Languages rarely give up a feature that was a part of the standard. At most they will mark it as obsolescent, and suggest that all new programs adopt another way of doing things. They only give up features quite reluctantly, and with as much backward compatibility as possible. And I have a feeling that C++ may have painted itself into a box. In the name of efficiency it has specified that certain features should be implemented in certain ways with certain results. So it would, for example, be quite difficult to import a feature like Smalltalk/Python/Ruby's run-time binding of name to feature into it. It has gained efficiency, and lost flexibility. The obvious way to regain the flexibility is to allow the flexible part to be done in another language. But it's difficult to link most other languages to C++. They generally need to pipe themselves in through the restricted pipe of a C compliant interface. (Though gtk shows both a way around that, and the costs involved in using that way.)
And, no, I don't have any better choice for the central position. Even though it's also missing garbage collection (another bonus of its C heritage -- it's hard to distinguish pointers from data).
--
I think we've pushed this "anyone can grow up to be president" thing too far.
Re:15 languages is enough.
by
drnomad
·
· Score: 1
I know 20+ languages, included assembly's, wrote about 6 my own languages/interpreters/syntax parser (whatever language or language like), and now busy writing 7 and 8.
There is more to a language than just the language itself. As a C++ programmer, you live in the world of C++ and its limits. As a Java programmer, you live in the Java world and its limits. So there you have it: "choose the right tool for the right job". So let's do a C++ vs Java.
Do you want to do something technically complex - then choose C++, do you want to connect all sorts of servers/applications into one enterprise application? choose Java.
Java has become -the- platform for middleware applications, C++ is unsuitable. So why is C++ unsuitable... because of IBM, Sun and Oracle. They chose Java to be the industry standard, so they provided an install base and lots of libraries.
One could argue that a developer has nothing to do with politics, industrial trends etc. My guess is that it's everyone's own choice. I know guys who don't give a damn about EJB limitations, but are too stubborn to listen and try (unsuccesfully) to introduce complex design patterns at entity bean level. The point I want to make is that ignoring non-technical issues can make life much harder.
Language writers should put their creativity into extending C++ rather than abandoning it....
is answered by:
C++ is unsuitable. So why is C++ unsuitable... because of IBM, Sun and Oracle. They chose Java to be the industry standard, so they provided an install base and lots of libraries.
It looks like there's no disagreement here, just a difference of perspective. The first poster would probably include IBM et.al. in his list of 'language writers' who should stick to improving the tools we have. The reply looks at things from the standpoint of the individual programmer who must get along in the environment we're given. 'Civil disobedience' in the form of refusing to go along with the proliferation of superfluous 'tools' is not always an option when you're trying to make a living. That doesn't mean that we need 130 different little languages.
I agree and disagree with your point. On the one hand, I agree strongly that there are too many languages. I have yet to see anyone post why Ruby is different from Perl or Python.
And I strongly agree that making Java a compiler switch to a C++ compiler might have been a Good Thing.
BUT...! The reason C++ sucks (to me, anyway) is the language complexity, not lack of features. In other words, it has too many features. The reason I like Java-the-language (versus Java-the-environment, which I don't like) is that it strips out a lot of the B.S. that makes C++ unwieldly, like multiple inheritance, operator overloading, and other "somewhat useful features but not worth the extra complexity and downsides".
Sometimes to make something really good you have to throw away the past and start over with a clean slate. With languages, this is very dangerous, because it's hard to build up a following for a new language. The whole reason C++ was able to create a following is because it was semi-backward compatible with C.
I don't know that much about C#, but it's guaranteed to be used and successful simply because Microsoft will probably embrace a huge internal development effort which will bleed over into the industry. I hope and pray that it turns out to be what C++ should have been... a nice, tight language like C with modern features, but without the insanity. I also hope and pray that it can be native compiled, and not require a Java-style runtime environment.
-- Sometimes it's best to just let stupid people be stupid.
Re:15 languages is enough.
by
rowland
·
· Score: 2, Insightful
"For a few years, languages were interesting to me. But now, I just want to do the job, not discover other ways to do the job. Let's move on, rather than repeating what we have done before. Let's improve what we have, rather than starting again."
You sound like a guy I work with. I sympathize with him, because he's getting close to retirement. Maybe you are too. I think it was the "Pragmatic Programmers" who said you should learn a new language every year. I find it helps to keep the brain plastic. It's all too easy to get into ruts, but soon the joy is gone too, and you might as well be flipping burgers.
Brent
-- 100,000 lemmings can't all be wrong.
Re:15 languages is enough.
by
Anonymous Coward
·
· Score: 0
You are so right. At the end of the day a language is used to complete a task, and usually you want to complete that task as soon as possible, not diddle about learning syntax and logic differences.
I started off with BASIC, then another flavour of BASIC called AMOS, then C on the Amiga, ASM on Amiga, then C++ on the PC and I thought I was doing well. Career moves have brought me to Visual Basic, Java. Now I'm working on database related tasks I have SQL, Javascript and VBScript. A friend of mine is preaching C#, I see Python and Perl mentioned all the time and now Ruby! Frankly, it's ridiculous. I had hoped a long time ago that when I entered the fantastic future and the 21st Century my programming language would be ultra-smart, a universal language that I could apply anywhere. No, haha, how stupid of me to think that.
It really does have to end, they *could* unify these languages, C++ could do anything any other language could do without hassle. A "simple" version of it with garbage collection and some other friendly features would suit everyone down to the ground, but it seems everyone wants to repeatedly re-invent the wheel. This is why technology hardly ever moves forward. Everyone moans about MS, but you never see any real inventness or "smart" thinking from anyone anymore.
We could be doing so much. What we need is someone or something with the drive and focus of Microsoft, but willing to put its resources to the greater good.
Jeez I dunno, it's such a shame it's all going nutty this technology world. Microsoft have about 50 server products, err, I'm going off topic and heading into moaning terratory.
Unification. That's what it should be about, but it will never happen 'cos people don't get recognised for assisting existing tech, they have to create some new whizzo language to get noticed.
I think one of the great advantages of python is the wealth of material the monty python scripts bring to the table. Endless material for tutorial and how-to writers. Think of the novelty of reassembling the string "spam, eggs, spam, sausage, spam, spam, bacon, spam and spam" in a million different ways using all the different types of sequence objects. Ruby just can't compete with this type of idiom.
Troll
by
Anonymous Coward
·
· Score: 0
Please, mod down the troll.
Matz (Ruby's creator) is a language designer;
"truly clean, well-designed, quite-pure, strong-typed" can also be applied to Ruby, except for "quite-pure", which should be changed to just "pure";
built-in print, and built-in types, plain stink;
Re:Troll
by
Anonymous Coward
·
· Score: 0
I disagree that it's a dumb addition. It's optimizing for the most common case - people do alot of printing, and when they print, they usually want a newline printed, and when they don't, they usually want a space printed, so you have in python: print "blah" prints blah and a newline, print "var", var prints var, space and value of var. What's dumb about this? Now if this was something you hardly ever use, it would be dumb.
I agree that the built-in print is probably a dumb addition to Python. But dumb additions are harmless - whereas the lack of useful additions is harmful.
Trying to be pure usually results in the latter.
Built-in types do not stink, as they allow for better performance. You could always use the class-wrappers of the built-in types in Python - so NO functionality was ever missing.
its dumb, because a print function would simply be better.
The fact its quite hard to mix strings with variable names and the need to convert between types shows you - not that you need a specific 'print' that helps you convert everything to a specific type - string, but that you need a general method of converting everything to a specific type (in this case string).
And this method is already available:
def print(*vars):
for var in vars:
sys.stdout.write(str(var) + " ")
sys.stdout.write("\n")
Or something of this sort.
Is: print ("Var:", var) so much worse? I think its more powerful, allowing things such as nesting prints in lambda's, etc.
I think that it would be cooler to steal the one cool Perl feature here:
print ("Var: $var") and allow an escape code such as '$' to address the non-literal namespace of variables, and convert whatever to string via __str__.
are there cases where, for example would be useful
I'm sure you figured out what I meant when I said "favorite whipping boy", but this should read "are there cases where multiple inheritance would be useful".
-- Sometimes it's best to just let stupid people be stupid.
Re:word math
by
Anonymous Coward
·
· Score: 0
The '*' is not a math operator, idiot. It is a string operator. I sure hope you are not planing on becomming a programer, because if you you do you will suck at it. The world is already filled with enough morons who think they can program.
Re:Strict vs. hacked languages (THIS IS A RANT)
by
Anonymous Coward
·
· Score: 0
Are you kidding? Object foo knowing how to bar itself is quintessential OO. Then you can have object foo2 knowing how to bar itself, or if they're derived from the same superclass & bar can be abstracted a level, move bar up to the superclass. In smalltalk to print an integer, you'd do:
(5 + 4) printNl!
5+4 evaluates to an Integer object 9, which then prints itself.
Making a (to the user) generic print function to which you pass a string/integer/character may be passing around objects internally, but if you do that (as in the snipped of python you post) the language might as well be procedural from the user's point of view - the benefits of OO were used in language design, but are lost during the actual language use.
Re:Java has won? Evidence to the contrary.
by
Anonymous Coward
·
· Score: 0
If I go to dice.com and do a search for listings with the word "Java" I can find 118 jobs. If I do a search for "Perl" I find 18.
Granted, that doesn't make Java a *better* language, but it does seem to bemuch more more in demand.
Is there a tutorial for perl that is simalar ?
by
ConsumedByTV
·
· Score: 2
I like the way this one teaches, is there a tutorial similar to this one for perl?
--
"Not my manner of thinking but the manner of thinking of others has been the source of my unhappiness." - M
Re:Is there a tutorial for perl that is simalar ?
by
flippety_gibbet
·
· Score: 1
I think you have a typo and you meant it to be this
But then while you are at it, why not try a Python tutorial.
-- <-- You are here.
Re:Is there a tutorial for perl that is simalar ?
by
Col.+Panic
·
· Score: 2
Re:so many choices
by
Anonymous Coward
·
· Score: 0
They dont speak "Spanish", they speak Español.
Re:ick
by
Anonymous Coward
·
· Score: 0
Yes. Nifty code is all that realy matters.
Re:Why learn another language?
by
Anonymous Coward
·
· Score: 1, Funny
You're enhanced knowlege of languages looks great on your resume no matter what you use as your primary language
Let's try mastering the English language first, please.
Mod Parent UP Funny, not DOWN Troll
by
ccoakley
·
· Score: 2, Interesting
Come on people, this is (meant to be) funny, not a troll. It doesn't even remotely try to make a sound argument. A troll would say:
For embedded systems: C# has a defined bytecode that can be JIT compiled onto a variety of special purpose chips without rewriting anything.
Web Programming: C# has built in XML and network support, and don't forget that because everything tunnels over port 80, no firewall will prevent your code from executing!
Instead, all of the statements are absolutely absurd. Maybe you don't think it is funny, but it is absolutely NOT a troll. Trolls try to say things that have a basis in reality but are completely non-constructive for the purposes of discussion to have people respond (I'm not sure where the line to Flamebait is, but...). This is just a joke.
-- Network Security: It always comes down to a big guy with a gun.
-- Hold it in your hand and watch it disappear - set it free and watch it remain.
Why Ruby?
by
Anonymous Coward
·
· Score: 0
Well, I have learned Python the last couple of months and I think it is great. Before that, I knew Perl and I thought the syntax was horrible. Although I dunno much about Ruby, I've heard that it's syntax is like Perl's. Why would they pick Perl's syntax over Python's?
Re:Why Ruby?
by
Anonymous Coward
·
· Score: 0
Becuase perls syntax (despite anti-perl propoganda from wanna be famous python designers) is actually useful and makes more sense than pythons baby syntax.
Re:Bzzt.....Wrong
by
Anonymous Coward
·
· Score: 0
Ahem, no, 'fraid the coward was right on this one. I wouldn't feel too bad, though; it's one of the silliest and most counterintuitive rules in the English language.
Re:Bzzt.....Wrong
by
Anonymous Coward
·
· Score: 0
the poster's use of the possessive apostrophe is correct.
HA HA HA!!! And you didn't even post as an AC. Lern too spel bifor yu tel othors howtoo!!! Idjitt!!
Re:Bzzt.....Wrong
by
Anonymous Coward
·
· Score: 0
Hold that buzzer, jackass. "It's" is the contraction for "it is." "Its" is the possessive form of "it." Use http://www.m-w.com/dictionary.htm and enter "its" and "it's" into the form. It will set you straight.
Re:Strict languages vs. hacked languages
by
Jonathan
·
· Score: 2
who says Python is an upgrade from Perl? It's all a matter of choice.
Well, even Larry Wall himself admits that Perl 5 is showing its age. Look at the plans for Perl 6. It is looking more and more like Python and Ruby, isn't it?
Smalltalk: You send the message shoot to gun, with selectors bullet
and foot. A window pops up saying Gunpowder doesNotUnderstand: spark.
After several hours fruitlessly spent browsing the methods in Trigger,
FiringPin and IdealGas, you create ShotFoot, a subclass of Foot with
a new instance variable bullet hole.
Me, I'm still trying to figure out a good one for Lua (which is too hip a language to have slashdot stories about it yet.)
Frankly, perl6 development looks paralyzed to me.
They've been at it for over a year, but as far
as I know, they've yet to make detailed plans for
implementing their ideas. Instead, they're still
coming up with pie-in-the-sky design goals like
making a common runtime for python and perl. I'm
dubious about perl6 ever even making it out the
door.
Alex.
Re:Strict languages vs. hacked languages
by
sigwinch
·
· Score: 2
Interesting. Can one of you Ruby or Python elmers tell me if its possible to, say, have the user input an arbitrary snippet of code at runtime
return (foo + bar)
and have the body of the multiplication operator be replaced with this, making it now an addition operator?
In Python, yes. At any point where you could define a class's * operator, you could define it by compiling an arbitrary string on the fly.
--
-- Kuro5hin.org: where the good times never end.;-)
Re:Lots o' languages
by
Anonymous Coward
·
· Score: 0
Something tells me you've never written a compiler:-)
Me neither, really - I had a small (hah!) CompSci assignment whereby I had to implement a compiler for a simple language with just simple arithmetic and blocks (to learn scoping). No loops, conditionals, or anything much useful:-) and it all had to run on a provided virtual machine with 9 instructions. Took me many hours of coding.
Offtopic, and drunk. Better click "post anonymously". And I lose +1. Doh.
- Smalltalk's method call syntax
- LISP's macros
- The language that first introduced lambda's.
- The language that first introduced closures.
- Simula's code structuring
- Python's array slicing syntax (not sure about this)
- Python's indentation-is-syntatic
- etc. etc. etc.
Don't let Microsoft convince you innovating is collecting pieces from all around and sticking them together in a single bunch.
And just for the record - I hate Java, note it hasn't invented anything either:)
Re:Strict vs. hacked languages (THIS IS A RANT)
by
Anonymous Coward
·
· Score: 0
That's one of the neat things about python - you do everything procedurally if you want, but once you feel like you could use a class, you just add a class and use it in your procedural program. Or, if you really want to, you can make all of it from classes.
... you will see some strong similarities (especially to Python).
Yes that I can see, but what about the favorable differences.
-- Look a monkey!
Re:Please clarify
by
HiThere
·
· Score: 2, Redundant
I really hate Python's indentation scheme. Really. Really. As of this month (or next) they will have solved the licensing issues that had been bothering me since around the time of Python 1.6, and basically caused me to switch languages (well, I'd only written a couple of programs in it, so there was no big investment), but on thinking about switching back I really notice just how much I hate the indentation scheme. I really prefer tabs to spaces, and some python editors seem to feel compelled to switch tabs to spaces. Programs keep breaking because of this. In no other language have I had this kind of problem.
I keep(kept) trying to think of some alternate syntax that would be easy to preprocess into the non-delimited form, but all of the traditional parenthetic characters on my keyboard have already been prempted for other uses. And of course if I do design this, then none of the standard tools would work with it. So I'd need an easy way to do a bijective mapping. And at a minimum this would mean parsing all of the strings to be sure that the parenthetic marking I was using wasn't a part of a string instead of a code delimiter. Basically I'd be writing a complete parsing engine with a two-way mapping.
So one of the things that I really like about Ruby is that it didn't adopt the alignment delimited program logic. I certainly see using alignment as an added check for logic correctness, but there should be syntax markers that determine the syntax. Layout should be for verification.
--
I think we've pushed this "anyone can grow up to be president" thing too far.
Yes that I can see, but what about the favorable differences.
Here's a few.
o Smalltalk-like object system, including a unified type system
o Metaclasses
o Full closures
o Eiffel like syntax (not indentation based... Ok, whether this counts as favorable or not depends upon your taste:-)
o Continuations
I understand that Python community is working on unifying its current type system, and providing lexical scoping for closures. I suspect the languages will grow closer to each other as time goes on.
Both Ruby and Python are excellent languages, with more simularities than differences.
-- -- Jim Weirich
Re:what type of shot is Ruby ?
by
Anonymous Coward
·
· Score: 0
You create a gun module, a gun class, a foot module and a foot class. After realising you can't point the gun at the foot, you pass a reference to the gun to a foot object. After the foot is blown up, the gun object remains alive for eternity, ready to shoot all future feet that may happen to appear.
The whole point of having an interpreter is that you don't have to compute things at compile time, you can a lot more calculation and optimizing at run time while you interpret the program.
And yes, writing a compiler is pretty tough for most modern languages. (If you don't believe me, try writing a small one for C or pascal, and then try to imagine writing a C++ compiler or a Perl interpreter!:P)
However, if you originally meant that somebody should write a compiler to compile all 5 of these languages to a common one and run it on one of the interpreters, then yes, this could be possible, except for all of the annoying differences in the various class libraries and built in functionality of the various languages. This would make writing this compiler incredibly tedious and almost impossible to maintain.
Re:Strict languages vs. hacked languages
by
frleong
·
· Score: 1
No need to apologize . Your inference is a near miss, because I admit that my experience with Smalltalk is certainly not in the same level as yours and limited to simple Hello World-type programs, ifTrue and collections stuff. Why? The first time I touched Smalltalk, I have immediately placed it in the category of academic curiosity (just like Prolog) because it is an interpreted language. Considering it productive was nearly the same, IMHO, as considering QuickBASIC to be productive.
Before the explosion of the Internet, I don't think the performance of computers was enough in such a way that could make Smalltalk productive. Yeah, I know that Smalltalk can be JIT compiled, just like Java, but it doesn't help too much until recently with computers that have sufficient memory and CPU power. The most popular OSes (Unix and Windows) were written in C/C++, the documentation and examples were in C too. Earlier programmers have a need to be as close as much possible to the OS, and you know why (speed, direct hardware control, avoiding syntactic conversions between different languages, blah blah blah... )
You can be proficient and productive for your own specific apps in Smalltalk (in theory, every programming language has a chance of being productive), but I don't believe that this language can be productive to the general mass in practice. However, if a IDE like VB was made for Smalltalk during early 1990s, the scenario might be completely different now.
Let me recapitulate:
C/C++ - difficult to learn but language of choice of OS makers => popular => more people use it => more libraries => more productive.
VB - easy to learn; RAD; integrated with the OS so the interface barriers are reduced; marketed on time when GUIs was becoming popular => more libraries => more productive
Smalltalk seems to be lost somewhere in the middle and certainly became much less appealing.
Re:Why learn another language?
by
StrawberryFrog
·
· Score: 4, Insightful
Great post, but IMHO any 3-year CS course that aims to teach only one language is going about things completely the wrong way.
You should spend time in (for e.g.) a simple teaching language to start off, 1 mainstream procedural/OO language, one functional language, one scripting language and study briefly a sampling of languages of comercial or academic interest, and what makes them interesting or sucessfull.
IMHO when you learn your second language is when you start to 'get it' about what is an essential feature, and what is an accident of syntax or history in programming.
I wouldn't call knowing only 1 language a "the Computer Science Student mentality" because a CS graduate should definitely not know just one language - they should know how to pick up any language quickly, having had practice at it.
--
My Karma: ran over your Dogma
StrawberryFrog
I hope this is implemented in PERL
by
trance9
·
· Score: 1
Well if you use Jython, than you don't need a python interpreter installed. If only all these scripting languages could target the JVM or.Net then we would only need the jvm and.net to be able to run all of them.
Re:Strict languages vs. hacked languages
by
fault0
·
· Score: 1
Perl certainly does have a lot of features (and multiple ways to do the same thing), but Python and Ruby tend not to.
Then again, if you extended your "hack language" idea, you could argue that smalltalk, lisp, and c (and certainly c++), have many extraneous features.
I think the only non-hack language in that case would be Ada/Ada95, where EVERY feature in the language has a reason for implementation (and not simply for convenience's sakes). Also, Ada/Ada95 have a lot strong type checking than something like smalltalk or c.
So do you then attribute a "BASIC odor" to smalltalk or c?
this troll is fore furmulaic than
by
Anonymous Coward
·
· Score: 0
a Three's Company plotline.
Re:Strict languages vs. hacked languages
by
frleong
·
· Score: 1
Huh, Smalltalk productive? Where? If it were productive, everybody would be using it instead of C.
Re:Strict languages vs. hacked languages
by
Anonymous Coward
·
· Score: 0
The poster you're replying to said that you don't have to adjust to someone else's formatting habits because it's formalized. It also helps because mis-formatted code will break and alert you to improper format, whereas if it weren't formalized, you may be looking at the code and thinking it does something different from what it actually does.
Re:Strict languages vs. hacked languages
by
geomcbay
·
· Score: 0, Flamebait
Some people (particularly Linux sysadmins) are too dumb to learn a real language like Smalltalk or C++, and so they need to rely on hack languages like Perl or Python to get things done.
Re:Glad I changed from a CS major
by
_marshall
·
· Score: 1
Anyway, the computer software field will be better off without you. CS isn't about learning specific languages; it is about learning universal concepts. Specific languages are a dime a dozen and anyone who bothers to learn the basics correctly can pick up a new language in a matter of days.
This is so true.. I have people constantly asking me, "How many languages do I need to know to be a programmer?". Most of these people are in it for the money and have no desire to actually program.. They are the entire reason the IT-industry is going through it's "sifting" period. Programming is about abstract concepts, ability to design solutions, and creativity.. Many people know many languages, but don't know the first thing about problem solving skills.
Re:Strict languages vs. hacked languages
by
stesch
·
· Score: 1
For example, where Ruby has a * operator for strings and perl has the x operator which does essentially the same, PHP (also a very string oriented language) uses str_repeat().
* after a string isn't an operator in Ruby. It's a method of the class String.
NT
by
Anonymous Coward
·
· Score: 0
Ok, but no, thanks...
Re:Lots o' languages
by
Anonymous Coward
·
· Score: 0
Yes, 'Parrot' was an April fools joke, but people have also been using it as the code name of a project to merge the bytecodes used by Perl 6 and Python 3 (as well as possibly other languages, such as Ruby). It was kick started by Eric Raymond on the python-dev mailing list, and has spawned a lot of interesting discussion.
Re:The Pragmatic Programmers Ruby Book is Online
by
Sludge
·
· Score: 2
Hey, cool. I just finished reading "The Pragmatic Programmer" last week. This seems to be by the same authors. I recommend their work. I only wish I got ahold of it earlier than I did. It seems I've come up with a lot of the same points they did, the hard way. (Perhaps that's for the best...)
is it so much harder to do:
for($x=1;$x=20;$x++)
{
print "-"
}
or:
my $line;
for($x=1;$x=20;$x++)
{
$line.= "-"
}
print $line
...again i ask what is the big savings in word math?
Re:Why learn another language?
by
frleong
·
· Score: 1
Well, the problem is that the pure language doesn't do anything essential other than simple "Hello world" programs or computer science exercises. The basic syntax only covers loops, if/then/elses. However, the real gem of a language lies in the libraries, calling conventions and they really differ from language to language. While it is relatively easy to learn a new language, it is counterproductive to remember that the exact argument positions of library function calls and idiosyncrasies of each. Bugs really happen when you cram too many things in your brain. Besides, why do you want to become a jack of all trades, master of none?
Re:so many choices
by
Waffle+Iron
·
· Score: 2, Informative
I'm just learning python now. There just aren't enough hours in the day for me to learn all of these languages.
Then learn Ruby. Python looks clean to the untrained eye, but you have to remember lots and lots of special cases because of the arbitrary mixture of object-oriented and procedural features.
Ruby is extremely consistent and well thought out. I've used well over a dozen languages, and Ruby is my favorite by far.
Microsoft was out there INNOVATING Name a single feature in C# that hasn't appeared in at least 3 languages prior to it.
Anyhow, I'd take Python, C++ or LISP before I'd take C#, for any task. (The first for elegance and ease, the second for performance, and the third for its power).
Re:Java has won Re:Why learn another language?
by
Mornelithe
·
· Score: 1
I'm never certain how to begin my posts, so I often start with a sentence just like this, hoping that the momentum of typing will somehow lead me into the points I wish to make (anyone see Finding Forrester?).
Anyhow, now I'm ready. I'm a big fan of Java. It's certainly the programming language I know best, and I have tried others. I learned C/C++, and though I like C for the way it feels, I can't say the same for C++. I haven't used it in a while, so I'm not too familiar with all the STL stuff and all that, which may make things better than I remember, but it always seems to me that in some cases, Java does the things that C++ does in a better way. Plus I could list all the great things that Java can do that are hard to do in C++. Java, is indeed a very nice language/platform/etc.
However, for all the work that's been put into Java, I have to say that it really isn't wonderful for all occasions. As a simple, concrete statement of one of the things that can bug me in Java on occasion: sometimes it's nice to be able to pass around methods/functions. C++ can do this directly with function pointers, of course, and Ruby can do this because, well, everything's an object in Ruby (a very nice feature). Because of the way it was designed, though, I can't do this in Java, other than going through reflection, which is poor form.
Now, there are ways to do this in Java. Basically, you have to create your own class to do it. Let me explore some possibilities. Let's say I have two different methods with signatures as follows:
String foo(String s, Object o)
Integer bar(Double d)
Now, I can create my own Method class that has a method
Object invoke(Object[]);
But this doesn't look nice, does it? There's lots of ugly casting involved because you can't make any assumptions about what it can return or how many and what type of arguments it can use.
Another solution is to declare a specific class for each dynamically defined method that I want to have, but then I end up adding tens of classes to my project.
All of this work because I want to have a few methods of, say, my MUD able to be plugged in by extentions that are loaded at runtime (which, incidentally, are very easy to allow for using Java).
With Ruby, I'd just declare a variable, fill it with a default function, and then if anyone wanted to change it, they'd stick a new function in there with the same signature, and all would be well. All because methods/functions are objects in Ruby and not in Java.
Now, I'm not bashing Java because I understand that all languages make certain tradeoffs. My point is that there are many different languages because they all address slightly different needs. Even if they appear to address the same need, they may do it in a different way that makes them better in certain situations. I'm learning Python now and I just don't like the way it feels as much as Ruby (although it could be the book I'm using (Core Python Programming or something like that) because the author explains in great detail some things that appear stupid to me, like the method used to determine which of two hash tables is numerically greater...). So, anyway, there's almost always room for new languages with slightly different feature sets that will conform more to certain people's personal style, and the more you take the time to learn, the more chance you have of finding your dream languages.
But, I'm talking too much on your first point. On to the second. You compare learning new languages to buying lottery tickets, which, in my ever so humble opinion, is ridiculous. Such a comparison, of course, assumes that we're learning the languages solely so that they'd have some kind of huge payoff in the future, which, of course, often isn't the case. Dalroth gave other reasons for learning them, though.
The thing that caught my eye the most in his reasons was keeping yourself sharp. I don't see how stimulating your mind could ever be a waste of time. The more you have to think and work with the concepts of programming, the better you'll inevitably become at them, and that can help you whether or not the language becomes wildly popular. Why should I study anything but computer science and the math and science courses that it depends on in college? Because it gives me a more rounded education and knowledge base, and can help me to have better quality of thought in general. Why should I read any books for pleasure, or, for that matter, anything but what will have a direct and forseeable payoff in the future? I think you get the point.
Finally, this forum is populated, theoretically, by people who enjoy learning about and using computers. If one does something for enjoyment, why should he then complain when more of that activity is available to be done, or at least, more varieties of that activity. Complaining about how many programming languages there are on this forum is like complaining about how many new science fiction books are written. "Don't we already have enough of those?" How about: "Do we really need new issues of Playboy? We already have lots of pictures of nude women." I hope I don't learn too much stuff. It might not be good for me.
Anyhow, that's my take on the subject. I apologize for the length of this post, but I'm tired and my writing tends to get extra wordy when that happens (it's always wordy, unfortunately). I would advise you to have a nice day. I hope this day (as it's 2:37 AM right now) is better than yesterday in my case.:)
Cheers,
Dan
Not quite. First off, for interpreted languages, there is nothing stopping the interpreter from creating the dynamic length string on its own, based upon the "*20" or "*$foo" and then making one call to print, instead of $foo calls to print.
Whether Ruby actually does this, I have no idea, and whether this is actually more efficient, well it depends on efficiency of print vs. creating a string in memory in Ruby. There is a potential for a drastic difference though, so the amount of work that can potentially be saved is quite great.
Re:Strict languages vs. hacked languages
by
Jonathan
·
· Score: 2
Python gets all of its object-orientness from C++, Ruby gets its from Smalltalk. C++ is generally regarded as a crude (although useful) hack, whereas Smalltalk is the definition of elegance itself. So, if it is cleanliness you want you should move to Ruby. I find it amusing that while the Pythoners mock the Perl-hackers that refuse to upgrade to Python, they themselves refuse to upgrade to the next level .
Why the HELL would somebody want to put the word "end" at the end of a statement, block, line, or whatever the fsck that is, instead of a simple semicolon??
The 'end' is for the 'if' block, not the end of a statement. This practice actually cleans up code a little by not having alot of strange curly braces littered everywhere. You just don't like it cause you're not used to it(and you're used to C, C++, perl, etc.). It's actually pretty good.
Re:Strict languages vs. hacked languages
by
RevAaron
·
· Score: 2
Huh. Linux stable? Where? If it were stable, everybody would be using it instead of Windows.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Re:Lots o' languages
by
lavaforge
·
· Score: 2, Interesting
Actually, as much as I hate to say it. Microsoft is on to something with the Windows scripting host. It can interperet Perl, VBScript, Jscript, and possibly some others (I don't remember offhand).
I think a developers productivity has less to do with the language hes using and more to do with how much experience he has with that language
If that were true, you could just as easily write a text processing system in raw assembly or in a scripting language. I don't believe that. Languages are tools. Different tools effect your productivity in different ways. A farmer's productivity does depend on his tools and so does a programmer's.
why not doing a print "-"x20
Seems even more the Perl way to me...
-- --
If windows is the solution, can we please have the problem back?
Re:Strict languages vs. hacked languages
by
RevAaron
·
· Score: 2
...I personally find the "hack languages" to allow a much more natural flow between my brain and the screen, so I'd be interested in seeing how that conclusion was reached.
Different strokes for different folks, I suppose. While you seems to say that the simplicity and elegance of Lisp and Smalltalk isn't practical, it is for me- my brain thinks in such terms. Perl is, for me, in many ways almost a big of a pain in the ass as C++, because it tries way too hard to fit what Larry Wall said is the "natural flow."
Jujst another perspective...
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Re:Strict languages vs. hacked languages
by
smallpaul
·
· Score: 2
If C is the kind of language you DO NOT like, and SML is the kind of language you DO like, then I sincerely hope that you continue to dislike the scripting languages. C has proven itself perfectly adapted to solve a large an important set of real-world problems. Perl, Python and Ruby are similarly designed.
I don't really see "symbolic AI", "planning", "Dynabook, educational software" and "proof systems" as particularly representative of the programming most of us do in the real world.
"Text munging", "kernel hacking", "GUI and server application programming" etc. are more typical. Thank Guido there are "hacked" languages to let us do our jobs!
Re:Horrible article
by
Anonymous Coward
·
· Score: 0
I wouldn't consider someone who memorized the syntax to every pet project language under the sun a hacker either.
A person can learn to speak 10 different human languages, that doens't mean they're going to be able to write Moby Dick.
Re:Strict languages vs. hacked languages
by
Anonymous Coward
·
· Score: 0
Can you dynamically replace the operator at runtime ala st? (don't read this as an aggressive question; I'm actually wondering) That's one of the wicked things about st IMO; not only is it easy to write self-modifying programs, its hard not to; every chunk of code actually modifies the language.
Re:Why learn another language?
by
RevAaron
·
· Score: 2
A serious programmer should always be interested in some new paradigm/language/tool/os/...
However, a language like Ruby fails to impart or embody any new paradims or concepts. That is, it's mostly a new syntax atop existing semantics found in Perl or Python. An exercise is syntax and grammar is relatively uninteresting. For me, learning a new language, be it spoken or coded, most of the interesting parts are novel ways to express old semantics or completely new semantics that are put out in the open.
That said, I like Ruby- while it may be pointing at the same problem-niche as Perl and Python, as a language, it makes a lot more sense to me, and I'd heartily choose it over Perl or Python in most circumstances.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Re:Strict vs. hacked languages (THIS IS A RANT)
by
kin_korn_karn
·
· Score: 1
Well, even Larry Wall himself admits that Perl 5 is showing its age. Look at the plans for Perl 6. It is looking more and more like Python and Ruby, isn't it?
I've been following it as closely as I can. It really looks too much like Ruby for my tastes. Ruby is too much OO. I don't want methods for literal values. I don't want everything to be an object. That's just ridiculous. I want to choose whether I use objects or not, that's why I like Perl. I can structure my projects like C, C++, or even Java/Smalltalk "everything's an object" if I want. Some projects lend themselves to OO design, and some don't.
Java has the best library (what the hell is LW thinking when he wants to strip down the Perl6 library and make everyone go to CPAN for the least little things? Software engineers don't have time for that shit and in a big corp every installed module has to go through 2-3 change control committees and architecture docs and.... jesus, just ship everything) but the extra structure that I have to code into my program is a waste of time. I want my program.java to say
and not have to type all that class/method setup garbage just to get to one library routine. Is that too much to ask? To OO zealots it is.
I'm a young guy, but I've been programming for a long time (a majority of my life, started doing BASIC when I was 6 and I'm now 25). I learned OO concepts on my own with Turbo Pascal 6 in, um, 1992? In the professional world (i.e. the one that matters), OO is way overdone and misused. What I've seen at the companies that I've worked for is that the majority of OO usage is strictly about office politics.
See, if you start talking about functions and callbacks and closures and all the fun procedural stuff to budget manager types, they put on their deaf ears and figuratively yell "I CAN'T HEAR YOU! I DON'T HEAR YOU!" OO lends itself to all kinds of extraneous documentation, such as modeling, object-relationship maps, 300-page design docs, etc., and it is a buzzword for those that are buzzword-prone. When someone is burnt on coding, you can put them to work drawing crap up in Visio and writing Word docs, tack "Senior" onto their title, and give them a $10k raise, and you have thus kept at least two people happy and not had to fire someone who couldn't "contribute". In short, OO programming languages are politically correct and lend themselves well to covering your ass.
With an OO environment, you can abstract the design of a program from the code itself, in the old procedural model you couldn't really do that. It was about, "this function does this and returns this, and here's why," on a code level. Software really couldn't be described in terms of anything other than a computer program. Now that OO is prevalent, you describe things as, "the subscriber object contains everything about a subscriber, it's related to the subscription object and has properties of a user." You can take that to an MBA-Sales and say, "we need to write this code, it'll take 10 weeks and $xk, and here's why." OO looks like wild magic to the non-CS-literate and this gets a lot of money allocated and keeps a lot of people employed for no reason other than smoke and mirrors.
That said, no language is perfect. If Perl had a native compiler that would produce ELF binaries, it would be perfect for my needs, but not necessarily for the needs of others. I know how to work in an OO shop for my career, but that's why I work as a strict hourly contractor. You want me to type a Word doc and draw Visio for $xx an hour? hey, it's your money.
Most of the advantages being quoted are "ease of use", "rapid development", etc. Fine. But what about runtime? How does Ruby compare with Perl in running efficiency? Are there any benchmarks out there?
-- "It is better to die on one's feet than to live on one's knees."
- Albert Camus
Re:Other languages teach other ways of thinking.
by
RevAaron
·
· Score: 2
The answer seems to be to put all the knowledge in one place, or as few places as possible. At some point even Dalroth will decide that one more language is too many.
I doubt he will. That is, there is no point at which there are too many languages. To say otherwise is just a submission to the stronger and stronger trend of American capitalist corporate philosophy under the guise as "effeciency."
Let me explain. Oftentimes new languages are created for someone to learn the ins and outs of designing and implementing a language and it's tools, be it an interpreter or compiler, native or bytecode. Writing a language seems to be a popular enough of a hobby that it won't soon go away. Eventually, some schmuck, consortium, or business will come up with some new whiz-bang theorectical basis for some new language that will make everything look that much older.
Now, you don't have to go and learn any of these new languages. No one is forcing you. In fact, most of you are already mentally stuck in the 60s, with languages based on flat files. And that's fine. But the nature of science is that there's a lot of experimentation before discovery, and regardless of whether or not you think Ruby is that useful, it's serving some use to someone, and seems to be advancing computer science (not "programming", but CS) to a degree, if only for a small group of people.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Other languages teach other ways of thinking.
by
Futurepower(tm)
·
· Score: 3, Insightful
In the second half of his post above, Dalroth has made a very sensible case in my opinion, for learning other languages.
(Dalroth seems like the kind of programmer employers want to hire. But he has provided no way to contact him. In fact, he is very negative about being contacted in his bio.)
I'm tired of new languages (read my post #128), but Dalroth has a point that other languages sometimes teach other ways of thinking.
The answer seems to be to put all the knowledge in one place, or as few places as possible. At some point even Dalroth will decide that one more language is too many.
-- Bush's education improvements were
Re:ick
by
Anonymous Coward
·
· Score: 0
clear, powerful code is all that matters (speed is secondary for me... just throw more hardware at it! you cant do that with ugly programming languages)
Re:Age is not the issue.
by
smallpaul
·
· Score: 2
How do you think these experimental features are going to get into an ISO standardized language like C++?
Do you think some smart guy like Matz, or Guido Van Rossum or Larry Wall can just go up to the ISO committee and say: "I've got this set of cool ideas -- let's add them to your language."
Also, do you really think that all of the good ideas of Perl, SmallTalk, C++, Lisp and Icon can naturally fit together in a single language? It isn't always possible, nor advisable, to pile every possible feature into a language.
Most people dislike C++ because it has TOO MANY FEATURES. That may not bother you but it is a big part of why Java caught on so quickly. So if you make an uber-language with every feature, you will CAUSE the creation of competitive new languages with smaller feature-sets. Smaller languages are often a reaction AGAINST bigger ones.
Re:Strict languages vs. hacked languages
by
naasking
·
· Score: 1
Their approach is quite successful: do a quick-and-dirty job and fix things up later.
C was designed to be as low-level a language as possible while maintaining platform independence. It has nothing to do with "hack jobs". You can do pretty good hack jobs in ANY language, just like you can do superb coding in ANY language... well, except maybe brainfuck.;-)
Ruby does have ; at the end of statements! If you want to put two statements on the same line, you put a ; in between them. If you really feel like you want to have ; at the end of every statement, go ahead and put them in. Ruby won't complain.
Re:Lots o' languages
by
ChadN
·
· Score: 4, Interesting
Actually, there is a lot of talk going on between L Wall and GvR to try to unify their bytecode interpreters (and maybe object models, etc.) for just this reason. I'm not awareof the details, but perhaps in some distant future, Python, PERL, and maybe even Ruby will all converge on a common backend (forget about TCL, though. It ain't never gonna happen)
--
"It's overkill, of course. But you can never have too much overkill." - Anonymous Slashdot Coward
An interesting discussion can be had as to whether one's spoken/written language affects your "productivity" for certain tasks (writing lyrics, novels, technical documents, etceteras).
Are there concepts that can be expressed in one (human) language, but not another?
--
--
Don't like it? Respond with words, not karma.
Re:Strict languages vs. hacked languages
by
Hrunting
·
· Score: 3, Insightful
Usually the latter turns out to be some baroque conglomeration of features piled on features, creating a very top heavy feeling to the language, while the former classification languages all have a purity to them, e.g. smalltalk, lisp, and c.
Well, I mean, as long as we're talking in generalities here, the latter also seem to be geared towards getting jobs done where the former are geared towards elegant problem-solving. Purity is great when you're admiring something, but no one wants to hang out with the righteous virgin when they feel like getting laid. Personally, when I program, I'm not looking for my code to fit some elegant theory. I'm looking for the job to get done as succinctly as possible.
Some would defend the "hack languages" as a means to Rapid Application Development, but Smalltalk has been shown to be the most productive language, and Ruby/Python/Perl all seem to me to have a BASIC odor to them; I'm wondering if people are afraid to learn a new way of speaking?
I would say that Perl stinks more of shell and C than it does BASIC. If you're talking because it has a lot of built-in features, there are plenty of languages that have it. But out of all the languages you've mentioned, I found it ironic you say that because Perl has problem undergone the most intensive language development of any (and the new process probably blows efforts for other languages out of the water). Larry Wall has a great affinity for languages (both spoken and programming), and it shows, because, for English speakers, Perl is designed so that you can write it like you almost would speak it. Now, you might say that that is "hack"-ish, but that shows a lot more care for the process of programming than a language that idealistically sticks to a theoretical truth in favor of making the language easier to use.
And provide a link to a study that shows Smalltalk is the most productive language. I'm not saying I don't believe you, but I personally find the "hack languages" to allow a much more natural flow between my brain and the screen, so I'd be interested in seeing how that conclusion was reached.
Just don't use the features.
by
Futurepower(tm)
·
· Score: 2
I think your point is interesting about C++ having too many features. But why not just have compiler switches that prevent use of some features? That way, if a project didn't need the complex features, they could be prevented from being used, assuring uniformity and, in some cases, ease of debugging.
The features of C++ don't bother me. I just use what I want. Similarly, English is a very complex language. But, as a professional writer, I choose to avoid obscure words and poor constructions. For example, I usually avoid verb phrases ending in prepositions. I don't say "used to", for example.
And the complex features of C++ are of higher quality than the complex features of a human language that was never designed. The complex features of C++ are very useful in special cases.
What I really don't want is to have to change languages just because I need a particular feature.
why not just have compiler switches that prevent use of some features?
You can do that, but I think what's more relevent is the "programmer portability" problem. I think it's safe to say that very few programmers understand the totality of C++ in all its intracacies and special rules. One man's obscure feature is another man's vital convenience. That creates a major maintenance headache.
The complex features of C++ are very useful in special cases.
Agreed, but the "kitchen sink" approach isn't necessarily good. I mean, why not have built-in matrix arithmetic? A factorial operator? A "count the words in this string" operator? All of these would be useful in "special cases". But it adds more weight to the language, and it's not that hard to add the capability.
The language I want strikes a balance between giving you the power that you need, while keeping the complexity low enough so that the average programmer can understand the entire language and all the rules. Java-the-language, while far from perfect (where the hell are the unsigned data types??), is a pretty damn good compromise. (We'll leave the Java standard library out of this discussion.:)). You can easily learn all there is to know about the Java language and really feel like you know it.
To pick on the favorite whipping boy, are there cases where, for example would be useful? Sure. Is it a critical feature that you can't do without? I think not.
I should say that I agree with you that the complex features of C++ are of very high quality. But I think C++ works better as a study of "first system" successes and failures than what we all should be using as a primary development language.
-- Sometimes it's best to just let stupid people be stupid.
Re:Strict languages vs. hacked languages
by
smallpaul
·
· Score: 3, Insightful
I get the stronger sense that you don't know Ruby -- most Rubyists tend to be ex-Pythoners and not the other way around, but nevermind.
People do tend to progress from more well-known languages to less well-known ones. They don't go to a bookstore and pick up a K book and think: "this would be a good first language." I've played with Ruby enough to decide that it is neat but not appropriate for many of my projects and not a sufficient improvement over Python for the rest.
Python lacks metaclasses, lacks a true unified object hierarchy, and supports multiple inheritance (considered a very bad idea by most experts in OO. Like the "goto" statement, multiple inheritance may seem useful at times but it leads to unmaintainable code). All these are simple repeats of the mistakes of C++.
Python 2.2 has metaclasses, a unified object hierarchy and supports multiple inheritance which is quite useful and safe when used thoughtfully.
It is simply a matter of historical fact that Python was not based upon C++. If it shares features with C++, those would probably be traced back to Simula through Modula-3. Smalltalk is also based upon Simula.
Yes, Python is improving, but all these improvements (like allowing the subclassing of primitives) only serve to point out flaws in the design (why aren't primitives normal objects in the first place?)
Nobody would claim that Python 1.0 was perfect, nor that Python 2.2 is perfect. Nevertheless, you haven't yet mentioned a feature of Ruby that isn't in Python 2.2. There certainly are such features -- but they get increasingly esoteric as Python improves. If I have to choose between Bertrand Meyer-approved-OO-cleanliness and native threads that don't block when you do I/O, I would choose the solid threads. OO-cleanliness is about conceptual elegance and native threads are about getting the job done.
And how deep is Ruby's Unicode support? If you can please point me to documentation on using Ruby's regexp engine to match Unicode characters, I would appreciate it.
My current Python projects depend heavily on both threads and Unicode. Mixins, multiple inheritance and the ability subclass "integer" really don't matter one whit! I am mostly happy that Python is unifying its type system for rhetorical reasons. Practically it hardly matters at all!
If you want to impress the vast majority of programmers who are not language collectors, you'll have to show us some program that are hard to solve in (e.g.) Python and easy to solve in Ruby.
For this and other reasons, it is not accurate to paint Ruby as the next step after Python. It is another good language with strengths and weaknesses. One day it will have a superset of features that Python currently has...but Python will itself have evolved by then.
Re:Glad I changed from a CS major
by
Anonymous Coward
·
· Score: 0
Except for the lack of semicolons at the end of statments, Ruby comes off looking incredibly like PHP in its basic syntax. Anyone else care to comment on the possible relation between the languages?
This looks really cool. Sure beats the hell out of learning Perl for system administration scripts, since I already know PHP and have a basic understanding of OOP...
I find Ruby as a language more satisfying than PHP, which is a mediocre language embedded in a great web scripting environment. They both take a high-level approach with convenient containers and a minimum of setup, but building complex data structures in PHP (as opposed to web pages) can be an exercise in frustration. I personally relish the OO flavor of Ruby over the C-like flavor of PHP.
My personal goal is to create a PHP-like system using Ruby as the language for the best of both worlds--unless someone beats me to it. mod_ruby and eruby are steps in the right direction, but they lack the transparent integration with niceties like automatic sessions, automatic form variables, transparent url-rewriting etc. that make working in PHP so efficient.
First, however, I need to flesh out the Interbase driver, which is currently fairly minimal.
Brent
-- 100,000 lemmings can't all be wrong.
Re:Strict languages vs. hacked languages
by
Anonymous Coward
·
· Score: 0
I think it was at spr.com, but the server appears to be having troubles. whysmalltalk.com describes the link as:
"This is a study of Language productivity. What it shows is that compared to other general purpose languages, Smalltalk is more productive in a function points per man month scale as well as number of statements per function point scale. Check it out!"
I can't remember what other languages were surveyed when I glanced at it, but spr.com used to be working (code red?)
Re:Strict languages vs. hacked languages
by
smallpaul
·
· Score: 2
Python gets all of its object-orientness from C++, Ruby gets its from Smalltalk.
I have a strong sense that you don't know Python. Python gets *none* of its object-orientedness from C++.
Python has full dynamic dispatch, the ability to catch unknown method calls at runtime and so forth. In other words it is much more like Smalltalk than like C++.
Python's OO credentials are just as strong as Ruby's. This is especially true for Python 2.2 where you can subclass even primitive types.
I find it amusing that while the Pythoners mock the Perl-hackers that refuse to upgrade to Python, they themselves refuse to upgrade to the next level.
If Ruby were clearly the next level, you'd be right. But Ruby has as many weaknesses relative to Python as it has strengths. Python's threads are extremely robust (at least on single-processor machines). Ruby's are weak. Python's industry support is much better. Python has full multiple inheritance. Python has less "syntax".
So Ruby isn't more OO and it isn't more elegant. It is at best more "Ruby" -- that will be important for some people and not for others.
Re:Strict languages vs. hacked languages
by
kin_korn_karn
·
· Score: 1
who says Python is an upgrade from Perl? It's all a matter of choice.
Re:Strict languages vs. hacked languages
by
Jonathan
·
· Score: 2
I have a strong sense that you don't know Python.
I get the stronger sense that you don't know Ruby -- most Rubyists tend to be ex-Pythoners and not the other way around, but nevermind.
Python gets *none* of its object-orientedness from C++
Python lacks metaclasses, lacks a true unified object hierarchy, and supports multiple inheritance (considered a very bad idea by most experts in OO. Like the "goto" statement, multiple inheritance may seem useful at times but it leads to unmaintainable code). All these are simple repeats of the mistakes of C++.
Python's OO credentials are just as strong as Ruby's. This is especially true for Python 2.2 where you can subclass even primitive types
Yes, Python is improving, but all these improvements (like allowing the subclassing of primitives) only serve to point out flaws in the design (why aren't primitives normal objects in the first place?)
Re:Horses for Courses
by
Anonymous Coward
·
· Score: 0
Yea! Delphi rocks! It's based on object pascal, a different language than the pascal you learned in school. It's reallyalmost as simple as VB in a lot of ways, but gives you much of the power of C++. It's worth taking a look at.
Re:So
by
Anonymous Coward
·
· Score: 0
I thought that was perl?
Re:Glad I changed from a CS major
by
Anonymous Coward
·
· Score: 0
Programming is about abstract concepts, ability to design solutions, and creativity..
and l33t hax0ring skillz
Re:word math
by
Anonymous Coward
·
· Score: 0
if the iterator is a hardcoded value, there's no reason the new string can't be hardcoded by the programmer;
print "-------------------"
but its usual usage is going to be with a dynamic number of iterations, in which case the interpreter has to create the iterator variable &c at runtime.
So it still doesn't really save any work/cycles.
Re:Strict languages vs. hacked languages
by
Anonymous Coward
·
· Score: 0
(...) They each need their own interpreter. So if I have 5 programs that people have written (...) I need all 5 interperters installed. (...) Unfortunately, I can't think of a good way to fix this problem. So I guess we will just have to get by with it...
Can't you - or sombody else - just write a compilier. (can't be that hard) If an interpeter can read it, why not any other program. E.g. a compilier.
Just a thought...
-- Look a monkey!
Re:Strict languages vs. hacked languages
by
harryo
·
· Score: 1
Sorry, my point was that the "require" happens at
run-time, based on the result of the test.
In other words, it's not a compile-time thing,
as it would be in C/C++/Java. Someone else
pointed out that's possible in Python, too.
I guess Ruby is just the first place I've seen
it, so I'm overnthusiastic:-).
Re:Strict languages vs. hacked languages
by
Capsaicin
·
· Score: 1
Smalltalk has been shown to be the most productive language, and Ruby/Python/Perl all seem to me to have a BASIC odor to them;
Actually Ruby has a distinctive whiff of smalltalk to it. Also I think classifying Python as a non-academic (hacker) language is a little odd, for a language that grew out of a pure teaching language (ie ABC).
-- Better to be despised for too anxious apprehensions, than ruined by too confident a security. --Edmund Burke
what type of shot is Ruby ?
by
beanerspace
·
· Score: 2
We've all seen the usenet post in the coffee room or on various websites. Usually under some title like:
Re:what type of shot is Ruby ?
by
dwlemon
·
· Score: 1
OT: I don't get the entries for Java. Why not:
You try to point the gun at your foot, but when you pull the trigger you find you've actually grown a new foot and shot it instead.
Re:what type of shot is Ruby ?
by
Anonymous Coward
·
· Score: 0
This is a test message to see if Slashdot is working right.
Re:what type of shot is Ruby ?
by
Anonymous Coward
·
· Score: 0
foot{shot}
Re:Strict languages vs. hacked languages
by
Anonymous Coward
·
· Score: 0
Well my friend, as the previous poster expressed it - Python is *strongly* typed. You seem to confuse strongly/weakly and static/dynamic. To make things clear again - Python has dynamic and strong typing. Got it?
Kind regards.
Age is not the issue here. The issue is that it might be better to put more of the fine features into one language, rather than have so many languages.
There would still be the same amount of features to learn, but they would not be scattered all over the programming landscape.
1) It is as platform dependant as any language can possibly get.
Sort of. Assembly is hardware dependent but not necessarily software dependent, thanks to the standard use of ELF. In fact, if you write your Assembly programs properly they can easily be recompiled for any POSIX operating system (Linux, QNX RTP, BeOS) with absolutely no change, and Windows (all varieties) with MinGW if you do some tweaking.
There are some very nice hardware platforms out there. Especially Alpha, and it makes me said to alienate these. But, as you may know, most processors out there today are IA32 compatible. Even though Alpha is so nice. *sniff*
2) It is very hard to read.
This is strictly opinion. I find C hard to read. Assembly is simple, linear, and straightforward. You never have to guess what is going on. As for C, well, look at the obfuscated C contest.:)
3) It is relatively hard to learn. Don't tell me assembly isn't hard, it is definetely _MUCH_ harder than Ruby which has e.g. those nice and _easy_ string manipulation possibilities.
I am going to go against what you said. Assembly isn't hard. It is much easier to learn than most high-level languages. The basic instruction set is very small. Once you learn the basic instruction set the only thing you need to learn is how the hardware operates. That is the hard part.
Now with comprehensive driver systems in modern operating systems it is not necessary to learn all the gory details of the computer hardware. You just CALL any functions you need. Of course learning the gory details is always fun, if you wanna learn them.
4) Source code is huge.
Sort of. This is not true if you do things right. This kind of ties in with the last statement. Back in the cave-days most Assemblers were really unsophisticated. You wrote your program from beginning to end in ASM code with some labels. Maybe did some calls, jump around a bit.
Now a-days, we have come a long way. We are much more civilized. No ASM programmer likes to manually push 5 offsets on to the stack to perform a call. We use macros for all the "drudgery" that normally makes ASM programming hard work; especially chores that can't be optimized but are done often.
And for "meat" of the program you will find that ASM programming is a lot more satisfying. Most C optimizations are compiler dependent and it's hard to see what's going behind the scenes. In ASM you will always know if your ASM code sucks or not, before it's even done.
...a job done quickly, assembly is really not the language to use.
True enough! But once you have a solid code foundation it is pretty easy and quick to use.
I'd say this the other way arround: Assembly is a way to represent the raw binary format of 1's and 0's in a sort of human readable format.
On Windows I develop stand alone applications with Delphi.
I agree, too bad Borland never made a version of Delphi that generated byte codes (or whatever people are calling P-code these days), that would be the best of both worlds.
Horses Mongo like horses.
Re:Glad I changed from a CS major
by
Anonymous Coward
·
· Score: 0
I like failing
Horses for Courses
by
Hairy1
·
· Score: 2, Interesting
A associate once said about programming its "Horses for courses". What he meant was that we should use the best tool for the job at hand. When he said it he was talking about using Clipper (an dBase clone) over Quick Basic in 1990.
Today I know two languages to what I consider 'professional level'. On Windows I develop stand alone applications with Delphi. Its easy to develop quality code - I define quality in this case by not crashing due to obscure memory errors. Its very hard to write code in Delphi which causes memory handling issues. Writing Delphi feels like the IDE wants to help you, but if you want to get your hands dirty you still can (unlike VB).
For Web Development I now use Java. I wouldn't use Java for stand alone GUI apps because its still too slow compared to Delphi, but for server side web development it has the features I want - portability, easy to develop in, connects with SQL etc.
Learning a new syntax takes time. You need to be sure that a new language is going to have a payoff in terms of being able to achieve something you can't in others. For years I wrote Delphi, as it was the best horse for the course. Now with Web Develoipment the course has changed, and Java is best (for me).
That said, a programmer should be able to learn any language. But just because you can doesn't mean you should...
Re:I think this said it all...
by
ToWnSaVeR2
·
· Score: 1
if enterWorld == $salut[0]
print "\n" + "Yes. Hello World would be
polite.\n"
break
else
print "You say '", enterWorld, "'?!\n" + "You
humans are so rude!\n"
end
argh...it has a conditional structure like Visual Basic. Thats just what need another language like C# that claims to modern and able to do it all. I will stick with a tried true like perl, Yes i actually can remember to put a semicolon at the end of a statment. Speeds up development my arse.
Its called "Spanish" and its the language of choice when you want to call a gringo pendejo, well... a gringo pendejo.
Abreu
- risking karma by standing up to the gringos since 1999 -
-- No sig for the moment.
Re:Horrible article
by
Anonymous Coward
·
· Score: 0
Python is considered by many to be the most elegant language even designed.
It's certainly cleaner than perl, and I like it and use it heavily, but elegant? Private attributes are created by prepending a double underscore, which is then mangled so that __foo becomes __Classname__foo. A number of features seem to be afterthoughts like that.
Significant indentation has some advantages, but it also leads to kludginess. Compare generating code in Lisp, with generating code in python. (How would you generate code for a new method and add it to a class, anyway?) Try un-mangling a python program that has suffered tab damage. Try cutting and pasting code, and having to shift it manually because no auto-indent mode is possible.
Python is more elegant than perl, and did a lot of things right. It's got plenty of quirks and kludges, though. Ruby isn't perfect either, but the more I've read of the Programming Ruby book, the more I've appreciated the coherence of the design. As other people have pointed out, you'd miss most of the important points in favor of Ruby if you just go by the article that prompted this thread.
OTOH, the availability of libraries and example code is inversely proportional to elegance: perl has the most, python next, and ruby the least. Often that overrides any other considerations.
Then what about when you start on a new language - say C++, then you'll need to get the hang on procedural anyways and if your not a programming wizard in Ruby, you'll probably have to walk through python anyways. (If only briefly) My suggestion is stick to python. Or switch to Ruby and stribe grasping mixed languages later on.
-- Look a monkey!
Re:Strict vs. hacked languages (THIS IS A RANT)
by
Peaker
·
· Score: 1
is this truly OO?:)
and in Python, its: print 'Hello World'
If you want to describe how your objects 'print themselves', in Python its better done in a more generic way, you write an __str__ method in your object, that knows to represent it as a string for printing, but as an added bonus - it can be represented as a string for ANY purpose!:)
Language writers should put their creativity into extending C++ rather than abandoning it.
They are. The C++ standards committee deliberately left C++ in a known, standardised state for three years or so to allow some stability for developers using it. They are now actively working on C++0x, the next revision to the standard, currently expected some time 2003-2005. (That's level with, or ahead of, fully.NET supporting versions of Windoze, BTW. C# advocates, eat your hearts out.)
Strange as it may seem to some of the posters around here, the serious guys have actually noticed that people want to see inter-language communication, threading, yada yada, too. Members of the committee, including Stroustrup himself, have several stated goals for C++0x, including:
removing some of the most common complaints about C++ as it stands (syntax oddities and the like);
making C++ easier to teach properly (since most teaching of C++ at the moment is terrible, which is the single biggest problem the language has);
ambitious extensions to the library (likely to include a framework for threading, RPC, etc);
better support for interfacing with other programming languages, and for use with architectures using "components" (CORBA, COM, EJB, and so on).
So, before everyone gets off on talking about C++ with 15-years-out-of-date knowledge as usual, please remember that the language is still being worked on, is still improving and is still adapting to the rest of the marketplace. While people on/. buzzword themselves to death, the pro's using solid tools like C++ will continue to do so. More details, as ever, can be found on the comp.std.c++ newsgroup.
-- If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
I have spent several afternoons looking through all the books on C++. There is a strong tendency in most of these books to explain without truly explaining, or to mystify without explaining at all.
The books aren't the worst part. It's the "professors" who "teach C++" without actually knowing it themselves who do the most damage. People wouldn't accept a physics prof who didn't know Newton's Laws, so why people accept a CS prof who can't program basic C++ properly is an eternal mystery to me.
It is great to know that C++ will eventually be extended. But the 2 to 4 human years that you mention is equivalent to 14 or 28 technology years.
Maybe, but that's the price you have to pay for having a well thought-out solution to a complex problem. The alternative, as Java enthusiasts are starting to discover, is that you get a succession of not-quite-right solutions, all of which you have to support forever after, resulting in a ballooning set of tools with ever decreasing added value.
In programming language terms, 2-4 years isn't that long, anyway. Java may evolve somewhat, but it probably won't change much if the last two years are anything to go by. C#/.NET and such may be around (or may not, since MS have just pushed back the boundaries again). C probably won't have changed much, if at all, in that time frame. So, compared to the other languages in the family, it'll be a big advance for C++ much sooner than anyone else is likely to change.
You mention "better support for interfacing with other programming languages".
This is not a controversial addition to the C++ language. It seems to me that it should have been finished 2 years ago, not 2 years from now.
In a manner of speaking, it was. There is no reason a vendor cannot provide an extern "Delphi" or extern "Python" option now. The standard was carefully phrased so that the extern "C" syntax could be used with other languages as well. The fact that people choose not to use it is a problem with the compiler vendors, not the language.
BTW, a binary standard would certainly be nice in an ideal world, but does raise certain practical problems. How do you handle templates, for example (which have no code associated with them at all until instantiated)? I'm not saying these problems need be insurmountable, but they are technically challenging. Just providing export is still a sticking point for every major C++ compiler on the planet. Once the C++ community has learned to solve that sort of problem, a binary interface standard is not so unlikely, but again it will take time.
-- If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
For python you can use freeze (comes with the source distribution) or py2exe.
I've used this to produce different binary versions of the same program that ran happily enough on Win2k/NT, HP-UX and Solaris, all without having to distribute the interpreter itself, or require that these systems had python installed.
If I had modpoints, i'd have used them on you. The other explainations (ie: it's better/quicker than a for loop) are valid, but seem wasteful. This, though, seems appropriate.
I guess i'll download and try it later tonight, I just dont like the VB style conditionals (if fuck break else shit break end nonsense).
Re:Strict vs. hacked languages (THIS IS A RANT)
by
sigwinch
·
· Score: 2
Ruby is too much OO. I don't want methods for literal values.
Then don't use them, silly. Just because you can give your integers a different function for the addition operator doesn't mean you *have* to. Do whatever is appropriate.
In the professional world (i.e. the one that matters), OO is way overdone and misused.
Sturgeon's Law: 90% of everything is crud. Procedural programming is just as poorly used as object-oriented programming. You probably weren't around at the time, but OO was supposed to be the 'silver bullet' that solved all the problems that structured programming didn't solve. Structured programming, in turn was supposed to be the silver bullet that slew the beast of ad hoc programming.
With an OO environment, you can abstract the design of a program from the code itself, in the old procedural model you couldn't really do that.
Sure you could. Clear conceptual abstraction was, in fact, the *whole point* of structured design. 'This module has these responsibilities. It provides these functions. It uses these other modules. It functions as a highly-extended wrapper around this basic module.'
Take a good structured design, substitute 'class' for 'module' and 'member method' for 'public function', and you'll have a good OO design. OO is just an easier way to implement the classic structured design elements: encapsulation, extensibility, and genericity.
and not have to type all that class/method setup garbage just to get to one library routine. Is that too much to ask? To OO zealots it is.
Huh? I can't speak for Java, but your 'dream code' is standard operating procedure for Python (and, I imagine, Ruby). Here's a transcript of your Hello World example from an actual Python interpreter:
(I could have said print "Hello World" instead of the sys.stdout.write() call, but I wanted it to look like what you had written.)
Download a Python interpreter, type that code in, and see it run for yourself. If you don't like OO because of your experiences with C++, Java, or Perl, you should try Python or Ruby. They are OO languages done right, as opposed to the hideous Lovecraftian horror of C++. Even if you insist on structured programming with no OO, Python has a very nice module system that makes it easy to create and encapsulate modules.
--
-- Kuro5hin.org: where the good times never end.;-)
Re:Strict languages vs. hacked languages
by
RevAaron
·
· Score: 2
Smalltalk didn't come before C. C was created in 1972. There was an early version of Smalltalk called Smalltalk-72 back then (written in BCPL, IIRC), but it's not much like the version most implementations today resemble- Smalltalk-80, which was created in, 1980.
Why didn't Smalltlak take off? There are a lot of reasons, including:
Horrible business management. In some ways, it's a surprise ParcPlace didn't totally kill it. Now a days there a a few actually-free implementations as well as non-commercial versions of others that can be used for no charge.
Smalltalk (not SmallTalk) came out in 1980, and required more resources than most PCs had at the time-1 MB of RAM and a bitmapped display. By the time those were available on a good many PCs, people were already used to C and Pascal.
In what sense would you say Smalltalk "didn't grow up as much?" Smalltalk is incredibly mature and stable- so, I doubt that's what you mean.
Smalltalk is productive, in my experience. Putting Smalltalk and C in the same league is silly- at the very least, C++ and the STL would be a better comparison.
Smalltalk isn't the best for kernel-hacking or serious number crunching (F90 anyone?), but I don't claim it to be. It's a great language, a great system- one with which a person can be incredibly productive, especially in comparison to C++/STL and Java.
Not being able to spell the language's name correctly is a sign you've never actually had any experience with it.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Are there concepts that can be expressed in one (human) language, but not another?
AFAIK, not in practice. It is always possible to introduce new words into a language when it becomes necessary. An African tribe might not have a word for "snow", but if they saw any, they would quickly invent one (or loan it from another language).
As I recall, modern linguistics says that all natural language grammars follow the same meta-grammar. In other words, natural language grammars are all similar in fundamental ways, and can be used to express the same links between concepts. From my experience with Japanese, I know it's always possible to translate a Japanese sentence to English (provided the phrase doesn't contain any aspects of Japanese culture that English has no word for); there'll be some loss of nuance, but the core meaning can be transmitted. Imho, though languages have different nuances that reflect the culture of their speakers, no language results in fundamentally superior "productivity" at any task, once the proper vocabulary has been learned.
Name a single feature in C# that hasn't appeared in at least 3 languages prior to it.
Name a single feature in [LANGUAGE] that hasn't appeared in at least [QUANTITY] languages prior to it. Languages have been evolving, not radically changing, for the most part. That includes the Open Source darling Java.
I currently make my living writing.jsp's and Java servelets (that's not what I signed up to do, but hey, as long as they pay me, I don't mind).
Conclusions:
1. Java is a nice language. I would prefer Java to C++ any time of the day.
2. Java is a useless language outside of a very controlled environment. Because it is not Open Source, it is highly unportable (just try running Java on OpenBSD sometime!), and because the existing runtimes are so bloated, it's only useful for applications where you don't mind having a spare 40 megabytes of bloat hanging around.
In other words, Java is *not* a panacea, and certainly isn't a replacement for highly dynamic languages such as Python or Ruby, which tackle an entirely different problem set.
My opinion of Ruby: Nice language. Some stupidities though -- the whole notion of making variable types case-sensitive reeks of Fortran. I considered Ruby for the TapiocaStor project, but had to dismiss it from contention because it's not yet mature enough. We're using Java, but only because we can't use Python for legal reasons.
Re:Java has won *nothing*
by
auntfloyd
·
· Score: 3, Informative
Because it is not Open Source, it is highly unportable (just try running Java on OpenBSD sometime!)
Ok. On a just-installed machine (complete with generic kernel, yes I know):
(rob@denali:~)$ uname -a
OpenBSD denali.CENSORED.com 2.9 GENERIC#653 i386
(rob@denali:~)$ java -version
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)
That's OpenBSD 2.9 running the latest JDK 1.4 beta. What were you saying again?
You also seem to be confusing Java (the platform) with Sun's version of Java. Open Source editions (eg Kaffe can run on just about anything. Not to mention that you can get the sources to Sun's JDK.
-- The only title of honor that a tyrant can grant is "Enemy of the State."
Re:Java has won *nothing*
by
RevAaron
·
· Score: 3, Informative
Some stupidities though -- the whole notion of making variable types case-sensitive reeks of Fortran.
That's because they're not types, they're classes. And why does that matter? Because all you reference a class by it's name- as a VARIABLE. If all Ruby variables were case-insensitive, then classes, or types as you refer to them, would also be case-insensitive.
It's simple, beautifful elegance. This is unlike other languages, where types and/or classes are an exception, aren't normal variables. There lie's power in Ruby's approach.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Re:Why learn another language?
by
Jagasian
·
· Score: 2
Amen! I wish I had mod points ( +1 Insightful ).
Horrible article
by
Anonymous Coward
·
· Score: 0
I hack Python *much* more than I do Ruby and Perl, especially in the last six months, however I do know all three languages, and anyone even the slightest bit familiar with Ruby will tell you this is a horrible article.
First off, it tries to present itself as an "article for pogrammers" that is supposed to cut right to the chase for programmers who all ready know other languages. Instead if does just the opposite and shows us *none* of the useful features of Ruby _at_all.
If you want a *good* introduction to Ruby, read this book available for all on Ruby Central:
http://www.rubycentral.com/book
As far as the claims that Perl, Python, and Ruby are "hacked together languages", the person making these claims either has no experience with the languages, or is just flaming (probably both:-)).
Python:
Python is considered by many to be the most elegant language even designed. While syntax is a matter of preference, I think most people will agree that Python really got it right. Since I can't go much more into this without getting into personal opinions I will just say that Python has an *incredible* amount of high quality modules/libraries some of which are:
While I personally wouldn't consider Perl the best designed language for_general_purpose_programming, it *excels* at text processing, system administration, and CGI scripts, which are what it was originally designed for (well maybe not the CGI sciprt part).
Ruby:
Ruby is a cross between the convenience and quick hack potential of Perl, and the clean design and pure OOP of Smalltalk (without the strange syntax). I can not really judge it accuratley because it is not as mature as some other languages and the modules/libraries are not all in place yet. However it is not poorly designed.
Being able to pick the right language for the right problem is essential to being an effective programmer. I wouldn't use Python for a device drive, but I wouldn't use C for a mail client either.
I don't see how anyone can call themselves a hacker (or even a programmer for that matter), is they only learn two or three languages.
However I feel a rant coming on so I will retire to my Emacs buffer.:-)
Re:Strict languages vs. hacked languages
by
Jonathan
·
· Score: 2
That's bunk. There's nothing other than what is "acceptable usage" in a coder's mind that makes something a "normal" or "scripting" language.
Well, in the case of Smalltalk, most implementations I've seen live in their own environments rather than interacting with the native command line. This makes them more or less useless for "scripting" in the normal sense where you call a script from the command line and pipe data into a script and output results on stdout. For example:
neatoScript < data.txt > processedData.txt
Perhaps you don't have to do such tasks in your own work, but that's what scripting languages are used for.
Re:missing the point
by
Anonymous Coward
·
· Score: 0
The key feature of Smalltalk is its programming environment.
Nice try, Plastic-Man, but that's too much of a stretch even for you.
Re:Why learn another language?
by
hardburn
·
· Score: 1
OTOH, beware of teachers who know too many languages. My Java Programming professor last semester also taught the VB programming class. He would often forget which class he was in and start writing VB in the middle of a block of Java.
-- Not a typewriter
Re:Strict languages vs. hacked languages
by
TWR
·
· Score: 2
Maintaining code is a pretty thankless job, but at least with MI the changes only have to be made in one place. Java's interface based MI either forces similar code to be included in each class that implements an interface or the inclusion of lots of little stub routines that to call the smae named routine on a different class.
Clearly you aren't a Java programmer. If you want to do multiple inheritance, what you most likely really want to do is share some utilities across several class hierarchies. This means you want a utility class, if you want things to be clean.
What you should do is declare an interface which exposes various properties which are needed to perform the utility operation. Then create a singleton which you pass in object of the interface type.
Presto! Code in one place can be modified to support multiple classes. Inheritance is used for what it is supposed to be used, and maintanence is easy.
-jon
--
Remember Amalek.
Re:so many choices
by
Anonymous Coward
·
· Score: 0
I haven't wrote anything in ruby but it looks much messier than python. There's all those $&!'s just like in perl. Python's forte is extremely clean and readable syntax. As for mixture of OO and procedural - doesn't ruby mix these two also? As in, unlike java where everything *has* to be instantiated from a class, and we know how over-the-top verbose that is. Special cases? Could you elaborate, I haven't seen any special cases, after all, "explicit better than implicit' is the mantra of python. Let's not forget clear advantages of python over Ruby, either: much more documentation (for all skill levels), many books available and many more are being worked on (over 30 as I heard..), and more comprehensive standard lib. In response to the original poster: Don't worry about there being a lot of languages. The hard part is learning how to program - and you chose the best language to start with, imho. Once you are a good programmer, picking up a new language is fairly straightforward (especially a well-designed
one like ruby).
Python 2.1 (#1, Jun 20 2001, 17:56:17)
[GCC 2.95.2 19991024 (release)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> 'Python also has this feature. ' * 3
'Python also has this feature. Python also has this feature. Python also has this feature. '
For quite some time now, I have become disillusioned with the whole of computer programming. I have always thought almost exactly this about my skills, but I have never come across another person who believed the same. I have never before posted to/. but I read it often. All languages are so similar that there is no reason to specialize. For as long as I can remember, I have wanted to learn and read more about new and different languages. This is the reason that this Ruby language topic drew my attention. I have examined many different languages and found most to be missing something, I know not what. Ruby is no different. It smacks of other languages. I want something new and different.
First I learned BASIC, but this was basic, so I moved on. Then came HTML and now I have a web page floating around, but there was no real reason to go beyond that. School taught Pascal, so I learned that. Then came C++. That was interesting. OOP was new to me, so I read some books and tried some new things. College came and they put me in a class which asked of me a certain knowledge of Java that I didn't have. I met someone else who was in the same situation. I had some fears but I said that knowing C++ would make it easy. It did. He failed. I didn't understand why. I thought that maybe I was wrong. Maybe different languages are hard to learn. So, someone told me that Assembly was difficult and interesting. I read some more books. It was not all that unlike what I had been trying to do in my other programs. I like Assembly a lot more than some of the other languages that I know. Now, I cannot say that I have real world experience in any of these languages, only school and private learning. But, inasmuch as I can see, it would not be that hard.
Again, however, I was afraid. I went to my job one day and they said they needed some VB program fixed. I told them I would do it. But they looked at my resume and didn't see it on there. So, I thought that maybe I was wrong. Maybe I shouldn't be able to fix something in a language that I have never really used before. Once the job was done, I realized that they were wrong.
Since then, I have been looking through the many people at my school for anyone who thought these same things. I couldn't find them. So, again, I thought I was wrong. Now I read this post, and my faith is renewed. This is honestly the first person I have ever seen who expressed anything that I have thought. I just wanted to say thank you, Dalroth, for that.
One of these days, maybe some new language talked about here will have some marverlously new way of doing things and I will be glad take some time out to learn it and use it. But for the moment, I guess I must be content to read what is here and learn all of these painfully similar languages. Does anyone out there know of any languages that are interesting and different? Please tell me about them. I am on the lookout constantly, but they all seem to be just like the next one. I guess I will just go back to reading my Assembly book. Sorry for my craziness, but I was excited enough to post for the first time, which means that I was probably not thinking in a manner fit for sharing. Here it is anyway.
For new and different, try LISP. Well new to you, it's actually very old.
Incredibly simple syntax. Open and Close parens, white-space, dot, quotes, other-chars. Most Lisps will recognize numerics, but that is not essential. Characterized by lines with 30-odd close parens. The parens are NOT optional.
Coding style can be pure lisp, functional and possibly without any variables. Coding style can be prog-style, more like the "normal" languages. The styles can be mixed.
Don't discount Assembly as a high-level language. It's probably still the only decent way to implement (recursive) co-routines.
The languages you mentioned were all OO or procedural languages. Take a look at functional,
logic, stack-based, vector languages or multi-paradigm ones.
Have a look at:
http://www.uni-karlsruhe.de/~uu9r/lang/html/lang.e n.html.
I put up this page to make it myself easier to get a feeling for or to remeber a language.
Interesting languages (my opinion) and different ones are listed below:
Vector-based:
APL
J: "APL without ASCII character set" (*)
K
Stack-based:
Forth (*)
Postscript
Functional:
OCaml: Very fast, nearly as fast as C; OO and imperative features (*)
Haskell, Gofer: pure, lazy functional language (*)
Concurrent Clean: (*)
Pliant: dynamic extensible parser (a bit Lisp-style)
Aleph: Scheme-like language; used in the operating system Plan9 for many tasks
FISh: "Functional = Imperative + Shape", very fast
Funny/Strange/Useless:
Befunge
BrainF*ck
OO:
Beta: Pattern-concept (*)
Sather: Eiffel-dialect with many additional concepts, like closures (*)
Dylan
Simula: As background for C++ and other languages
C-Talk: Mixture of C++, Smalltalk, Lisp and CLU
Brain: Smalltalk-ish scripting language
Tom: Mixture of Objective-C + Smalltalk
Multiparadigm:
Leda: Imperative, OO, functional and logic
Mercury: Functional + Logic
Logic/Declarative:
Prolog: for knowledge bases etc.. (*)
Distributed:
Oz/Mozart: dynamic typed language applicable for mobile agents etc.. (*)
JoCaml: OCaml dialect extended for Join-Pattern (Thread synchronization) and networking (*)
I've put a (*) to the languages I find very interesting. Those should be worth for a short look at it.
OT:
I've seen and leaned many languages, most of them
were not usable for Real-World applications.
I go on to look for new languages, but for now, my
language of choice is Ruby.
I worked with Perl, wrote several thousands lines of code,
but I found it too complicated and hard to learn
and error-prone (for my programs).
I am sure if you have spend some time with Perl,
and you have become a "Perl hacker" you can code
very efficient and write good code. But with Ruby
or Python you don't have to learn that much.
As I first came across Python (~ 1.5) I was
really happy - it was my first interpreted language, since GFA BASIC on the Atari - and
impressed about it. It took me serveral days to
read through the Python manual.
Then one night, I found a link to Ruby at http://www.cetus-links.org (this was Ruby 1.3 - today 1.7). I read the Ruby Users Guide by GOTO Kentaro and was able to code little program in Ruby in the same night.
In my opinion it was a lot easier than Python but equal powerful. (I don't know much about the features of Python today.
Now some years ago I still love Ruby and it's nice community, but I am open for all the other nice languages around there.
As the guy who wrote the article.
by
poet
·
· Score: 5, Informative
It is important not to judge Ruby on this article.
The content in the article is specifically designed to look like either Perl or Python. This was to generate a similarity that programmers from other languages can understand.
The second one, article in the series looks a lot less like Perl and more like Python. This is due to Ruby being a true OO, very similar to Python.
The third article will (if they let me write it) cover advanced Ruby structures and illustrate them by interfacing with the PostgreSQL database.
The fourth article will cover Ruby/Qt.
If you guys want to see these articles you may want to give some decent feedback on the Developer Works site.
-- Get your PostgreSQL here: http://www.commandprompt.com/
Re:As the guy who wrote the article.
by
Anonymous Coward
·
· Score: 0
The artical is fine, just what I was looking for. As anyone who is *realy* interested in the language should refer to Rubies homepage for information to "judge" the language. Most of the posters here, have obviously not done that. That is why they are making more scents then sence.
I have read enough about Ruby to be interested in using it. Now all I need is to take it for a test drive. This artical is a great starting point for this.
Re:As the guy who wrote the article.
by
oliverk
·
· Score: 1
This is why I love slashdot:)
-- ----
Please be nice in case my Slashdot karma ~= my real life karma.
Re:word math
by
Anonymous Coward
·
· Score: 0
So does perl. Big fricken whoop. Any light weight scripting language is gonna have that.
Oh wow and if it's that important right a C function for it and stash it away somewhere.
Sheesh.
Haha it's kinda funny all the bangwagon jumpers are gonna have to switch to ruby now.
Re:Glad I changed from a CS major
by
Anonymous Coward
·
· Score: 0
ho hum
Re:Strict languages vs. hacked languages
by
Anonymous Coward
·
· Score: 0
just so you know, the moron AC that you're responding to isn't me (the AC 2 ticks up)
Re:Strict languages vs. hacked languages
by
Blackheart2
·
· Score: 1
Personally, when I program, I'm not looking for my code to fit some elegant
theory. I'm looking for the job to get done as succinctly as possible.
Spoken like a true hacker. But perhaps you are overlooking the fact that brevity and maintainability are two of the most important criteria for "elegance".
I found it ironic you say that because Perl has
problem undergone the most intensive language development of any (and the new process probably blows efforts for other languages
out of the water)
I don't know what you mean by "language development". To me, developing a language means increasing our understanding of its behavior, or increasing its expressiveness. Perl has been the subject of many superficial enhancements, but practically no rigorous analysis. There is no doubt in any informed person's mind that the best understood programming language is the lambda-calculus, which is a mathematical system that forms the core of all functional languages, incl. particularly Scheme and ML. As for expressiveness, I'm not aware of any Perl feature which cannot be macro-defined in lambda-calculus, and thus, e.g., Scheme as well.
Perl is designed so that you can write it like you almost would speak it
Spoken language is so complex and ambiguous that finding denotational models of even tiny subsets is still and will continue to be for many years a focus of research. When you write a program, you want to be sure that its semantics are well-defined and unambiguous.
But this is really beside the point. What makes you think Perl resembles spoken language is mostly to do with the surface syntax anyway. All serious research into linguistic semantics is done with mathematical models which do not resemble Perl in any way and, indeed, lambda-calculus is one of them!
--
BH Fools! They laughed at me at the Sorbonne...!
Re:missing the point
by
mj6798
·
· Score: 2, Informative
I nominate you for the "Sweeping Statements Award." I especially like the way you say "The object models of Python, Perl, and Ruby."
Maybe you haven't noticed, but Python, Perl, and Ruby all represent objects as general purpose dictionary types, in contrast to the Lisp and Smalltalk approaches.
Beyond that, I have no idea what you railing against. Did I say scripting languages were bad? Did I say people should switch to Lisp? What is your problem?
Re:RUBY=SUCKS
by
Anonymous Coward
·
· Score: 0
yeah but C# really is a blatant rip off of java. C# is Microsoft's Java killer. and thats a shame because Java development is open and J2EE is very powerfull.
I'm not sure I believe that. It is shorter, but experience shows that the more that you obsure control structures (in this case what should function as a for loop) the more likely that code is to end up needing to be debugged.
Sometimes it is better to be obvious and allow future developers maintaining your code to quickly understand it.
$salut = $salut * 3
will result in the following:
Oh, I am sorry. I didn't mean to warn you...
Oh, I am sorry. I didn't mean to warn you...
Oh, I am sorry. I didn't mean to warn you...
I am sorry but i dont see the point in performing math operations on a strings. Oh, the line noise of Ruby...
It's not harder, but worse. It might be slower (depends on compiler/interpreter optimization quality), because an additional loop variable is needed and the loop must be executed.
for($x=1;$x==20;$x++) { print "-" }
are actully twenty print statements (or, if you use a temporary $line variable, there will be twenty string concatenation operations), while the compiler/interpreter can almost certainly optimize
print "-" * 20
to a single string constant and a single print statement.
The second code is also much easier to read, IMHO.
-- Sig (appended to the end of comments I post, 54 chars)
I don't quite understand the VB-style conditional things (I don't code for crappy OSes as a general rule;)
It seems to me that
"if fuck break else shit break end"
is the equivalent of perl code like:
"if (stuff) {dothis;} else (stuff2) {dothis;}"
Now... wasn't the perl a helluva lot easier?
WTF is with the "break" and "end" things? Why the HELL would somebody want to put the word "end" at the end of a statement, block, line, or whatever the fsck that is, instead of a simple semicolon??
It can actually be useful when you want to align things and need to insert a certain number of spaces. Say you have one word at the start of a line, and a second word that should appear at column 40. With "string math", you can do something like this (this should be valid Python, I think):
Note that I have never used Ruby yet, but I do think there are some uses for string math (though for the above example one might prefer to use output alignment functions).
-- Sig (appended to the end of comments I post, 54 chars)
No it's not. But with Ruby you don't have to.
If you want to see big savings download Ruby. Then compare any library with it's Perl counterpart. Almost always the Ruby source is smaller and more readable. The reason is because of a cummulative effect of these "insignificant improvements".
Um, yes. I _hate_ doing this kind of menial task myself. The more concise it is (as long as it doesn't obfuscate the code, which the word math doesn't IMHO), the more time I can spend on thinking up the best solution to the problem.
so many choices
by
RestiffBard
·
· Score: 2, Insightful
I'm just learning python now. There just aren't enough hours in the day for me to learn all of these languages.
There just aren't enough hours in the day for me to learn all of these languages.
Ruby is different. It's really easy to learn when you know other languages.
I have to cite the paperback of "Programming Ruby": Guided by the Principle of Least Surprise, Ruby embodies the values of consistency and simplicity of expression
Re:so many choices
by
Anonymous Coward
·
· Score: 0
How about pick one language and actually write some useful code in it, instead of learning the latest trendy language to come around.
but choose the language that best meets your needs
The problem with this is, how to you choose the best language for your needs without learning them?
Re:so many choices
by
Ghoser777
·
· Score: 2, Insightful
There isn't enough hours in the day to learn every tongue used around the world by people either. The amount of languages is a partial indicator of the diversification of programming. Each language brings something different to the table. French, Spanish, German, Russia: they all have their different connotations and ways of expression. It shouldn't necessarially be your goal to learn all these languages, but choose the language that best meets your needs. And hey, having that Ruby reference book can be as useful when you get in a jam as when you end up in Mexico with an English-to-Mexican and vice-a-versa dictionary.
F-bacher
-- James Tiberius Kirk: "Spock, the women on your planet are logical. No other planet in the galaxy can make that claim."
when you end up in Mexico with an English-to-Mexican and vice-a-versa dictionary.
Mexican? Everyone knows they speak Latin in Latin America.
Re:so many choices
by
Anonymous Coward
·
· Score: 0
Mod parent up!!
Re:so many choices
by
Anonymous Coward
·
· Score: 0
I just fucked your parents up the ass
is that the same thing?
Re:Strict languages vs. hacked languages
by
Courageous
·
· Score: 1
>Usually the latter turns out to be some baroque conglomeration of features piled on features, creating a very top heavy feeling to the language, while the former classification languages all have a purity to them, e.g. smalltalk, lisp,....
Have you actually programmed in LISP? There has to be a good dozen and a half unique looping forms in the language. LISP is not "pure," it's the friggin' kitchen sink.
C//
Re:Strict languages vs. hacked languages
by
RevAaron
·
· Score: 2
One could call C++ hacked - it's "features on top of features". But than- it's the most widely use language, so I guess it _MUST_ have is strengts...
C++ is almost nothing else but a huge hack. It's only strength over other languages is backwards compatibility of a way of thinking with C. Nothing more.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Actually, you're right
by
Anonymous Coward
·
· Score: 0
It's the CLR (common language runtime) part of the whole.NET cloud.
Re:Why learn another language?
by
RevAaron
·
· Score: 2
With appologies to Heinlein, it takes longer than a day to grok a new language.
Not always. IMO, Java built on my existing C++ and Smalltalk knowledge that it didn't really provide anything that Smalltalk (and to a lesser extent, C++) could provide- it was merely a new syntax and was a part of a different business model. For those unexposed to Smalltalk, Ruby has some aspects which may take a while to grok, but for the most part, it builds on my existing knowledge, leaving almost nothing to grok. But in many cases, it's more convenient.
I'm stil trying to get to know how to use Perl, but not just to grok it- it seems there are so many rules for every tiny thing you'd want to do that I've had to keep docs open for anything that departs from print "hello world...";
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Java has won Re:Why learn another language?
by
joneshenry
·
· Score: 1
It is fashionable to pretend to be open-minded, and it seems to make sense that the endless cycle of the creation of new popular languages will continue unabated. But I propose that Java has changed the paradigm, and unless Microsoft with its immense resources can force C# into acceptance, the era of systems programming language growth is over. What makes Java different is that Sun has focused on making sure that for every profitable application there will be an officially branded API. And since Sun controls the language no one can fork off incompatibilities. First Sun allied with IBM and Oracle to wedge Java into business and now the networking effects are taking over to draw everyone else in. Take a look at this interview with Bjarne Stroustrup. Note how many of Stroustrup's wishes are already in Java.
But why should't we spend some time having fun with other languages? We shouldn't because time is the most precious resource. Ignorance of how the small things add up to big things is how people who used to earn good money can have no savings and how people become obese. Two weeks spent on Ruby is two weeks you didn't spend on something else. If we followed Dalroth's advice, we would repeatedly waste weeks at a time on other fringe languages as well. Sure it MIGHT pay off but this is the same logic people are criticized for when they spend money on lottery tickets.
I think that learning to live in a budget is simply part of growing up. There is not infinite money to spend, most cannot eat an unlimited amount of junk food without getting fat, and one doesn't have unlimited time. One has to make hard choices. Why is it so hard to accept that people need to make time budgets, especially in light of research that it is essential to get proper amounts of sleep in order to learn.
Re:Java has won Re:Why learn another language?
by
CoughDropAddict
·
· Score: 2
It is fashionable to pretend to be open-minded
Almost as fashionable as pretending to be pragmatically cynical.
If we followed Dalroth's advice, we would repeatedly waste weeks at a time on other fringe languages as well. Sure it MIGHT pay off but this is the same logic people are criticized for when they spend money on lottery tickets.
I don't do things because I think they'll "pay off." I do them because I learn things from them, and because they're fun. Every time I learn a new language and compare it with the ones I already know, I learn something (and it's fun, too).
Re:Strict languages vs. hacked languages
by
RevAaron
·
· Score: 2
The first time I touched Smalltalk, I have immediately placed it in the category of academic curiosity (just like Prolog) because it is an interpreted language.
Smalltalk isn't interpreted. It's incrementally compiled run on top of a VM. What does that mean? Methods are compiled into bytecode and then interpreted or JITered. This is similar to Java, with the exception that there is no explicit "compile" command.
In a Smalltalk browser, when you save the method you're working on, the method is compiled, and you're alerted to any errors in your code. Now, this compilation takes a fraction of a second, even on 486. It may not feel like it's compiling, but that's only because you're used to having to take the explicit step and running gcc/g++/javac or what have you.
Considering it productive was nearly the same, IMHO, as considering QuickBASIC to be productive.
It shows you've not done more with Smalltalk than "Hello, World" examples. For application level programming, in my experience, Smalltalk is more productive than C++ and Java, given both the Smalltalk and C++/Java programmers are somewhat experienced (at least 6mos). I've been using Smalltalk for a little over a year, and am quite a bit more productive than I am with Java (3mos use), C (4 years, on and off), and C++ (2 years).
For one, there are simply not the same amount and magnitude of "gotchas" as the above listed languages/systems.
Frankly, I see C++ as mostly worthless, especially as an application's level language. The STL and other libraries don't let you escape from C++ and it's many annoyances, they just complicate things. I'd much rather be using Smalltalk (or another high-level language like Common Lisp, Ruby, Python) and writing extensions in C when neccesary.
In most Smalltalks and Lisps, there is a call-out interface, such that lib-extensions like those found in Perl, Python, and Ruby don't have to be written. You just tell the system the function signature and the name of the library.
You don't need a 1+GHz machine to run a Smalltalk system for development, or to run a Smalltalk-based app. You're too used to Java, which is still largely impractical for real-world apps.
GUI builders have been a part of Smalltalk for a while. Don't know a date though. Check out Dolphin Smalltalk for an implementation tightly integrated with Windows.
As far as there not being a place in the world for Smalltalk- bah. If you don't want to use it, don't. But please don't spread misinformation because your 20 minutes worth of experience was confusing. I understand some people are set in their ways, and prefer the way they've been doing for years- a contrived, BCPL-based syntax, and a very static, compilation based way of life. That's fine- but I'll continue using Smalltalk and getting my stuff done.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Re:Why learn another language?
by
BeBoxer
·
· Score: 2
I noticed this too. I'm curious what schools are pursuing this type of curriculum. When I was in school, it seemed like I was learning a new language for every class. Whatever language was most apropos was (usually) used. Freshman year Intro class? Pascal. Artificial Intelligence? Lisp. Operating Systems? C++ (that's a little odd, I admit.) Embedded Systems? 68K Assembly. Numerical Analysys? Mathmatica. The default of course was good old C, which I ended up doing a fair amount of.
Re:Why learn another language?
by
denshi
·
· Score: 1
OTOH, syntax *can* change semantics, and at the very least a difference in syntax can highlight particular semantics for a user. Ruby OO features may be almost entirely incorporated into Python and Perl, but Ruby's better syntax for these features can make it a better language to teach these in. IMOH, that assertion is true - it is easier to be fully OO in Ruby than in Py/Pl.
Some other semantic structures that *aren't* in Py/Pl are Smalltalk-like messaging, Sather iterators, metaclasses, blocks and closures (which will be supported in the next Python, sort of supported in current Perls), blah, blah, etc. It's fun! As an aside on the internals, the Ruby GC is a non-compacting generational GC whereas Python & Perl still do reference counting. I have a lot of hope for good code speed in Ruby as it matures.
It was indeed a joke. But I've also heard discussion on the Ruby list that sounded serious about it. And nobody piped up to deny it. So, perhaps, the joke is turning serious.
--
I think we've pushed this "anyone can grow up to be president" thing too far.
Test?
by
Anonymous Coward
·
· Score: 0
You fail.
Haha, good one. +5 Funny. (-)
by
Anonymous Coward
·
· Score: 0
nt
Re:Why learn another language?
by
RevAaron
·
· Score: 3, Insightful
That is, for the most part true, but there are languages that make it difficult and some that make it easy. For me, no matter how much I am forced to use it in school, C++ is still a lot harder to express ideas (especially well-designed OO ones) than some of the other languages I know. This is for a lot of reasons, from syntax to manual memory management. Now, it's not that what I want to do is impossible in C++, but there's a lot more crap I have to think about and deal with to get the same basic stuff done.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Re:Lots o' languages
by
Anonymous Coward
·
· Score: 0
Interesting then that both Ruby and Python carry along a current version of the Tcl interpreter for use with their repective Tk modules.
Re:Strict vs. hacked languages (THIS IS A RANT)
by
Peaker
·
· Score: 1
Are you kidding? Object foo knowing how to bar itself is quintessential OO. Then you can have object foo2 knowing how to bar itself, or if they're derived from the same superclass & bar can be abstracted a level, move bar up to the superclass. In smalltalk to print an integer, you'd do:
(5 + 4) printNl!
5+4 evaluates to an Integer object 9, which then prints itself. If object foo knows how to Stringize itself, then foo2 also does!
print (5+4)
and its not that 'print' itself knows how to handle various objects, it merely calls the object's __str__ method, which is clearly polymorphic.
Making a (to the user) generic print function to which you pass a string/integer/character may be passing around objects internally, but if you do that (as in the snipped of python you post) the language might as well be procedural from the user's point of view - the benefits of OO were used in language design, but are lost during the actual language use. The only 'advantage lost' is the syntatic sugar of using:
OBJECT-IDENTIFIER . FUNCTION-IDENTIFIER (Extra Parameters)
rather than:
FUNCTION-IDENTIFIER ( OBJECT-IDENTFIER, Extra Parameters)
This is an issue in Python (And Smalltalk).
The reason I said its not very OO'ish for an object to know how to print itself, because an object should not implement EVERY specific feature anyone might have thought of.
Do you think every object should implement a 'describe vocally' method, so that you could: '(5+4) say' too?
What about '(5+4) encrypt' or '(5+4) encodeMp3Sample'?
If you simply remove the difference between the notaitons:
f(a,b)
and:
a.f(b)
as it is in LISP, you get the consistency and the power.
However, it makes it a bit harder to find the list of available methods (which can be resolved easily).
Anyhow, Python allows you to:
object.print = my_print
so it can print itself:P
But the generic print is more OO'ish, because an object should have a minimal set of things it can do, one of them is represent its state as a string. In Python, another is returning a state object describing the state uniquely, in a way that can be reconstructed.
Re:Strict languages vs. hacked languages
by
Anonymous Coward
·
· Score: 0
Brainfuck, yet another great contribution to the world of computer science originating on the Amiga.
If we're lucky Amiga OS4 will include a brainfuck compiler in the final release.
Not for pythoners
by
Anonymous Coward
·
· Score: 0
It seems that Ruby is a lot closer to Perl than to Python. I can't see why a Python addict would change to Ruby.
Re:Not for pythoners
by
Anonymous Coward
·
· Score: 0
Becuase Ruby is the new trendy language, if you're using python you obviously are someone who beleives every "Advocate" and adopts the stupid pet project of wanna be language designers like guido.
Sorry the Python bandwagon didn't last longer, but it's time for you trendiods to switch to the Next Big Thing.
For some wierd reason i just keep writing loads of useful code in perl, despite is being totally sucky. I know i should stop coding and site around learning the latest trendy stuff, but like i got all caught up in actually accomplishing something. oh well those things happen i guess.
Glad I changed from a CS major
by
El_Nofx
·
· Score: 1
Wow, ok so now besides having to take classes on Cobal, Java, C, C++, Pearl, Python, and Assembly I would of had to learn this one now. That makes me glad I changed my Major to Computer Engineering.
-- It's not the OS it's the user that sucks. If it's user friendly, you get stupider people. - clinko
Re:Glad I changed from a CS major
by
geomcbay
·
· Score: 2
Cobal? Pearl?
"would of had"?
Lucky thing you didn't change majors to English or research/journalism.
Anyway, the computer software field will be better off without you. CS isn't about learning specific languages; it is about learning universal concepts. Specific languages are a dime a dozen and anyone who bothers to learn the basics correctly can pick up a new language in a matter of days.
Re:Glad I changed from a CS major
by
Anonymous Coward
·
· Score: 0
i like programming
Re:Glad I changed from a CS major
by
Anonymous Coward
·
· Score: 0
Computer Science isn't about learning a bunch of trendy languages (java, Python, Ruby).
Either your schools sucks, or you're a moron.
Could be both i suppose...
Re:Glad I changed from a CS major
by
Anonymous Coward
·
· Score: 0
"Java, C, C++, Pearl, Python, and Assembly"
Well, you should glance once or twice more at that "pearl" book.
Re:Strict languages vs. hacked languages
by
RevAaron
·
· Score: 2
Never underestimate the power of backwards compatibility. It worked for C++, and it worked for WinDOS.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Re:RUBY=SUCKS
by
Anonymous Coward
·
· Score: 0
> Um, show me another language that features attributes.
C++ with Qt.
Check out this translated Japanese Ruby guide
by
Mubarmij
·
· Score: 1
This article is a good introduction, as advertised. The The Pragmatic Programmers Ruby Guide is an excellent book on Ruby as well.. but for a really nice book on Ruby, go to Ruby User's Guide. It is a translated book from Japanese, and since the Japanese had Ruby 7 years before we even heard about it, it out to be good.
I don't like ruby mabey it's because of the name or that i like perl and python and C++ but for some reason it just seems lame to me that some language can just like say it's as good if not better then ALL thouse.. i think that with perl python php sh and C++ you can get really anything done ^_^ so why have another langauge? besides i'm already learning 3 right now! =]
-- If i was you, you'd be me and we wouldn't be having this conversation
Yeah collecting languages is like collecting rocks
by
ahfoo
·
· Score: 1
I used to have great respect for people who could speak multiple languages --I'm off topic here talking about language in general rather than programming in specific. I've got a little anecdote though and I'd like to share it.
I moved to Asia from California in my early twenties looking for fame and fotrune and sleazy discos. In the latter, I met all these cute asian babes who could speak three or four languages on average. As an American I was so impressed by this. I assumed these lurid disco dollies were really on the ball. Over time, I realized how far from the mark I was and how totally disconnected language skills and intelligence were.
I knew girls who were raped and beaten repeatedly and I made the mistake of trying to step in and act all righteous like an American boy thinks he oughtta, but boy did I find out the hard way that my assistance was not welcomed and even led to hostility from the victims themselves even when they had come to me crying and asking for help.
Fair enough, I learned a bit about the real world and how to detatch myself from other people's affairs --even the cute ones asking for help. I also learned that the ability to memorize languages is not an indicator of intelligence as I understand the term.
Having said this, I'm very proud of my own Chinese and English literary skills and I consider myself a sophisticated programmer although I wouldn't know C code from a chemistry formula.
It goes back to the phrase "to be well read." You know the deal, you can read three books and be well read; wheras you can read variations on the same trash all your life and never make the grade.
Re:Okay, it looks simple enough..
by
Anonymous Coward
·
· Score: 0
It's new and trendy.
Re:Amen of sorts.
by
Anonymous Coward
·
· Score: 0
Just for the record, SQL isn't a programming language, and doesn't really apply to this discussion.
Sure it has operators, but it's a query language (that's the QL) and you can't actually do any programming in it.
PL/SQL (Oracle) and PL/pgSQL (Postgres) are a different story, though...
Re:Java has won? Evidence to the contrary.
by
RevAaron
·
· Score: 2
Perhaps more demand, but when your supply is huge, more than needed, that higher demand is worthless. Smalltalk is far from as popular as Java, and there definately aren't as many Smalltalk jobs out there. But there also aren't as many Smalltalkers- so it's definately not impossible to get a job doing Smalltalk. Incidentally, Smalltalkers tend to make more money than Java and C++ coders, which are a dime a dozen now-a-days.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Python doesnt have an icon of its own yet... Neither does PHP...
I think the reason perl has its own/. logo is because Taco and company code in perl
...although that doesnt explain the java logo
-- No sig for the moment.
Re:Strict languages vs. hacked languages
by
frleong
·
· Score: 1
Hey, you are using the wrong association. Stability does not guarantee popularity (besides, Linux is still playing catchup), but productivity can. I don't think I am more productive using Linux instead of Windows, especially with desktop apps, despite that the latter crashes more. Smalltalk came before C, yet didn't grow up as much - if you don't think productivity is an issue, please tell me the reasons behind of SmallTalk's failure (bad luck doesn't count).
I have to say that Ruby really DOES have a "BASIC odor" to it, but this is merely a superficial similarity in the "feel" of the language, rather than a meaningful statement. Ruby does indeed bring to mind my first QBASIC programs, but i am sure that it is a much more elegant and sofisticated language. (not that BASIC Wasn't elegant...;-D)
Re:Strict languages vs. hacked languages
by
RevAaron
·
· Score: 2
Oops, my mistake and apologies.
However, I mispelt Smalltalk as "Smalltlak," which is a typo, and would be taken as such by a member of the Smalltalk community. When you mispelled it, it was as SmallTalk, often taken as a sign of ignorance, rather than a simply typo. Why is that? The "proper" way is Smalltalk, but it's pretty usual for people that don't know what they're talking about, who have maybe only read about St on/. will spell it SmallTalk. No one knows why.
So, if it was a typo, my apologies, but that is my reasoning.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Re:Strict languages vs. hacked languages
by
Anonymous Coward
·
· Score: 0
ok now you're just making stuff up. There's a nice command line example packaged with gnu smalltalk & its very clean.
Re:Why learn another language?
by
Anonymous+Brave+Guy
·
· Score: 2, Insightful
The simple fact of the matter is, if you know one language, you know them all.
I was about to object to that, but then you wrote...
Unless you are making the jump from procedural to OOP, or OOP to Functional for the first time, you *CAN* pick up a book and learn a new language in a days time. The only thing stopping you is yourself.
Thank you for being one of the few to acknowledge that while languages using similar ideas may be easy to learn once you know the first, languages using fundamentally different approaches might take some effort! Sadly few people seem to realise this.
Having said that, I'm afraid I have to disagree with your "one day" as well. You can learn a new syntax in one day, sure. But how long does it take to learn the new idioms? Java and C++ have similar syntax, but Java uses a GC and finally for resource management, while C++ has predictable destruction and uses the abysmally-named-but-rather-neat "resource acquisition is initialisation" idiom. Anyone working seriously in these languages needs to appreciate this distinction, but it's not written down in (m)any of the books.
-- If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Re: Forget it...
by
Anonymous Coward
·
· Score: 0
Unfortunatly you're correct. Their perl-centric mentality is going to keep python/ruby/php icons from appearing here anytime soon.
I can understand not wanting to make a topic icon for every programing language out there (forth, pike, etc.) but after a certain number of postings (4 or so) I think that it would be in everyones best intrest.
Don't hold your breath though...
Re:Strict languages vs. hacked languages
by
flippety_gibbet
·
· Score: 1, Funny
> and Ruby/Python/Perl all seem to me to have a BASIC odor to them; >> Now you are really grasping. That claim isn't even solid enough to refute
I decided to conduct a test. I fired up the visual basic development enviornment.
I sniffed around the keyboard mouse and the system itself. Then I fired up PythonWin and did the same.
I can report that the odor was in fact identical.
My conclusion: never judge a programming languange on smell alone.
-- <-- You are here.
Re:Strict languages vs. hacked languages
by
Jonathan
·
· Score: 3, Insightful
And how deep is Ruby's Unicode support? If you can please point me to documentation on using Ruby's regexp engine to match Unicode characters, I would appreciate it.
Here you have an issue of implementation, not design, but at present a legitimate issue. Ruby is a product of Japan, and ironically, from the perspective of Westerners, who generally see Unicode as a sort of peace offering to Asians to make up for the dark ages of ASCII, the Japanese hate Unicode and prefer their own multibyte solution. So, the status of Unicode in Ruby is somewhat primitive at present. However, as Ruby was designed with multibyte characters in mind, it should be much easier to improve the Unicode support than in other languages.
Re:Strict languages vs. hacked languages
by
RevAaron
·
· Score: 2
Go ahead, mod me down. You're still an idiot.
Man, don't be so bitter- it's just Slashdot.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
I think this said it all...
by
BlackHat
·
· Score: 1
...which is the same functionality Perl uses. You said it not me, bub!
Re:I think this said it all...
by
jvollmer
·
· Score: 1
'Tis little I could care for Perl
who owns the ample C
or brooches - when the emperor
With Ruby pelteth me.
I couldn't resist (and Dickinson will forgive me!)
Re:Don't judge ruby based on the article
by
RevAaron
·
· Score: 2
If Python was the result of Lisp and C++ having a baby, Ruby is the result of Perl and Smalltalk having a baby.
Which is funny, as Smalltalk itself is really a child of a Lisp mommy getting some unknown, alien artificial insemination. Some put Smalltalk in the LISP family of languages, but those who don't just avoid classifying it. Fascinating, it's family tree.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
In the words of Henry David Thoreau. . .
by
kfg
·
· Score: 1
$Simplify = $Simplify * 3
KFG
Re:Why learn another language?
by
Anonymous Coward
·
· Score: 0
Let's try mastering the English language first, please.
Re:missing the point
by
RevAaron
·
· Score: 2, Insightful
Have you ever considered that maybe these languages ARE the evolution of Lisp and Smalltalk? With all due respect to Lisp and Smalltalk, their creators didn't have the benefit of Lisp and Smalltalk when creating their languages.
I would definately agree that it's evolution, however, it's not a controlled evolution pointed forwards, like the evolutions that created Lisp and Smalltalk.
Python, Ruby, and others are adaptations of Lisp and Smalltalk to a way of thinking that people used to C and Unix can handle. Smalltalk and Lisp are too advanced and forward thinking that languages like Python and Ruby have to take a forced step backwards to accomodate those who cannot advance. It's kind of sad in a way, but I suppose it's still a step in the right direction, as there's a better chance of converting C++, Java and Perl people to Ruby than converting them to Smalltalk or Lisp, unfortunately. Better part way than none!
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Re:Strict languages vs. hacked languages
by
RevAaron
·
· Score: 2
I'm wondering if people are afraid to learn a new way of speaking?
You bet they are! Ruby, Perl and Python are putting in terms of a contrived BCPL derived syntax Lisp and Smalltalk. They don't quite embody the semantics fully (Ruby seems about the closest), but as people are too lazy to learn a fully new way, they have to give people training syntactical wheels.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
You might want to check out FORTH
by
cbr372
·
· Score: 1
It's the perfect middle ground between C and Assembly. Check it out.
-- Cedric Balthazar Rotherwood Sun Certified Programmer for the Java Platform +
System Admin. for Solaris
Re:Strict languages vs. hacked languages
by
RevAaron
·
· Score: 2
If Ruby were clearly the next level, you'd be right. But Ruby has as many weaknesses relative to Python as it has strengths
No, the next level isn't Ruby. It's Smalltalk. It's Lisp. That's the point your post's parent is saying- if you can move from Perl to Python, why not go all the way to the source, to the acme of elegance and simplicity- Smalltalk or Lisp?
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Re:Strict languages vs. hacked languages
by
RevAaron
·
· Score: 2
It is simply a matter of historical fact that Python was not based upon C++. If it shares features with C++, those would probably be traced back to Simula through Modula-3. Smalltalk is also based upon Simula.
No, Smalltalk borrowed ideas from Simula. Other than the idea of classes, Smalltalk derived very little else from Simula. Most everything else came from Lisp.
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Re:Strict languages vs. hacked languages
by
RevAaron
·
· Score: 2
Oh no! I've been writing scripts in Smalltalk! I should've been Ruby, it's "script-world equivalent" all along!
That's bunk. There's nothing other than what is "acceptable usage" in a coder's mind that makes something a "normal" or "scripting" language. Smalltalk is equpped with the tools to build large systems more so than most scripting languages like Perl, Ruby, and Python- but out of the box, I'd say it's also more equipped than C++ and Java.:)
--
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
You Faggot
by
Anonymous Coward
·
· Score: 0
Lick my ass
Re:Strict languages vs. hacked languages
by
Anonymous Coward
·
· Score: 0
I'm sure what you said is true; I'm biased against Python for the (of course) whitespace reason and admit I don't know much about it other than from the few times I've started to learn Python, but I think my brain refuses to retain a programming language that has weak typing but has strict whitespace rules. So I'm too unfamiliar with the language to make the statement that you were responding to. thanks for the reality check.
wimps
by
Anonymous Coward
·
· Score: 0
Ruby, Perl, Python, Tcl, C, C++, C#, Java, Smalltalk, Ada, Cobol, PL/I, Algol, Fortran, Forth, Basic, Lisp, PHP, even Assembly language are all for wimps! REAL programmers use "cat > myprog; chmod 700 myprog"
There seems to be something about schools that systematically damps down any enthusiasm for any subject. I'm really glad that programming doesn't feel much like math to me. I used to be enthusiastic about math, but a few years as a math major killed that. Now I avoid it to the extent possible. But programming doesn't feel like math (to me), so I've got a decent job that doesn't feel bad.
If you don't feel enthusiastic about something, then it can feel like an imposition to be required to learn something different. It doesn't much matter what. And a new language certainly can qualify.
OTOH, languages certainly do run in tides. There don't seem to be any decent books right now on "Data Structures and Algorithms the C++ way" that aren't primarilly texts. Now I'm trying to switch over to C++ after using a raft of different languages, so most of the introductory books get insufferably dull. I don't want to work through all the drill. Been there, done that. I want a guide on picking things up fast. The best book that I've found so far is "Data Structures, a PseudoCode approach with C++". It isn't really designed as a reference book either, but at least it doesn't stop in the middle of an algorithm and say "the rest is left as an exercise for the student". So I may be able to get my AVL tree working and tested by Monday. (Then I need to decide whether to switch the code over to Eiffel, or recode the Eiffel a bunch of Eiffel in C++... or experiment with trying to link the two in a manner not covered by the C++ standard, and quite compiler specific in Eiffel.)
So using lots of languages has its drawbacks, too.
--
I think we've pushed this "anyone can grow up to be president" thing too far.
Check the lenses in your glasses, and look at this page. Guess what? I see a logo for.. is it is it.. PHP!!
Now as for Python.... snake pictures anyone?
Java - Java is a lot more than a programming language, it's a whole omlette of things: language, a VM, a secure run-time environment, a server environment, a micro-device env, etc. Hence, it gets its own logo.
-- The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
Re:Why learn another language?
by
fgp
·
· Score: 1
Wow... long post... but it IMHO
CORRECT IN EVERY LITTLE DETAIL...
A serious programmer should always be interested in some new paradigm/language/tool/os/...
Only partly because he will actually USE it on a project, but to learn new things, and see variuous ways to solve problems...
Maybe you will never cody any real-work-application in LISP - but functional programming has areas where is really shines - and learning LISP (as well as learning Ruby/Phyton/Perl/C++/Smalltalk/Objective-C/....) makes you a better programmer.
Java has won? Evidence to the contrary.
by
gnugeekus
·
· Score: 1
A business to business ecommerce firm that I worked for recently went out of business. I was a Perl programmer there. The only one. The rest of the coders were java coders. Good java coders, too. Our company released the first complete implementation of Sun's JDO specification while I worked there, among other things.
I was working again within two weeks of being laid off as a systems programmer in a very large well known corporation. Most of the java people I knew are still looking for jobs.
I ate lunch with a recruiter friend of mine last week and mentioned to him that I knew some good java programmers who were looking for work. He groaned and said "please, no more java programmers. There's a huge supply of them right now, they are all losing their jobs, and nobody wants them anymore now that the dot coms are mostly dead. If you know any Unix / C / Perl people though, let me know. I always need them and good ones aren't easy to find".
Java hasn't "won" anything. Java has had a lot of money in advertising spent to convince pointy haired bosses that it is the wave of the future. There was briefly a huge demand for Java coders as the dot coms hit their boomtime. Business to business e-commerce was the "wave of the future" and Java was the language of that future.
Now even the large successful business to business companies that already had clients are struggling. The small ones are all dead or dying. There is a huge oversupply of Java coders who learned Java from a Learn Java In 21 Days book to take advantage of the boomtime, and the good Java programmers are getting lost in the flood. The word "Java" leaves a bad taste in many people's mouths, as it is now associated with the failure that was the web economy.
The tech market will slowly pick back up. Java will find a permanent niche and be used for a good time to come. However, its not all the rage anymore. Its just another language, useful for some things, not so useful for others.
Get over yourself buddy. The Java coder as king of the world, sucking down his $5.00 starbucks coffee at the foozball table in the office recroom days are over.
Please: "its goofy syntax" next time, so that yours is not such an eyesore.
No
The context was about "Perl's goofy syntax", so the poster's use of the possessive apostrophe is correct. He's talking about the goofy syntax that belongs to perl, see?
Eyesore my arse....That's why he gets 3 points - and you don't get any.
-- I don't think I'm very happy. I always fall asleep to the sound of my own screams.
Re:Lots o' languages
by
Anonymous Coward
·
· Score: 0
wow.. ppl have horrible memories..
those were an april fool's joke..
parrot is a *JOKE*..
joke as in "funny, haha, haha, we didn't mean it"..
that's not happening..
baka..
Re:Strict languages vs. hacked languages
by
Anonymous Coward
·
· Score: 0
Interesting. Can one of you Ruby or Python elmers tell me if its possible to, say, have the user input an arbitrary snippet of code at runtime
return (foo + bar)
and have the body of the multiplication operator be replaced with this, making it now an addition operator?
Re:Why learn another language?
by
zephc
·
· Score: 1
Exactly...changing programming concepts is the hard part, syntax is just, well, syntax. Once you learn those parts, its all a nice downhill ride.
--
"I would say that 99 per cent of what my father has written about his own life is false." - L. Ron Hubbard Jr.
Re:ick
by
Anonymous Coward
·
· Score: 0
Duh, there is actually a *gasp* reason to use $ or @ at the beginning! But since it doens't look snazy it should be removed immediatly. As long as it looks nifty, thats the important part.
So they ripped it off?!!?!
by
Anonymous Coward
·
· Score: 0
OOOOhhhh!! So Ruby is very similar to Python? Call the fucking LANGUAGE POLICE! Microsoft are trying to do this as well with C# man!! (copying Java and all that)... This should be ILLEGAL for FUCKS SAKE!!
Quick! Before this Ruby thing takes off lets come up with 50283 ways to stop it!! We'll make an OPEN SOURCE version.. yeah!! that's what we'll do !!!
Time for an icon....
by
jeffy124
·
· Score: 3, Insightful
I think it's time for Slashdot to draw up an icon for Ruby topics. This story is about the 5th maybe 6th Ruby related item to appear on/. in the past few months. A simple picture of a good red-ruby you would find in a jewelery store would do fine, such as one of these. Anyone for it? Against it? Got a better pic to use?
-- The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
There's an (official?) icon at
http://www.rubycentral.com/.
So
by
Anonymous Coward
·
· Score: 0
So is ruby gonna replace python as the the leading baby language for teenage losers and assorted other wannabe coders?
Re:So
by
Anonymous Coward
·
· Score: 0
Nah, perl is the one experienced programmers and sysadmins who actually have work to do use.
Re:So
by
Anonymous Coward
·
· Score: 0
Heh. Gotta stop that cognitive dissonance, huh? Whatever gets you through the night, it's alright, alright.
missing the point
by
mj6798
·
· Score: 3, Insightful
If Python was the result of Lisp and C++ having a baby, Ruby is the result of Perl and Smalltalk having a baby.
The key features of Lisp are the use of a uniform notation for programs and data, a notation that makes it very easy to write syntactic extensions, and full support for functional programming. Python 2.1 now has some limited support for lexical closures, but users almost never extend its syntax. The key feature of Smalltalk is its programming environment. As a language, Smalltalk's main feature is the use of very descriptive method and argument names. Neither of those is shared by Ruby.
Python, Perl, and Ruby are nifty little scripting languages, but don't think for a moment that if you are using them you are using the next generation of Lisp or Smalltalk. The object models of Python, Perl, and Ruby are general but slow and memory intensive, their programming environments are oriented towards scripting, not large system development, and compilation to native code, when it exists at all, is of limited benefit. If the scripting languages ever evolve into something like Lisp or Smalltalk, their object models, syntax, and semantics will have to change dramatically and incompatibly.
Name a single feature in C# that hasn't appeared in at least 3 languages prior to it.
Um, show me another language that features attributes.
As far as I know, C# is the first to have them.
Re:Strict languages vs. hacked languages
by
harryo
·
· Score: 1
This is precisely the kind of thing I've been doing in Ruby. That's what I was getting at when I said it was dynamic.
It's possible to re-define a class, function, method, etc. at run-time, as often as you'd like.
The thing about Ruby is that, while it looks a lot
like languages people are often used to, it has
"stolen" these sorts of things from other languages.
I think, basically, Matz is a pragmatist. He's
taken everything that other people seem to have
gotten right and put them all together... he's
not finished yet, of course:-).
Interestingly, it looks like Python is going the
same way. Every time someone mentions something
nice from Ruby, someone from the Python community
jumps in and says "that's planned for the next
version".
That's definitely not intended as a "we got it
right and everyone else is following us" comment.
What I mean is that both languages are moving
closer together. I believe the next version of perl will have some of these things, too.
I say, play with as many languages as you can
and choose one that you feel comfortable and
productive with.
While I, personally, hate perl's "line noise",
I say if you're happy with that and you get work
done, use it. I also say, however, that you should
never pick one language and just stop there.
I think that in, say, 20 years, very likely none
of us will still be writing in any of the languages
we currently love. Of course, C is still around after more than that, but very few people still
write in pure C.
If we didn't create and experiment with new languages we'd all still be writing assembler or
fortran or cobol.
Re:Strict languages vs. hacked languages
by
Anonymous+Brave+Guy
·
· Score: 1
One could call C++ hacked - it's "features on top of features". But than- it's the most widely use language, so I guess it _MUST_ have is strengts...
C++ is almost nothing else but a huge hack. It's only strength over other languages is backwards compatibility of a way of thinking with C. Nothing more.
Now where's that (Score: -1, Just Plain Wrong) option someone suggested?
Certainly C++ suffers from it's hacky nature. But to claim that it offers no other strengths over other languages is absurd. If it didn't, it wouldn't have so many users.
-- If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Amen of sorts.
by
Anonymous Coward
·
· Score: 0
Having zero experience with either, I picked up SQL (Specifically, working with Postgres) and Perl in a matter of days.
Syntax was the hard part though.:) But, this is because of my experience with other languages. While I'm more of an evil system administrator than a coder, and a good deal of people could put my code to shame (:p), I've got a pretty decent grasp of programming concepts. So all that was left was figuring out where to put semicolons and such.
One thing to note though, true, even if you don't think you will use the language, you're still gaining some benefit. The real benefit is if one day, you *are* required to use the language - in that case, you've played around with it a bit, and can pick the syntax back up with minimal effort.
Besides, there's also the, "My genetalia is bigger than yours!" factor of being able to list a dozen or so languages you know.;P
Re:Didn't they call this Astroturfing a while back
by
Anonymous Coward
·
· Score: 0
Woah, what's this? Some one with a brain? Independant thought? Critical thinking?
Take that shit elsewhere buddy. Here at Slashdot we wanna be told what's "hot" with geeks in the now...
Similiar to Old Navy telling the masses what style they "gotta get this summer", Slashdot tells the geeks what they need to be useing and talking about this summer to be considered "in the know"!
Take your free thought shit elsewhere! j00 sux0rz!
Re:Lots o' languages
by
tEbIng
·
· Score: 2, Informative
This thread on the python-dev mailing list talks about the unification project (code-named "Parrot":)
Re:Strict languages vs. hacked languages
by
Fruit
·
· Score: 1
It seems "hack"-like features are defined as "things that could have been done in a library but ended up as part as the syntax instead".
For example, where Ruby has a * operator for strings and perl has the x operator which does essentially the same, PHP (also a very string oriented language) uses str_repeat().
As far as my recollection of Smalltalk goes, it has one of the most elegant and simple syntaxes I know. What exactly are the hack-like features of Smalltalk, in your opinion?
Didn't they call this Astroturfing a while back?
by
Anonymous Coward
·
· Score: 0, Interesting
I can see little in Ruby to justify the people banging the drums in support of. It is an OK language. Not that different from Python and Perl. Aside from people throwing out oooh and ahhhh buzzwords that most people just parrot from their programming languages classes and do not really even understand, it just doesn't offer anything drastically different from what is already out there in the other scripting languages. You want to learn something totally different, try something different like functional languages or logic programming languages. Putting more tools in your kit and learning more languages is great. Just stop shoving them down our throats.
Just make what are hopefully intelligent observations about the languages instead of "Use this one because the other ones suck... And you suck too if you use them. People bemoan BASIC because of the monstrosties that people used to code in BASIC. So what. You can code crap in any language. BASIC was developed for-- get this, its important-- NON-programmers.
I do feel like there are people out there that are trying to promote Ruby over everything else just like the Gnome proponents act like they are getting a commission on every convert they get to switch to Gnome. Along with these, we have the people that say all Microsoft stuff is bad. Yeah, I don't like a lot of their software but show me a program (from any source) that can compete head to head with Excel and I will be impressed.
Yes, that was a troll. That is what these promoters sound like as well but they are using the authorized troll buzzwords. Listen to all the opinions but take them with the grain of salt they deserve.
Re:Strict languages vs. hacked languages
by
Peaker
·
· Score: 3, Insightful
I agree Ruby and Perl seem to be like the latter type.
Python, however, is a truly clean, well-designed, quite-pure, strong-typed language.
I wouldn't say it has a Basic odor at all, besides for a built-in 'print', perhaps:)
Basic is braindead and has no library - instead, it has its entire library built into its syntax in a horrid way.
Python is the exact opposite - many many libraries separated into modular modules, with only flow constructs, OO organization, functions and exception handling built in.
The best tool for the job isn't always the one the developer is most familiar with. There are many things I would rather develop with Perl over C, even though I've only been using it heavily for two years. I've been a C programmer of the almost-every-day sort for two years short of a decade now.
Us younger programmers who are blessed with languages that are more articulate allow us to see the big picture sooner, and more clearly.
You know, lots of scripting languages are fun and all (TCL, Perl, Python, etc) except for one thing: They each need their own interpreter. So if I have 5 programs that people have written, each in a different scripting language, I need all 5 interperters installed. This is especially annoying on a system with limited resources. Unfortunately, I can't think of a good way to fix this problem. So I guess we will just have to get by with it...
Maybe I'm just jaded, but I don't see what the use of a language is these days without a good DB connectivity library. Did I miss it in the FAQ or the Reference Manual?
Re:Strict languages vs. hacked languages
by
FFFish
·
· Score: 3, Insightful
FWIW, within a week you'll learn to love whitespace. Yes, it imposes a visual "order" to your code. You'll soon appreciate the consistency: you can look at other code and immediately make sense of it, without having to mentally adjust for the other programmer's weird habits.
--
--
Don't like it? Respond with words, not karma.
Re:Strict languages vs. hacked languages
by
smallpaul
·
· Score: 5, Interesting
I notice strong distinctions between those languages that have been developed by actual programming language researchers and those who hack together a language to scratch an itch.
"Actual programming language researchers" are typically not even interested in designing languages for general purpose use. Often they are just trying to explore a particular idea of aspect of programming.
Usually the latter turns out to be some baroque conglomeration of features piled on features, creating a very top heavy feeling to the language, while the former classification languages all have a purity to them, e.g. smalltalk, lisp, and c.
I think you're going to have to define your terms if you want to make this point. How were Kernighan and Richie programming language researchers but not Van Rossum and Wall? By now, the latter two have spent about ten years of their lives thinking about almost nothing other than programming languages.
Some would defend the "hack languages" as a means to Rapid Application Development, but Smalltalk has been shown to be the most productive language,
Could you provide a reference to back up that claim? I'd like to see evidence that Smalltalk fares well at system administration or text processing.
and Ruby/Python/Perl all seem to me to have a BASIC odor to them;
Now you are really grasping. That claim isn't even solid enough to refute.
...I'm wondering if people are afraid to learn a new way of speaking?
I don't know...are you? If you are into purity and elegance, I would suggest you give either Python or Ruby a real try. There are many Lisp fans that like both and Ruby is especially popular amoung Smalltalk users.
When you say all the entries fail, it would
appear that they're all versions of the same
program (ie, just iterative attempts to improve its performance).
A much more important thing in this kind of
competition is whether the programmer can handle
the problem. The fact that one person who decided
to write it in Ruby didn't get it 100% (and some
of them did reasonably well), doesn't mean the
programming language is broken.
He/she obviously put a fair bit of time into it
(I presume, from the number of entries), but they
may simply have not had the right background for
that specific task.
I just wish everyone who's posting messages like
"why do we need another language" would
download Ruby and have a go. Surely, that must
have been what people said about C++, perl, java,
python at one point.
After doing so, I then wish that if they liked or
didn't like it, they'd give specific reasons, rather
than wishy-washy ones. You might be surprised by how receptive the developer is to suggestions for
improvements to Ruby.
That way, even if the person who tried Ruby and
didn't like it never ended up using it, the Ruby
community could still gain something.
Re:Okay, it looks simple enough..
by
eggnet
·
· Score: 1
Not that it matters, but python supports string multiplication also.
Don't judge ruby based on the article
by
MeowMeow+Jones
·
· Score: 5, Interesting
There's nothing wrong with it, it just doesn't get into any of the crazy stuff that makes ruby ruby. So wait until the other parts come out or check out the Pragmatic Programmers Guide.
If Python was the result of Lisp and C++ having a baby, Ruby is the result of Perl and Smalltalk having a baby.
Strict languages vs. hacked languages
by
Anonymous Coward
·
· Score: 4, Interesting
I notice strong distinctions between those languages that have been developed by actual programming language researchers and those who hack together a language to scratch an itch.
Usually the latter turns out to be some baroque conglomeration of features piled on features, creating a very top heavy feeling to the language, while the former classification languages all have a purity to them, e.g. smalltalk, lisp, and c.
Some would defend the "hack languages" as a means to Rapid Application Development, but Smalltalk has been shown to be the most productive language, and Ruby/Python/Perl all seem to me to have a BASIC odor to them; I'm wondering if people are afraid to learn a new way of speaking?
Re:Strict languages vs. hacked languages
by
FFFish
·
· Score: 2
You are undoubtedly already using some sort of indentation scheme already: if you're programming anything beyond a one-liner, it's almost imperative to impose some sort of visual order on your code, just to help segregate the code "chunks" into meta-levels.
In which case, you're already being a pretty-printer.
Get over it already. Python is using something that you're already doing: it's just formalized it.
--
--
Don't like it? Respond with words, not karma.
Re:Strict languages vs. hacked languages
by
Anonymous Coward
·
· Score: 0
What's wrong with Smalltalk being "the next level"?
Re:Strict languages vs. hacked languages
by
frleong
·
· Score: 1
1st quote:
Why didn't Smalltlak take off? There are a lot of reasons, including:
2nd quote:
Not being able to spell the language's name correctly is a sign you've never actually had any experience with it.
I spelled correctly Smalltalk in the first sentence. It was just my habit of capitalizing symbols that led me make that mistake. Try to infer something like that from your own typo.
Yes, there is DB access
by
JimWeirich
·
· Score: 4, Informative
There is a DBI module at http://www.ruby-projects.org/dbi/ . There are also a number of DB specific modules. See the Ruby Application Archive ( http://www.ruby-lang.org/en/raa.html ) for a list of other software modules that are available for Ruby.
Why learn another language?
by
Dalroth
·
· Score: 5, Informative
Well, I see a lot of people complaining as usual... Why should they learn another language? So I thought I would throw in my $0.02 for all a languages (not just Ruby, which I am particularly fond of).
A lot of you people come from what I call the Computer Science Student mentality. This unfortunately something I've noticed as a side effect of the way computer science is taught in most schools. It's quite unfortunate, because that clearly isn't the aim of the Professor's when they are teaching classes this way.
I'll use my school as an example. When I started at the University of Dayton, about 7 years ago, every class was taught in ADA. It was a horrible horrible expierence. The ADA compilers were horribly lacking at the time, and anybody who has done any work in ADA will know that it is an extremely strict and picky language. That has it's good and bad sides when it comes to teaching programming, but I'll save that for a different discussion. I had no problems, since, well, I had a good solid 4 years for Pascal and C/C++ programming experience before I even started college, but this seriously affected the other students in my class.
The problem was, about two years into the program, my school decided (thank god) to switch the department over to C++. This was a great move, because now the students were being taught a language that they could actually apply in the real world (beyond the confines of the Wright Patterson Air Force base anyway). It worked out quite well for the newer students, but my classmates were blindsided. Most of them suffered through half a semester of C (the other half of the semester was 360 assembler) and never even touched upon C++. They should have just been able to pick up a C++ book, apply the concepts they learned from their ADA classes and the syntax from the C++ book and their C course and move on, but most of them had a hard time doing it.
Why was that? They all knew the concepts. They all knew how to write their algorithms, and their trees, and their stacks and queues. Yeah, they weren't taught how to write real software, but they clearly knew the basics. I spent more time helping others learn these concepts than I did doing my own homework the first two years, so I know what they were capable of from first hand experience.
The problem was entirely in their minds. C++ is a huge ugly beast, and it is a bit imposing when you first start. But if you've got two solid years of programming behind you, it should be a relatively smooth and easy transition. Most of them didn't realize this though. They were scared of C++, they were scared of new languages, and they suffered as a result.
The simple fact of the matter is, if you know one language, you know them all. It's not the syntax that makes the difference, it's the concepts that you express within the framework of the language's syntax that are the real guts of programming. My classmates took awhile to realize this (and I'm sure many of them still don't). That's the same thing with Ruby, or Python, or Perl, or just about any language. Unless you are making the jump from procedural to OOP, or OOP to Functional for the first time, you *CAN* pick up a book and learn a new language in a days time. The only thing stopping you is yourself.
Now, the other part of this is, why would you do that? I love learning new languages, and I love learning new languages for a few reasons. These reasons apply to every programmer, and I honestly don't understand why some people are so opposed to learning something new. I guess that's what seperates a good programmer from a bad programmer. So if you want to know why you should learn Ruby, or LISP, or Haskell, or even Visual Basic, I'll tell you why.
1. It helps keep your skills in tip top shape. Perusing a computer manual may remind you of algorithms or techniques you haven't used in a long time and forgotten.
2. You always seem to learn something new. Not some new technical trick that only works in one lanuage (although that definitely happens), but just a different way of approaching problems that sometimes can transcend language boundaries.
3. You may find a new language that allows you to get the job done faster!
4. You're enhanced knowlege of languages looks great on your resume no matter what you use as your primary language.
5. You learn the way other people think. And I don't want to gloss over this one. As a programmer, you frequently have to work with other programmers. Learning new languages is a *GREAT* way to see how other people do things. To learn the way other people think, so to speak. By learning Ruby and Smalltalk, you start to learn why people in those communities are so die hard about OOP programming styles. By learning LISP or Haskell you start to learn why Functional styles even exist! And it all comes back full circle. Techniques I learned from Haskell I now use when writing C++ programs and vice versa. It only made my C++ code better.
Knowlege is power, and learning new languages is one (of many) ways of increasing your knowlege. Go ahead and try it, even if you think you won't use the language, and even if you're just starting out and don't think the transition from your learning language to a new one will be easy. You just might be surprised by how much you already know, and how much you have yet to learn. That's the real benefit of it.
when you have to deal with another stupid language every 6 months. You should only need 3 languages:
Pick one from each of the following:
(C/C++)
(Perl/Tcl)
(sh,ksh)
Now for the 'bonus' round. [pass go and collect $200 more a month]
(php,python)
and for the MS route, you only get 3:
(C++/C#)
(Visual Basic/there is no other option)
(Java/no other language is as useless to compete with Java)
Now...how far off am I?
Chaos, Mayhem, and Destruction: Not
I have invented a new language called "SoWhoFsckenCares". It has the same features of existing languages, but with a slightly different syntax. It really offers no improvements, but it is new!
It can do comparisons, branching, and looping - just like every other language! The syntax is familiar but just different enough that experienced programmers must relearn it!
Of course it is incompatible with billions of lines of existing code, but it is mine so it clearly must be better!
Please stop development in all other languages so that I can stroke my ego with my marvelous new invention!
Considering how much time Taco spends on AnimeFu I don't think there should be any question at to what /. is gonna use for the icon.
Let's pretend you were writing an "rcurses" library. Need a line of 20 "-". No problem. Anyway, from now on we'll all contact you before adding a feature to a language.
-... ---
That's a real killer argument against a language. The depth of your insight astounds!
Perhaps it's because most school in America, both secondary and tertiary, seems to be geared towards producing employees, and not thinkers? It used to be that you'd learn many ways of thought, and usually, many languages when persuing a CS degree. Now, they teach you C, C++, and Java. Forget that you may not learn any real science or how to think and synthesize, you're taught how to use the tools. At least they still teach students to experiment in Biology, rather that just showing them how to follow procedure and use the microscopes.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
You are raising extremely interesting questions. If people don't like many features, should language designers provide subsets that people can access easily? Could a compiler switch make C++ like Java?
Is the dislike people have for a language partly due to poor explanation of the features?
I'm not saying I know the answers. I'm just thinking that we could do better for ourselves than create an average of one big language each year.
Maybe the ideas of Perl, SmallTalk, C++, Lisp and Icon are just a subset of a larger truth that, if we recognized it, would simplify all languages.
You raise an interesting question about the politics. My guess is that, if someone knew enough to lead us in a better direction, the politics would eventually be changed to fit the new situation.
Bush's education improvements were
Using namespaces will save you TONS of time. It's a real pain typing out java.this.that.blah.yah.foo.bar.add(x).
You're kidding me... Microsoft is *intentionally* cripping C# by adding cruft from C++ to it? How bizarre.
It could have some interesting uses. How about this (in pseudocode since I don't know Ruby):
$indent = "....";
...
print $indent * $current_indent_level;
print $indented_text;
good idea. I particularly like the pics by John Kaurin, the ruby slippers are good, but we could always go with that anime-chic to preserve Ruby's Japanese heritage :)
The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
I find it thoroughly annoying when I have to write little VBA dodads in Access when there always has to be an English specifier at the beginning and end of statement. a simple for loop becomes one of the following: "do while... loop" or "do ... loop until". On top of that, having to throw "End Function" or "End Sub" at the end of a block of code ticks me off just as much. I'll stick to "}" thanks.
"Nature doesn't care how smart you are. You can still be wrong." - Richard Feynman
Wow! I nominate you for the "Sweeping Statements Award." I especially like the way you say "The object models of Python, Perl, and Ruby."
So far, I haven't heard anyone nominate these languages for "large system development," but a lot of large systems are made out of small systems, and while it is tempting to create these large systems in a uniform language (*cough*)Java(*cough*), this can be a mistake. I read a magazine article recently about a shop where they were replacing shell scripts with Java for automating tasks--which turned out to be a big mistake, considering the overhead of the Java VM.
You're right about compilation to native code being of limited benefit to these languages. For the most part, it is a "benefit" they don't need. Take, for example, creating a complex web site in C or another statically-typed, and therefore easily-compilable, language. By the time you're on your third page, you'll realize you need some kind of templating system. Next, you'll discover you need to vary the appearance of pages based on aspects of your business logic, so you add conditions to your templating system. Next, you'll find management wants to be able to update the site quickly using cheap HTML monkeys and is reluctant to spend expensive programmer time recovering old ground, so you make the site entirely data-driven. So now you have a buggy, ad hoc, poorly-documented excuse for PHP! Sure, the code you wrote is compiled, but the system as a whole is slower, and it took a whole lot longer to write.
You said, "If the scripting languages ever evolve into something like Lisp or Smalltalk, their object models, syntax, and semantics will have to change dramatically and incompatibly."
Have you ever considered that maybe these languages ARE the evolution of Lisp and Smalltalk? With all due respect to Lisp and Smalltalk, their creators didn't have the benefit of Lisp and Smalltalk when creating their languages. Larry and GVR and Matz didn't create their languages in a vacuum. Even PL/1 must be of benefit to current language designers (here's what NOT to do!).
Perhaps it would be of benefit to aspiring language designers if you could elucidate exactly how "objects models, syntax and semantics" could be improved and what the benefits would be--keeping in mind the purpose(s) of these languages.
Granted, the best programming language doesn't always win out, but the purpose of evolution is to thrive, or at least survive. I am therefore equally suspicious of praise for highly-evolved-yet-dead languages and snubs of unevolved-yet-wildly-thriving languages.
Brent
100,000 lemmings can't all be wrong.
Español?? I thought they called it castalleno.
huh?!
Python 2.1 (#1, Jul 13 2001, 14:25:58)[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> 3 * 2.5
7.5
Oh yeah, I guess so ...
Strictly speaking, the "*" operator is part of the standard library in Ruby, and not part of the language. If you wanted to write it yourself, rather than using the library version, you could use the following code ...
class String
def *(number)
result = ""
number.times { result << self }
return result
end
end
-- Jim Weirich
I've noticed a similarity in my "night job" as a musician, where playing different types music acts in a similar way to programming in different languages. You pick up stuff in one style that can enrich your playing of another style. Well I sure am staying on topic, eh?
One comment I wanted to make regarding Picking up another language in a day. I agree somewhat. There was no question that after programming in (time order) Pascal, C, Fortran, Ada, Lisp, Clips, and Scheme I was able to "pick up" Perl pretty quickly. That said, it took some time to really learn the Perl idioms and to do things in the "Perl Way". I've seen my share of C code that was really Fortran written in C, or Java code that was really C written in Java (procedural vs OO). With appologies to Heinlein, it takes longer than a day to grok a new language.
In a band? Use WheresTheGig for free.
WOA WOA WOA! Hold on a sec, Ruby is far from a hacked language. If you look at its design, the underlying language/structure, and its approach to solving problems, you'll find it significantly more elegant and well designed than both Perl and Python. Please read the source code or use the language before you start tossing around opinions. Having used all three languages and extended all three using C, I strongly suggest you step back and re-evaluate your position: you might be surprised. I know I was when I did....
-- Sean Chittenden
It's even easier. The numbers in Ruby are all objects with interesting iterator methods.
0.upto(20) {|x| puts x}
What's wrong with Smalltalk being "the next level"?
Well, there is a place for scripting languages and "normal" programming languages. Smalltalk competes with Java and C++. It complements scripting languages.
Heh. Does perl speed up development? Everytime I've tried to use it, I had to have multiple browser windows open for docs and other people's code, in an attempt to figure out what the hell it's goofy syntax stood for. The small script I ended up making kind-of worked- doing the same read, search-and-replace, and write back to file only works some of the time on some of the files- I try it on a different and directory and BAM it doesn't work!
I'm not saying perl is completely flaky and useless- but contrary to Wall's silly assertions, perl isn't a language you can pickup gradually, there are simply too many rules and funny symbols ($/, @_, $_ anyone?) to learn just to do simple things.
And why the hell can you only store scalars into hashes? Pffft! And don't tell me I can just use references to non-scalar data, as refs are scalar- if I wanted to deal with C's bullshit, I would.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Like d00d Ruby can d0 w0rd m4tH!!!!
That's s0 3l33t!!
Perl sux0rz!!
(ya you got a nice arguement going to guy, that logic is unbeatable)
Python lacks metaclasses, lacks a true unified object hierarchy, and supports multiple inheritance (considered a very bad idea by most experts in OO. Like the "goto" statement, multiple inheritance may seem useful at times but it leads to unmaintainable code).
I'd argue exactly the opposite. The OO purists insist on MI, while languages that get-by without it aren't truly OO.
Maintaining code is a pretty thankless job, but at least with MI the changes only have to be made in one place. Java's interface based MI either forces similar code to be included in each class that implements an interface or the inclusion of lots of little stub routines that to call the smae named routine on a different class.
This totally breaks the ISA relationship and turning it into more a sort of ISA, but I've also got a copy of the class as a private member as well.
In languages that implement MI sanely and give you explicit options on resolving name clashes (eg Eiffel) means there is no ambiguity about the class structure or which routine is called. http://www.elj.com/elj/v1/n1/gew/ provides a good evalutation of Eiffel's implemenation.
I can understand people being damaged and mentally scarred by C++'s implementation of MI, but to say its as bad as the goto statement is surely a troll.
---
Silence is consent.
Oh yeah, thanks! Damn colons :)
Smalltalk is just as (and more) dynamic. I work on an IRC client that's part of Squeak. Without restarting the client once, I added an a plug-in system and wrote a few sample bots. Pretty amazing. Change a method, and the next time it's called, it's using the new version. That's kind of difficult to do using Ruby, without an interactive environment, but I suppose it can be done with a TkListener or a thread taking irb-like evals on a socket.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
In smalltalk the hello world is in its entirity:
'hello world' prinNl!
the string object knows how to printNl itself.
Right, you only need 3 languages, but they are: Fortran, Cobol, PL/1.
(Sorry about the strange format of that, but I couldn't get a pre tag to work in /.; can someone
tell me how to get preformatted stuff into HTML posts?)
The "require" is similar to C's #include or Java's "import".
So, this code potentially pulls in completely different definitions of things depending on a run-time variable.
One might ask whether this is useful in practice? I've used it to allow dynamic changes to a long-running program without having to shut it down and re-start it.
> I agree Ruby and Perl seem to be like the latter type So, have you ever actually looked at ruby? Or are you just another troll? Ruby actually has a lot in common with smalltalk (classes are fist-class-objects, as well as functions, you can pass code-blocks,...) I has some "syntatic sugar", but you don't have to use it. Please just SHUT UP if you don't really know what you are talking about. Nobody forces you to program in ruby, and nobody (well, at least nobody who knows what he is talking about) says "phyton is better than ruby/ruby is better than phyton/perl is better/perl is worse/.....). Each language has is strenght and weaknesses, and ruby is IMHO no more or less hacked than the other two major scripting languages. Calling a language "hacked" is always problematic(ok - lets forget about BASIC ;-) ).
One could call C++ hacked - it's "features on top of features". But than- it's the most widely use language, so I guess it _MUST_ have is strengts...
Really? Could you tell me where I can obtain it then? The MSDN site only seems to have a badly written spec, dated 5/7/2001, with a large "this is incomplete" disclaimer on it...
On the other hand, I can just go visit Sun's Java site and get about as much information as I could possibly want about Java. Furthermore, Sun has demonstrated a consistent level of trust in making this information available, reliable and up-to-date over a period of several years now. While still a lesser level of security for the developer than a formal ISO standard such as C and C++ would provide, this is enough for many people to work with.
You're not just, well, blatantly falling for Microsoft hype, are you?
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Java seems to be going in the right direction but it has a long way to go before the "write once run anywhere" statement will work. Using Visual Age Java on an IBM AIX system a translated application from c -> java runs about 2x slower when ported. The JVM crashes a fair amount and requires faster CPU and gobs more memory to get the same job done.
Python can do this also, afaik
if foo:
import bar
else:
import foobar
> FWIW, within a week you'll learn to love whitespace.
No kidding, that's why I like using pretty-printers, not being forced to be one.
Neither are scripting language developers. But many good, powerful languages were developed for real-world use by people with a lot of background in programming languages:
How were Kernighan and Richie programming language researchers but not Van Rossum and Wall?
They weren't, which is probably why C/C++ are as flawed as Perl. All three share an almost complete disregard for error checking and safety. And all three of them are closely tied to the environments where they were developed, with little regard for long-term evolution. Their approach is quite successful: do a quick-and-dirty job and fix things up later.
Python has many advantages over Smalltalk or LISP.
Its code is highly readable even by newbies, and it has many syntatic sugars that make the code elegant and clean.
Python saves every bit of redundancy:
- Variables aren't declared beyond their assignment, whereas in Smalltalk, they are.
- There are no explicit indentation-markers, indentation itself is used. This means there is no redundant and error-prone representation of the code which may lose sync with the real representation of the code hierarchy, whereas in Smalltalk (and LISP, btw) this redundancy is there.
And there are various other points where Python saves you, and increases the elegance of the code - at the expense of making the language perhaps less 'pure'.
Python also has MUCH more practical code available - graphics, 3d, gaming engines, COM object interaction, etc.
LISP is a whole other story - its probably more powerful - but its mostly unreadable by code illiterate - and I'm not sure about the practical library availability either.
I don't use Smalltalk to script in the old-fashioned way, however. I spend a lot of my time with an image (meaning, a Smalltalk environment) open, and write, run, and debug my scripts directly out of it, rather than using an external editor.
You can look at this in the way some people spend a goodly amount of time in nothing but (X)Emacs, writing scripts in elisp.
Regardless, no where in the definition of "script" is it specified you have to be working with pipes.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
"most teaching of C++ at the moment is terrible, which is the single biggest problem the language has"
I agree with this. My city, Portland, Oregon, U.S., has an extremely large technical bookstore, Powell's (http://www.powells.com/technicalbooks), and I have spent several afternoons looking through all the books on C++. There is a strong tendency in most of these books to explain without truly explaining, or to mystify without explaining at all.
It is great to know that C++ will eventually be extended. But the 2 to 4 human years that you mention is equivalent to 14 or 28 technology years.
You mention "better support for interfacing with other programming languages".
This is not a controversial addition to the C++ language. It seems to me that it should have been finished 2 years ago, not 2 years from now.
Bush's education improvements were
I'm just guessing, but I think I have learned at least 15 programming languages. Maybe it is 30, if you count assembly languages. At some point, learning languages must come to an end. At some point, I would like to see all the good features put into one or two languages. I have no intention of using my life learning languages that then die very quickly, like Pascal.
It seems that, at some point, every skilled programmer becomes interested in writing either an editor or a computer language. I wrote one myself, for use with some H-P data acquisition equipment. Now both the equipment and language are obsolete.
With every new language, there are years of extending the language, finding and curing the bugs, and wrestling with incompatibility problems. At some point, this must stop.
Language writers should put their creativity into extending C++ rather than abandoning it.
Consider Java, for example. There have been literally years of hassle and discussion about Java, when it could have been implemented merely as a compiler switch to a C++ compiler. The compiler switch could have provided automatic garbage collection, given error messages for use of pointers, and provided the other features of Java.
Microsoft, following its usual abusive practices, put many ease-of-use features into Visual Basic, while keeping them out of Visual C++. The result was that there are maybe 1,500,000 programmers who know Visual Basic, but don't know a real language. And what language is Visual Basic itself programmed in? C++, of course.
When you write in Visual Basic, you are just a dog on a leash. Anytime Microsoft wants to yank your chain, it can. If Bill Gates happens to lose interest, Microsoft can kill this one-OS language, the way it killed xBase (dBase, FoxPro), for example, by making quirky additions that no other vendor could/would follow, and then abandoning development.
It is a shortcoming of the U.S. culture that so many men feel that they must play King on the Mountain, and try to knock everyone else down, rather than cooperate.
Like everyone, Bill Gates has inner conflict. But don't let his anger and obsessive desire to make money reduce the quality of your life!
So now it is Ruby, supposedly the next big thing. How long will it be until the books are all written? How long until we discover the shortcomings? Is there some feature in Ruby that can't possibly be added to another language?
I reviewed Ruby a little about a year ago, but came to the conclusion that the documentation was extremely poor. The overall value of a language is the value of the language itself, plus the quality of documentation of the language.
At some point, I want the merry-go-round to stop, so that I can get off.
Is there something in C# that simply could not be made a compiler switch to C++? Do we really need more syntax? I'm not saying I know all the answers to some of these issues. But I sense that something bad is happening.
For a few years, languages were interesting to me. But now, I just want to do the job, not discover other ways to do the job. Let's move on, rather than repeating what we have done before. Let's improve what we have, rather than starting again.
Bush's education improvements were
I think one of the great advantages of python is the wealth of material the monty python scripts bring to the table. Endless material for tutorial and how-to writers. Think of the novelty of reassembling the string "spam, eggs, spam, sausage, spam, spam, bacon, spam and spam" in a million different ways using all the different types of sequence objects. Ruby just can't compete with this type of idiom.
Matz (Ruby's creator) is a language designer;
"truly clean, well-designed, quite-pure, strong-typed" can also be applied to Ruby, except for "quite-pure", which should be changed to just "pure";
built-in print, and built-in types, plain stink;
are there cases where, for example would be useful
I'm sure you figured out what I meant when I said "favorite whipping boy", but this should read "are there cases where multiple inheritance would be useful".
Sometimes it's best to just let stupid people be stupid.
The '*' is not a math operator, idiot. It is a string operator. I sure hope you are not planing on becomming a programer, because if you you do you will suck at it. The world is already filled with enough morons who think they can program.
Are you kidding? Object foo knowing how to bar itself is quintessential OO. Then you can have object foo2 knowing how to bar itself, or if they're derived from the same superclass & bar can be abstracted a level, move bar up to the superclass. In smalltalk to print an integer, you'd do:
(5 + 4) printNl!
5+4 evaluates to an Integer object 9, which then prints itself.
Making a (to the user) generic print function to which you pass a string/integer/character may be passing around objects internally, but if you do that (as in the snipped of python you post) the language might as well be procedural from the user's point of view - the benefits of OO were used in language design, but are lost during the actual language use.
If I go to dice.com and do a search for listings with the word "Java" I can find 118 jobs. If I do a search for "Perl" I find 18.
Granted, that doesn't make Java a *better* language, but it does seem to bemuch more more in demand.
I like the way this one teaches, is there a tutorial similar to this one for perl?
"Not my manner of thinking but the manner of thinking of others has been the source of my unhappiness." - M
They dont speak "Spanish", they speak Español.
Yes. Nifty code is all that realy matters.
- You're enhanced knowlege of languages looks great on your resume no matter what you use as your primary language
Let's try mastering the English language first, please.For embedded systems: C# has a defined bytecode that can be JIT compiled onto a variety of special purpose chips without rewriting anything.
Web Programming: C# has built in XML and network support, and don't forget that because everything tunnels over port 80, no firewall will prevent your code from executing!
Instead, all of the statements are absolutely absurd. Maybe you don't think it is funny, but it is absolutely NOT a troll. Trolls try to say things that have a basis in reality but are completely non-constructive for the purposes of discussion to have people respond (I'm not sure where the line to Flamebait is, but...). This is just a joke.
Network Security: It always comes down to a big guy with a gun.
Well, I have learned Python the last couple of months and I think it is great. Before that, I knew Perl and I thought the syntax was horrible. Although I dunno much about Ruby, I've heard that it's syntax is like Perl's. Why would they pick Perl's syntax over Python's?
Ahem, no, 'fraid the coward was right on this one. I wouldn't feel too bad, though; it's one of the silliest and most counterintuitive rules in the English language.
HA HA HA!!! And you didn't even post as an AC. Lern too spel bifor yu tel othors howtoo!!! Idjitt!!
Hold that buzzer, jackass. "It's" is the contraction for "it is." "Its" is the possessive form of "it." Use http://www.m-w.com/dictionary.htm and enter "its" and "it's" into the form. It will set you straight.
who says Python is an upgrade from Perl? It's all a matter of choice.
Well, even Larry Wall himself admits that Perl 5 is showing its age. Look at the plans for Perl 6. It is looking more and more like Python and Ruby, isn't it?
.NET will save y'all. Hold still this won't hurt a bit...
If you learn Python, you are well on your way to understanding Ruby. The more of these languages you learn, the easier it gets to learn more ... :/
Better to be despised for too anxious apprehensions, than ruined by too confident a security. --Edmund Burke
Frankly, perl6 development looks paralyzed to me.
They've been at it for over a year, but as far
as I know, they've yet to make detailed plans for
implementing their ideas. Instead, they're still
coming up with pie-in-the-sky design goals like
making a common runtime for python and perl. I'm
dubious about perl6 ever even making it out the
door.
Alex.
-- ;-)
Kuro5hin.org: where the good times never end.
Something tells me you've never written a compiler :-)
:-) and it all had to run on a provided virtual machine with 9 instructions. Took me many hours of coding.
Me neither, really - I had a small (hah!) CompSci assignment whereby I had to implement a compiler for a simple language with just simple arithmetic and blocks (to learn scoping). No loops, conditionals, or anything much useful
Offtopic, and drunk. Better click "post anonymously". And I lose +1. Doh.
- Smalltalk's method call syntax
:)
- LISP's macros
- The language that first introduced lambda's.
- The language that first introduced closures.
- Simula's code structuring
- Python's array slicing syntax (not sure about this)
- Python's indentation-is-syntatic
- etc. etc. etc.
Don't let Microsoft convince you innovating is collecting pieces from all around and sticking them together in a single bunch.
And just for the record - I hate Java, note it hasn't invented anything either
That's one of the neat things about python - you do everything procedurally if you want, but once you feel like you could use a class, you just add a class and use it in your procedural program. Or, if you really want to, you can make all of it from classes.
Yes that I can see, but what about the favorable differences.
Look a monkey!
You create a gun module, a gun class, a foot module and a foot class. After realising you can't point the gun at the foot, you pass a reference to the gun to a foot object. After the foot is blown up, the gun object remains alive for eternity, ready to shoot all future feet that may happen to appear.
The whole point of having an interpreter is that you don't have to compute things at compile time, you can a lot more calculation and optimizing at run time while you interpret the program.
:P)
And yes, writing a compiler is pretty tough for most modern languages. (If you don't believe me, try writing a small one for C or pascal, and then try to imagine writing a C++ compiler or a Perl interpreter!
However, if you originally meant that somebody should write a compiler to compile all 5 of these languages to a common one and run it on one of the interpreters, then yes, this could be possible, except for all of the annoying differences in the various class libraries and built in functionality of the various languages. This would make writing this compiler incredibly tedious and almost impossible to maintain.
Before the explosion of the Internet, I don't think the performance of computers was enough in such a way that could make Smalltalk productive. Yeah, I know that Smalltalk can be JIT compiled, just like Java, but it doesn't help too much until recently with computers that have sufficient memory and CPU power. The most popular OSes (Unix and Windows) were written in C/C++, the documentation and examples were in C too. Earlier programmers have a need to be as close as much possible to the OS, and you know why (speed, direct hardware control, avoiding syntactic conversions between different languages, blah blah blah... )
You can be proficient and productive for your own specific apps in Smalltalk (in theory, every programming language has a chance of being productive), but I don't believe that this language can be productive to the general mass in practice. However, if a IDE like VB was made for Smalltalk during early 1990s, the scenario might be completely different now.
Let me recapitulate:
- C/C++ - difficult to learn but language of choice of OS makers => popular => more people use it => more libraries => more productive.
- VB - easy to learn; RAD; integrated with the OS so the interface barriers are reduced; marketed on time when GUIs was becoming popular => more libraries => more productive
Smalltalk seems to be lost somewhere in the middle and certainly became much less appealing.¦ ©® ±
Great post, but IMHO any 3-year CS course that aims to teach only one language is going about things completely the wrong way.
You should spend time in (for e.g.) a simple teaching language to start off, 1 mainstream procedural/OO language, one functional language, one scripting language and study briefly a sampling of languages of comercial or academic interest, and what makes them interesting or sucessfull.
IMHO when you learn your second language is when you start to 'get it' about what is an essential feature, and what is an accident of syntax or history in programming.
I wouldn't call knowing only 1 language a "the Computer Science Student mentality" because a CS graduate should definitely not know just one language - they should know how to pick up any language quickly, having had practice at it.
My Karma: ran over your Dogma
StrawberryFrog
otherwise someone worked too hard.
Well if you use Jython, than you don't need a python interpreter installed. If only all these scripting languages could target the JVM or .Net then we would only need the jvm and .net to be able to run all of them.
Perl certainly does have a lot of features (and multiple ways to do the same thing), but Python and Ruby tend not to.
Then again, if you extended your "hack language" idea, you could argue that smalltalk, lisp, and c (and certainly c++), have many extraneous features.
I think the only non-hack language in that case would be Ada/Ada95, where EVERY feature in the language has a reason for implementation (and not simply for convenience's sakes). Also, Ada/Ada95 have a lot strong type checking than something like smalltalk or c.
So do you then attribute a "BASIC odor" to smalltalk or c?
a Three's Company plotline.
Huh, Smalltalk productive? Where? If it were productive, everybody would be using it instead of C.
¦ ©® ±
The poster you're replying to said that you don't have to adjust to someone else's formatting habits because it's formalized. It also helps because mis-formatted code will break and alert you to improper format, whereas if it weren't formalized, you may be looking at the code and thinking it does something different from what it actually does.
Some people (particularly Linux sysadmins) are too dumb to learn a real language like Smalltalk or C++, and so they need to rely on hack languages like Perl or Python to get things done.
Anyway, the computer software field will be better off without you. CS isn't about learning specific languages; it is about learning universal concepts. Specific languages are a dime a dozen and anyone who bothers to learn the basics correctly can pick up a new language in a matter of days.
This is so true.. I have people constantly asking me, "How many languages do I need to know to be a programmer?". Most of these people are in it for the money and have no desire to actually program.. They are the entire reason the IT-industry is going through it's "sifting" period. Programming is about abstract concepts, ability to design solutions, and creativity.. Many people know many languages, but don't know the first thing about problem solving skills.
arcane for life
* after a string isn't an operator in Ruby. It's a method of the class String.
Ok, but no, thanks ...
Yes, 'Parrot' was an April fools joke, but people have also been using it as the code name of a project to merge the bytecodes used by Perl 6 and Python 3 (as well as possibly other languages, such as Ruby). It was kick started by Eric Raymond on the python-dev mailing list, and has spawned a lot of interesting discussion.
Hey, cool. I just finished reading "The Pragmatic Programmer" last week. This seems to be by the same authors. I recommend their work. I only wish I got ahold of it earlier than I did. It seems I've come up with a lot of the same points they did, the hard way. (Perhaps that's for the best...)
is it so much harder to do: .= "-"
for($x=1;$x=20;$x++)
{
print "-"
}
or:
my $line;
for($x=1;$x=20;$x++)
{
$line
}
print $line
...again i ask what is the big savings in word math?
Well, the problem is that the pure language doesn't do anything essential other than simple "Hello world" programs or computer science exercises. The basic syntax only covers loops, if/then/elses. However, the real gem of a language lies in the libraries, calling conventions and they really differ from language to language. While it is relatively easy to learn a new language, it is counterproductive to remember that the exact argument positions of library function calls and idiosyncrasies of each. Bugs really happen when you cram too many things in your brain. Besides, why do you want to become a jack of all trades, master of none?
¦ ©® ±
Then learn Ruby. Python looks clean to the untrained eye, but you have to remember lots and lots of special cases because of the arbitrary mixture of object-oriented and procedural features.
Ruby is extremely consistent and well thought out. I've used well over a dozen languages, and Ruby is my favorite by far.
Microsoft was out there INNOVATING
Name a single feature in C# that hasn't appeared in at least 3 languages prior to it.
Anyhow, I'd take Python, C++ or LISP before I'd take C#, for any task. (The first for elegance and ease, the second for performance, and the third for its power).
I'm never certain how to begin my posts, so I often start with a sentence just like this, hoping that the momentum of typing will somehow lead me into the points I wish to make (anyone see Finding Forrester?). Anyhow, now I'm ready. I'm a big fan of Java. It's certainly the programming language I know best, and I have tried others. I learned C/C++, and though I like C for the way it feels, I can't say the same for C++. I haven't used it in a while, so I'm not too familiar with all the STL stuff and all that, which may make things better than I remember, but it always seems to me that in some cases, Java does the things that C++ does in a better way. Plus I could list all the great things that Java can do that are hard to do in C++. Java, is indeed a very nice language/platform/etc. However, for all the work that's been put into Java, I have to say that it really isn't wonderful for all occasions. As a simple, concrete statement of one of the things that can bug me in Java on occasion: sometimes it's nice to be able to pass around methods/functions. C++ can do this directly with function pointers, of course, and Ruby can do this because, well, everything's an object in Ruby (a very nice feature). Because of the way it was designed, though, I can't do this in Java, other than going through reflection, which is poor form. Now, there are ways to do this in Java. Basically, you have to create your own class to do it. Let me explore some possibilities. Let's say I have two different methods with signatures as follows: String foo(String s, Object o) Integer bar(Double d) Now, I can create my own Method class that has a method Object invoke(Object[]); But this doesn't look nice, does it? There's lots of ugly casting involved because you can't make any assumptions about what it can return or how many and what type of arguments it can use. Another solution is to declare a specific class for each dynamically defined method that I want to have, but then I end up adding tens of classes to my project. All of this work because I want to have a few methods of, say, my MUD able to be plugged in by extentions that are loaded at runtime (which, incidentally, are very easy to allow for using Java). With Ruby, I'd just declare a variable, fill it with a default function, and then if anyone wanted to change it, they'd stick a new function in there with the same signature, and all would be well. All because methods/functions are objects in Ruby and not in Java. Now, I'm not bashing Java because I understand that all languages make certain tradeoffs. My point is that there are many different languages because they all address slightly different needs. Even if they appear to address the same need, they may do it in a different way that makes them better in certain situations. I'm learning Python now and I just don't like the way it feels as much as Ruby (although it could be the book I'm using (Core Python Programming or something like that) because the author explains in great detail some things that appear stupid to me, like the method used to determine which of two hash tables is numerically greater...). So, anyway, there's almost always room for new languages with slightly different feature sets that will conform more to certain people's personal style, and the more you take the time to learn, the more chance you have of finding your dream languages. But, I'm talking too much on your first point. On to the second. You compare learning new languages to buying lottery tickets, which, in my ever so humble opinion, is ridiculous. Such a comparison, of course, assumes that we're learning the languages solely so that they'd have some kind of huge payoff in the future, which, of course, often isn't the case. Dalroth gave other reasons for learning them, though. The thing that caught my eye the most in his reasons was keeping yourself sharp. I don't see how stimulating your mind could ever be a waste of time. The more you have to think and work with the concepts of programming, the better you'll inevitably become at them, and that can help you whether or not the language becomes wildly popular. Why should I study anything but computer science and the math and science courses that it depends on in college? Because it gives me a more rounded education and knowledge base, and can help me to have better quality of thought in general. Why should I read any books for pleasure, or, for that matter, anything but what will have a direct and forseeable payoff in the future? I think you get the point. Finally, this forum is populated, theoretically, by people who enjoy learning about and using computers. If one does something for enjoyment, why should he then complain when more of that activity is available to be done, or at least, more varieties of that activity. Complaining about how many programming languages there are on this forum is like complaining about how many new science fiction books are written. "Don't we already have enough of those?" How about: "Do we really need new issues of Playboy? We already have lots of pictures of nude women." I hope I don't learn too much stuff. It might not be good for me. Anyhow, that's my take on the subject. I apologize for the length of this post, but I'm tired and my writing tends to get extra wordy when that happens (it's always wordy, unfortunately). I would advise you to have a nice day. I hope this day (as it's 2:37 AM right now) is better than yesterday in my case. :)
Cheers,
Dan
I've come for the woman, and your head.
Not quite. First off, for interpreted languages, there is nothing stopping the interpreter from creating the dynamic length string on its own, based upon the "*20" or "*$foo" and then making one call to print, instead of $foo calls to print.
Whether Ruby actually does this, I have no idea, and whether this is actually more efficient, well it depends on efficiency of print vs. creating a string in memory in Ruby. There is a potential for a drastic difference though, so the amount of work that can potentially be saved is quite great.
Python gets all of its object-orientness from C++, Ruby gets its from Smalltalk. C++ is generally regarded as a crude (although useful) hack, whereas Smalltalk is the definition of elegance itself. So, if it is cleanliness you want you should move to Ruby. I find it amusing that while the Pythoners mock the Perl-hackers that refuse to upgrade to Python, they themselves refuse to upgrade to the next level .
eat my ruby, Jon Katz
Why the HELL would somebody want to put the word "end" at the end of a statement, block, line, or whatever the fsck that is, instead of a simple semicolon??
The 'end' is for the 'if' block, not the end of a statement. This practice actually cleans up code a little by not having alot of strange curly braces littered everywhere. You just don't like it cause you're not used to it(and you're used to C, C++, perl, etc.). It's actually pretty good.
Higher Logics: where programming meets science.
Huh. Linux stable? Where? If it were stable, everybody would be using it instead of Windows.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Actually, as much as I hate to say it. Microsoft is on to something with the Windows scripting host. It can interperet Perl, VBScript, Jscript, and possibly some others (I don't remember offhand).
I think a developers productivity has less to do with the language hes using and more to do with how much experience he has with that language
If that were true, you could just as easily write a text processing system in raw assembly or in a scripting language. I don't believe that. Languages are tools. Different tools effect your productivity in different ways. A farmer's productivity does depend on his tools and so does a programmer's.
why not doing a
print "-"x20
Seems even more the Perl way to me...
-- If windows is the solution, can we please have the problem back?
Different strokes for different folks, I suppose. While you seems to say that the simplicity and elegance of Lisp and Smalltalk isn't practical, it is for me- my brain thinks in such terms. Perl is, for me, in many ways almost a big of a pain in the ass as C++, because it tries way too hard to fit what Larry Wall said is the "natural flow."
Jujst another perspective...
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
If C is the kind of language you DO NOT like, and SML is the kind of language you DO like, then I sincerely hope that you continue to dislike the scripting languages. C has proven itself perfectly adapted to solve a large an important set of real-world problems. Perl, Python and Ruby are similarly designed.
I don't really see "symbolic AI", "planning", "Dynabook, educational software" and "proof systems" as particularly representative of the programming most of us do in the real world.
"Text munging", "kernel hacking", "GUI and server application programming" etc. are more typical. Thank Guido there are "hacked" languages to let us do our jobs!
I wouldn't consider someone who memorized the syntax to every pet project language under the sun a hacker either.
A person can learn to speak 10 different human languages, that doens't mean they're going to be able to write Moby Dick.
Can you dynamically replace the operator at runtime ala st? (don't read this as an aggressive question; I'm actually wondering) That's one of the wicked things about st IMO; not only is it easy to write self-modifying programs, its hard not to; every chunk of code actually modifies the language.
However, a language like Ruby fails to impart or embody any new paradims or concepts. That is, it's mostly a new syntax atop existing semantics found in Perl or Python. An exercise is syntax and grammar is relatively uninteresting. For me, learning a new language, be it spoken or coded, most of the interesting parts are novel ways to express old semantics or completely new semantics that are put out in the open.
That said, I like Ruby- while it may be pointing at the same problem-niche as Perl and Python, as a language, it makes a lot more sense to me, and I'd heartily choose it over Perl or Python in most circumstances.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
I've been following it as closely as I can. It really looks too much like Ruby for my tastes. Ruby is too much OO. I don't want methods for literal values. I don't want everything to be an object. That's just ridiculous. I want to choose whether I use objects or not, that's why I like Perl. I can structure my projects like C, C++, or even Java/Smalltalk "everything's an object" if I want. Some projects lend themselves to OO design, and some don't. Java has the best library (what the hell is LW thinking when he wants to strip down the Perl6 library and make everyone go to CPAN for the least little things? Software engineers don't have time for that shit and in a big corp every installed module has to go through 2-3 change control committees and architecture docs and.... jesus, just ship everything) but the extra structure that I have to code into my program is a waste of time. I want my program.java to say
import java.io.*;
System.out.println("Hello World");
and not have to type all that class/method setup garbage just to get to one library routine. Is that too much to ask? To OO zealots it is.
I'm a young guy, but I've been programming for a long time (a majority of my life, started doing BASIC when I was 6 and I'm now 25). I learned OO concepts on my own with Turbo Pascal 6 in, um, 1992? In the professional world (i.e. the one that matters), OO is way overdone and misused. What I've seen at the companies that I've worked for is that the majority of OO usage is strictly about office politics.
See, if you start talking about functions and callbacks and closures and all the fun procedural stuff to budget manager types, they put on their deaf ears and figuratively yell "I CAN'T HEAR YOU! I DON'T HEAR YOU!" OO lends itself to all kinds of extraneous documentation, such as modeling, object-relationship maps, 300-page design docs, etc., and it is a buzzword for those that are buzzword-prone. When someone is burnt on coding, you can put them to work drawing crap up in Visio and writing Word docs, tack "Senior" onto their title, and give them a $10k raise, and you have thus kept at least two people happy and not had to fire someone who couldn't "contribute". In short, OO programming languages are politically correct and lend themselves well to covering your ass.
With an OO environment, you can abstract the design of a program from the code itself, in the old procedural model you couldn't really do that. It was about, "this function does this and returns this, and here's why," on a code level. Software really couldn't be described in terms of anything other than a computer program. Now that OO is prevalent, you describe things as, "the subscriber object contains everything about a subscriber, it's related to the subscription object and has properties of a user." You can take that to an MBA-Sales and say, "we need to write this code, it'll take 10 weeks and $xk, and here's why." OO looks like wild magic to the non-CS-literate and this gets a lot of money allocated and keeps a lot of people employed for no reason other than smoke and mirrors.
That said, no language is perfect. If Perl had a native compiler that would produce ELF binaries, it would be perfect for my needs, but not necessarily for the needs of others. I know how to work in an OO shop for my career, but that's why I work as a strict hourly contractor. You want me to type a Word doc and draw Visio for $xx an hour? hey, it's your money.
Most of the advantages being quoted are "ease of use", "rapid development", etc. Fine. But what about runtime? How does Ruby compare with Perl in running efficiency? Are there any benchmarks out there?
I doubt he will. That is, there is no point at which there are too many languages. To say otherwise is just a submission to the stronger and stronger trend of American capitalist corporate philosophy under the guise as "effeciency."
Let me explain. Oftentimes new languages are created for someone to learn the ins and outs of designing and implementing a language and it's tools, be it an interpreter or compiler, native or bytecode. Writing a language seems to be a popular enough of a hobby that it won't soon go away. Eventually, some schmuck, consortium, or business will come up with some new whiz-bang theorectical basis for some new language that will make everything look that much older.
Now, you don't have to go and learn any of these new languages. No one is forcing you. In fact, most of you are already mentally stuck in the 60s, with languages based on flat files. And that's fine. But the nature of science is that there's a lot of experimentation before discovery, and regardless of whether or not you think Ruby is that useful, it's serving some use to someone, and seems to be advancing computer science (not "programming", but CS) to a degree, if only for a small group of people.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
In the second half of his post above, Dalroth has made a very sensible case in my opinion, for learning other languages.
(Dalroth seems like the kind of programmer employers want to hire. But he has provided no way to contact him. In fact, he is very negative about being contacted in his bio.)
I'm tired of new languages (read my post #128), but Dalroth has a point that other languages sometimes teach other ways of thinking.
The answer seems to be to put all the knowledge in one place, or as few places as possible. At some point even Dalroth will decide that one more language is too many.
Bush's education improvements were
clear, powerful code is all that matters (speed is secondary for me... just throw more hardware at it! you cant do that with ugly programming languages)
How do you think these experimental features are going to get into an ISO standardized language like C++?
Do you think some smart guy like Matz, or Guido Van Rossum or Larry Wall can just go up to the ISO committee and say: "I've got this set of cool ideas -- let's add them to your language."
Also, do you really think that all of the good ideas of Perl, SmallTalk, C++, Lisp and Icon can naturally fit together in a single language? It isn't always possible, nor advisable, to pile every possible feature into a language.
Most people dislike C++ because it has TOO MANY FEATURES. That may not bother you but it is a big part of why Java caught on so quickly. So if you make an uber-language with every feature, you will CAUSE the creation of competitive new languages with smaller feature-sets. Smaller languages are often a reaction AGAINST bigger ones.
Their approach is quite successful: do a quick-and-dirty job and fix things up later.
;-)
C was designed to be as low-level a language as possible while maintaining platform independence. It has nothing to do with "hack jobs". You can do pretty good hack jobs in ANY language, just like you can do superb coding in ANY language... well, except maybe brainfuck.
Higher Logics: where programming meets science.
Hell, it is goofy syntax.
Please: "its goofy syntax" next time, so that yours is not such an eyesore.
Okay... I guess I understand it better now. I was looking at it very late at night. :)
;)
It still seems wierd to me though.
Parrot the language was a joke. This new Parrot is about the backend. Would be like a JVM .. for these languages.
Ruby does have ; at the end of statements! If you want to put two statements on the same line, you put a ; in between them. If you really feel like you want to have ; at the end of every statement, go ahead and put them in. Ruby won't complain.
Actually, there is a lot of talk going on between L Wall and GvR to try to unify their bytecode interpreters (and maybe object models, etc.) for just this reason. I'm not awareof the details, but perhaps in some distant future, Python, PERL, and maybe even Ruby will all converge on a common backend (forget about TCL, though. It ain't never gonna happen)
"It's overkill, of course. But you can never have too much overkill." - Anonymous Slashdot Coward
An interesting discussion can be had as to whether one's spoken/written language affects your "productivity" for certain tasks (writing lyrics, novels, technical documents, etceteras).
Are there concepts that can be expressed in one (human) language, but not another?
--
Don't like it? Respond with words, not karma.
Usually the latter turns out to be some baroque conglomeration of features piled on features, creating a very top heavy feeling to the language, while the former classification languages all have a purity to them, e.g. smalltalk, lisp, and c.
Well, I mean, as long as we're talking in generalities here, the latter also seem to be geared towards getting jobs done where the former are geared towards elegant problem-solving. Purity is great when you're admiring something, but no one wants to hang out with the righteous virgin when they feel like getting laid. Personally, when I program, I'm not looking for my code to fit some elegant theory. I'm looking for the job to get done as succinctly as possible.
Some would defend the "hack languages" as a means to Rapid Application Development, but Smalltalk has been shown to be the most productive language, and Ruby/Python/Perl all seem to me to have a BASIC odor to them; I'm wondering if people are afraid to learn a new way of speaking?
I would say that Perl stinks more of shell and C than it does BASIC. If you're talking because it has a lot of built-in features, there are plenty of languages that have it. But out of all the languages you've mentioned, I found it ironic you say that because Perl has problem undergone the most intensive language development of any (and the new process probably blows efforts for other languages out of the water). Larry Wall has a great affinity for languages (both spoken and programming), and it shows, because, for English speakers, Perl is designed so that you can write it like you almost would speak it. Now, you might say that that is "hack"-ish, but that shows a lot more care for the process of programming than a language that idealistically sticks to a theoretical truth in favor of making the language easier to use.
And provide a link to a study that shows Smalltalk is the most productive language. I'm not saying I don't believe you, but I personally find the "hack languages" to allow a much more natural flow between my brain and the screen, so I'd be interested in seeing how that conclusion was reached.
I think your point is interesting about C++ having too many features. But why not just have compiler switches that prevent use of some features? That way, if a project didn't need the complex features, they could be prevented from being used, assuring uniformity and, in some cases, ease of debugging.
The features of C++ don't bother me. I just use what I want. Similarly, English is a very complex language. But, as a professional writer, I choose to avoid obscure words and poor constructions. For example, I usually avoid verb phrases ending in prepositions. I don't say "used to", for example.
And the complex features of C++ are of higher quality than the complex features of a human language that was never designed. The complex features of C++ are very useful in special cases.
What I really don't want is to have to change languages just because I need a particular feature.
Bush's education improvements were
People do tend to progress from more well-known languages to less well-known ones. They don't go to a bookstore and pick up a K book and think: "this would be a good first language." I've played with Ruby enough to decide that it is neat but not appropriate for many of my projects and not a sufficient improvement over Python for the rest.
Python 2.2 has metaclasses, a unified object hierarchy and supports multiple inheritance which is quite useful and safe when used thoughtfully.
It is simply a matter of historical fact that Python was not based upon C++. If it shares features with C++, those would probably be traced back to Simula through Modula-3. Smalltalk is also based upon Simula.
Nobody would claim that Python 1.0 was perfect, nor that Python 2.2 is perfect. Nevertheless, you haven't yet mentioned a feature of Ruby that isn't in Python 2.2. There certainly are such features -- but they get increasingly esoteric as Python improves. If I have to choose between Bertrand Meyer-approved-OO-cleanliness and native threads that don't block when you do I/O, I would choose the solid threads. OO-cleanliness is about conceptual elegance and native threads are about getting the job done.
And how deep is Ruby's Unicode support? If you can please point me to documentation on using Ruby's regexp engine to match Unicode characters, I would appreciate it.
My current Python projects depend heavily on both threads and Unicode. Mixins, multiple inheritance and the ability subclass "integer" really don't matter one whit! I am mostly happy that Python is unifying its type system for rhetorical reasons. Practically it hardly matters at all!
If you want to impress the vast majority of programmers who are not language collectors, you'll have to show us some program that are hard to solve in (e.g.) Python and easy to solve in Ruby.
For this and other reasons, it is not accurate to paint Ruby as the next step after Python. It is another good language with strengths and weaknesses. One day it will have a superset of features that Python currently has...but Python will itself have evolved by then.
l4st p0st
This looks really cool. Sure beats the hell out of learning Perl for system administration scripts, since I already know PHP and have a basic understanding of OOP...
Is your company running tools written by ma
"This is a study of Language productivity. What it shows is that compared to other general purpose languages, Smalltalk is more productive in a function points per man month scale as well as number of statements per function point scale. Check it out!"
I can't remember what other languages were surveyed when I glanced at it, but spr.com used to be working (code red?)
who says Python is an upgrade from Perl? It's all a matter of choice.
I have a strong sense that you don't know Python.
I get the stronger sense that you don't know Ruby -- most Rubyists tend to be ex-Pythoners and not the other way around, but nevermind.
Python gets *none* of its object-orientedness from C++
Python lacks metaclasses, lacks a true unified object hierarchy, and supports multiple inheritance (considered a very bad idea by most experts in OO. Like the "goto" statement, multiple inheritance may seem useful at times but it leads to unmaintainable code). All these are simple repeats of the mistakes of C++.
Python's OO credentials are just as strong as Ruby's. This is especially true for Python 2.2 where you can subclass even primitive types
Yes, Python is improving, but all these improvements (like allowing the subclassing of primitives) only serve to point out flaws in the design (why aren't primitives normal objects in the first place?)
I'm a fan of the ruby-crowned kinglet, myself.
Yea! Delphi rocks! It's based on object pascal, a different language than the pascal you learned in school. It's reallyalmost as simple as VB in a lot of ways, but gives you much of the power of C++. It's worth taking a look at.
I thought that was perl?
Programming is about abstract concepts, ability to design solutions, and creativity..
and l33t hax0ring skillz
if the iterator is a hardcoded value, there's no reason the new string can't be hardcoded by the programmer;
print "-------------------"
but its usual usage is going to be with a dynamic number of iterations, in which case the interpreter has to create the iterator variable &c at runtime.
So it still doesn't really save any work/cycles.
You are a grade-a moron.
(...) They each need their own interpreter. So if I have 5 programs that people have written (...) I need all 5 interperters installed. (...) Unfortunately, I can't think of a good way to fix this problem. So I guess we will just have to get by with it...
Can't you - or sombody else - just write a compilier. (can't be that hard) If an interpeter can read it, why not any other program. E.g. a compilier.
Just a thoughtLook a monkey!
In other words, it's not a compile-time thing, as it would be in C/C++/Java. Someone else pointed out that's possible in Python, too. I guess Ruby is just the first place I've seen it, so I'm overnthusiastic :-).
Only George W. Bush speaks "Mexican". Everyone else speaks what we like to call "Spanish". Especially the Hispanically-owned businesses.
Is your company running tools written by ma
Actually Ruby has a distinctive whiff of smalltalk to it. Also I think classifying Python as a non-academic (hacker) language is a little odd, for a language that grew out of a pure teaching language (ie ABC).
Better to be despised for too anxious apprehensions, than ruined by too confident a security. --Edmund Burke
We've all seen the usenet post in the coffee room or on various websites. Usually under some title like:
- Shooting Yourself in the Foot
- How to Shoot Yourself in the Foot using:
- TASK
:- To Shoot Yourself In The Foot
So how does one go about shooting themselves in the foot with Ruby ?healyourchurchwebsite.com - WWJB?
Well my friend, as the previous poster expressed it - Python is *strongly* typed. You seem to confuse strongly/weakly and static/dynamic. To make things clear again - Python has dynamic and strong typing. Got it? Kind regards.
Age is not the issue here. The issue is that it might be better to put more of the fine features into one language, rather than have so many languages.
There would still be the same amount of features to learn, but they would not be scattered all over the programming landscape.
Bush's education improvements were
Sort of. Assembly is hardware dependent but not necessarily software dependent, thanks to the standard use of ELF. In fact, if you write your Assembly programs properly they can easily be recompiled for any POSIX operating system (Linux, QNX RTP, BeOS) with absolutely no change, and Windows (all varieties) with MinGW if you do some tweaking.
There are some very nice hardware platforms out there. Especially Alpha, and it makes me said to alienate these. But, as you may know, most processors out there today are IA32 compatible. Even though Alpha is so nice. *sniff*
2) It is very hard to read.
This is strictly opinion. I find C hard to read. Assembly is simple, linear, and straightforward. You never have to guess what is going on. As for C, well, look at the obfuscated C contest. :)
3) It is relatively hard to learn. Don't tell me assembly isn't hard, it is definetely _MUCH_ harder than Ruby which has e.g. those nice and _easy_ string manipulation possibilities.
I am going to go against what you said. Assembly isn't hard. It is much easier to learn than most high-level languages. The basic instruction set is very small. Once you learn the basic instruction set the only thing you need to learn is how the hardware operates. That is the hard part.
Now with comprehensive driver systems in modern operating systems it is not necessary to learn all the gory details of the computer hardware. You just CALL any functions you need. Of course learning the gory details is always fun, if you wanna learn them.
4) Source code is huge.
Sort of. This is not true if you do things right. This kind of ties in with the last statement. Back in the cave-days most Assemblers were really unsophisticated. You wrote your program from beginning to end in ASM code with some labels. Maybe did some calls, jump around a bit.
Now a-days, we have come a long way. We are much more civilized. No ASM programmer likes to manually push 5 offsets on to the stack to perform a call. We use macros for all the "drudgery" that normally makes ASM programming hard work; especially chores that can't be optimized but are done often.
And for "meat" of the program you will find that ASM programming is a lot more satisfying. Most C optimizations are compiler dependent and it's hard to see what's going behind the scenes. In ASM you will always know if your ASM code sucks or not, before it's even done.
True enough! But once you have a solid code foundation it is pretty easy and quick to use.
I'd say this the other way arround: Assembly is a way to represent the raw binary format of 1's and 0's in a sort of human readable format.
Precisely!
I agree, too bad Borland never made a version of Delphi that generated byte codes (or whatever people are calling P-code these days), that would be the best of both worlds.
Horses Mongo like horses.
I like failing
A associate once said about programming its "Horses for courses". What he meant was that we should use the best tool for the job at hand. When he said it he was talking about using Clipper (an dBase clone) over Quick Basic in 1990.
Today I know two languages to what I consider 'professional level'. On Windows I develop stand alone applications with Delphi. Its easy to develop quality code - I define quality in this case by not crashing due to obscure memory errors. Its very hard to write code in Delphi which causes memory handling issues. Writing Delphi feels like the IDE wants to help you, but if you want to get your hands dirty you still can (unlike VB).
For Web Development I now use Java. I wouldn't use Java for stand alone GUI apps because its still too slow compared to Delphi, but for server side web development it has the features I want - portability, easy to develop in, connects with SQL etc.
Learning a new syntax takes time. You need to be sure that a new language is going to have a payoff in terms of being able to achieve something you can't in others. For years I wrote Delphi, as it was the best horse for the course. Now with Web Develoipment the course has changed, and Java is best (for me).
That said, a programmer should be able to learn any language. But just because you can doesn't mean you should...
if enterWorld == $salut[0] print "\n" + "Yes. Hello World would be polite.\n" break else print "You say '", enterWorld, "'?!\n" + "You humans are so rude!\n" end argh...it has a conditional structure like Visual Basic. Thats just what need another language like C# that claims to modern and able to do it all. I will stick with a tried true like perl, Yes i actually can remember to put a semicolon at the end of a statment. Speeds up development my arse.
Abreu
- risking karma by standing up to the gringos since 1999 -
No sig for the moment.
It's certainly cleaner than perl, and I like it and use it heavily, but elegant? Private attributes are created by prepending a double underscore, which is then mangled so that __foo becomes __Classname__foo. A number of features seem to be afterthoughts like that.
Significant indentation has some advantages, but it also leads to kludginess. Compare generating code in Lisp, with generating code in python. (How would you generate code for a new method and add it to a class, anyway?) Try un-mangling a python program that has suffered tab damage. Try cutting and pasting code, and having to shift it manually because no auto-indent mode is possible.
Python is more elegant than perl, and did a lot of things right. It's got plenty of quirks and kludges, though. Ruby isn't perfect either, but the more I've read of the Programming Ruby book, the more I've appreciated the coherence of the design. As other people have pointed out, you'd miss most of the important points in favor of Ruby if you just go by the article that prompted this thread.
OTOH, the availability of libraries and example code is inversely proportional to elegance: perl has the most, python next, and ruby the least. Often that overrides any other considerations.
Then what about when you start on a new language - say C++, then you'll need to get the hang on procedural anyways and if your not a programming wizard in Ruby, you'll probably have to walk through python anyways. (If only briefly) My suggestion is stick to python. Or switch to Ruby and stribe grasping mixed languages later on.
Look a monkey!
is this truly OO? :)
:)
and in Python, its: print 'Hello World'
If you want to describe how your objects 'print themselves', in Python its better done in a more generic way, you write an __str__ method in your object, that knows to represent it as a string for printing, but as an added bonus - it can be represented as a string for ANY purpose!
That looks like a good pic, except that the text over it may be a little tough to scale down. Perhaps just the red ruby?
The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
They are. The C++ standards committee deliberately left C++ in a known, standardised state for three years or so to allow some stability for developers using it. They are now actively working on C++0x, the next revision to the standard, currently expected some time 2003-2005. (That's level with, or ahead of, fully .NET supporting versions of Windoze, BTW. C# advocates, eat your hearts out.)
Strange as it may seem to some of the posters around here, the serious guys have actually noticed that people want to see inter-language communication, threading, yada yada, too. Members of the committee, including Stroustrup himself, have several stated goals for C++0x, including:
So, before everyone gets off on talking about C++ with 15-years-out-of-date knowledge as usual, please remember that the language is still being worked on, is still improving and is still adapting to the rest of the marketplace. While people on /. buzzword themselves to death, the pro's using solid tools like C++ will continue to do so. More details, as ever, can be found on the comp.std.c++ newsgroup.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
But there are other ways.
For python you can use freeze (comes with the source distribution) or py2exe.
I've used this to produce different binary versions of the same program that ran happily enough on Win2k/NT, HP-UX and Solaris, all without having to distribute the interpreter itself, or require that these systems had python installed.
<-- You are here.
If I had modpoints, i'd have used them on you. The other explainations (ie: it's better/quicker than a for loop) are valid, but seem wasteful. This, though, seems appropriate.
I guess i'll download and try it later tonight, I just dont like the VB style conditionals (if fuck break else shit break end nonsense).
Mooniacs for iOS and Android
Take a good structured design, substitute 'class' for 'module' and 'member method' for 'public function', and you'll have a good OO design. OO is just an easier way to implement the classic structured design elements: encapsulation, extensibility, and genericity.
You also said:
Huh? I can't speak for Java, but your 'dream code' is standard operating procedure for Python (and, I imagine, Ruby). Here's a transcript of your Hello World example from an actual Python interpreter: (I could have said print "Hello World" instead of the sys.stdout.write() call, but I wanted it to look like what you had written.)Download a Python interpreter, type that code in, and see it run for yourself. If you don't like OO because of your experiences with C++, Java, or Perl, you should try Python or Ruby. They are OO languages done right, as opposed to the hideous Lovecraftian horror of C++. Even if you insist on structured programming with no OO, Python has a very nice module system that makes it easy to create and encapsulate modules.
-- ;-)
Kuro5hin.org: where the good times never end.
Why didn't Smalltlak take off? There are a lot of reasons, including:
In what sense would you say Smalltalk "didn't grow up as much?" Smalltalk is incredibly mature and stable- so, I doubt that's what you mean.
Smalltalk is productive, in my experience. Putting Smalltalk and C in the same league is silly- at the very least, C++ and the STL would be a better comparison.
Smalltalk isn't the best for kernel-hacking or serious number crunching (F90 anyone?), but I don't claim it to be. It's a great language, a great system- one with which a person can be incredibly productive, especially in comparison to C++/STL and Java.
Not being able to spell the language's name correctly is a sign you've never actually had any experience with it.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
AFAIK, not in practice. It is always possible to introduce new words into a language when it becomes necessary. An African tribe might not have a word for "snow", but if they saw any, they would quickly invent one (or loan it from another language).
As I recall, modern linguistics says that all natural language grammars follow the same meta-grammar. In other words, natural language grammars are all similar in fundamental ways, and can be used to express the same links between concepts. From my experience with Japanese, I know it's always possible to translate a Japanese sentence to English (provided the phrase doesn't contain any aspects of Japanese culture that English has no word for); there'll be some loss of nuance, but the core meaning can be transmitted. Imho, though languages have different nuances that reflect the culture of their speakers, no language results in fundamentally superior "productivity" at any task, once the proper vocabulary has been learned.
Could I entice anyone to review it here on The Assayer?
Find free books.
Conclusions:
1. Java is a nice language. I would prefer Java to C++ any time of the day.
2. Java is a useless language outside of a very controlled environment. Because it is not Open Source, it is highly unportable (just try running Java on OpenBSD sometime!), and because the existing runtimes are so bloated, it's only useful for applications where you don't mind having a spare 40 megabytes of bloat hanging around.
In other words, Java is *not* a panacea, and certainly isn't a replacement for highly dynamic languages such as Python or Ruby, which tackle an entirely different problem set.
For a bit of background:
The Problem with Java
My opinion of Ruby: Nice language. Some stupidities though -- the whole notion of making variable types case-sensitive reeks of Fortran. I considered Ruby for the TapiocaStor project, but had to dismiss it from contention because it's not yet mature enough. We're using Java, but only because we can't use Python for legal reasons.
-E
Send mail here if you want to reach me.
Amen! I wish I had mod points ( +1 Insightful ).
I hack Python *much* more than I do Ruby and Perl, especially in the last six months, however I do know all three languages, and anyone even the slightest bit familiar with Ruby will tell you this is a horrible article.
:-)).
:-)
First off, it tries to present itself as an "article for pogrammers" that is supposed to cut right to the chase for programmers who all ready know other languages. Instead if does just the opposite and shows us *none* of the useful features of Ruby _at_all.
If you want a *good* introduction to Ruby, read this book available for all on Ruby Central:
http://www.rubycentral.com/book
As far as the claims that Perl, Python, and Ruby are "hacked together languages", the person making these claims either has no experience with the languages, or is just flaming (probably both
Python:
Python is considered by many to be the most elegant language even designed. While syntax is a matter of preference, I think most people will agree that Python really got it right. Since I can't go much more into this without getting into personal opinions I will just say that Python has an *incredible* amount of high quality modules/libraries some of which are:
PyGame:
http://www.pygame.org
PyOpenGL:
http://pyopengl.sourceforge.net
Pickle:
http://www.python.org/doc/current/tut/tut.html
Perl
While I personally wouldn't consider Perl the best designed language for_general_purpose_programming, it *excels* at text processing, system administration, and CGI scripts, which are what it was originally designed for (well maybe not the CGI sciprt part).
Ruby:
Ruby is a cross between the convenience and quick hack potential of Perl, and the clean design and pure OOP of Smalltalk (without the strange syntax). I can not really judge it accuratley because it is not as mature as some other languages and the modules/libraries are not all in place yet. However it is not poorly designed.
Being able to pick the right language for the right problem is essential to being an effective programmer. I wouldn't use Python for a device drive, but I wouldn't use C for a mail client either.
I don't see how anyone can call themselves a hacker (or even a programmer for that matter), is they only learn two or three languages.
However I feel a rant coming on so I will retire to my Emacs buffer.
That's bunk. There's nothing other than what is "acceptable usage" in a coder's mind that makes something a "normal" or "scripting" language.
Well, in the case of Smalltalk, most implementations I've seen live in their own environments rather than interacting with the native command line. This makes them more or less useless for "scripting" in the normal sense where you call a script from the command line and pipe data into a script and output results on stdout. For example:
neatoScript < data.txt > processedData.txt
Perhaps you don't have to do such tasks in your own work, but that's what scripting languages are used for.
Nice try, Plastic-Man, but that's too much of a stretch even for you.
OTOH, beware of teachers who know too many languages. My Java Programming professor last semester also taught the VB programming class. He would often forget which class he was in and start writing VB in the middle of a block of Java.
Not a typewriter
Clearly you aren't a Java programmer. If you want to do multiple inheritance, what you most likely really want to do is share some utilities across several class hierarchies. This means you want a utility class, if you want things to be clean.
What you should do is declare an interface which exposes various properties which are needed to perform the utility operation. Then create a singleton which you pass in object of the interface type.
Presto! Code in one place can be modified to support multiple classes. Inheritance is used for what it is supposed to be used, and maintanence is easy.
-jon
Remember Amalek.
I haven't wrote anything in ruby but it looks much messier than python. There's all those $&!'s just like in perl. Python's forte is extremely clean and readable syntax. As for mixture of OO and procedural - doesn't ruby mix these two also? As in, unlike java where everything *has* to be instantiated from a class, and we know how over-the-top verbose that is. Special cases? Could you elaborate, I haven't seen any special cases, after all, "explicit better than implicit' is the mantra of python. Let's not forget clear advantages of python over Ruby, either: much more documentation (for all skill levels), many books available and many more are being worked on (over 30 as I heard..), and more comprehensive standard lib. In response to the original poster: Don't worry about there being a lot of languages. The hard part is learning how to program - and you chose the best language to start with, imho. Once you are a good programmer, picking up a new language is fairly straightforward (especially a well-designed one like ruby).
Python 2.1 (#1, Jun 20 2001, 17:56:17)
[GCC 2.95.2 19991024 (release)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> 'Python also has this feature. ' * 3
'Python also has this feature. Python also has this feature. Python also has this feature. '
RIGHT ON. MAN, I wish I had some mod points!
First I learned BASIC, but this was basic, so I moved on. Then came HTML and now I have a web page floating around, but there was no real reason to go beyond that. School taught Pascal, so I learned that. Then came C++. That was interesting. OOP was new to me, so I read some books and tried some new things. College came and they put me in a class which asked of me a certain knowledge of Java that I didn't have. I met someone else who was in the same situation. I had some fears but I said that knowing C++ would make it easy. It did. He failed. I didn't understand why. I thought that maybe I was wrong. Maybe different languages are hard to learn. So, someone told me that Assembly was difficult and interesting. I read some more books. It was not all that unlike what I had been trying to do in my other programs. I like Assembly a lot more than some of the other languages that I know. Now, I cannot say that I have real world experience in any of these languages, only school and private learning. But, inasmuch as I can see, it would not be that hard.
Again, however, I was afraid. I went to my job one day and they said they needed some VB program fixed. I told them I would do it. But they looked at my resume and didn't see it on there. So, I thought that maybe I was wrong. Maybe I shouldn't be able to fix something in a language that I have never really used before. Once the job was done, I realized that they were wrong.
Since then, I have been looking through the many people at my school for anyone who thought these same things. I couldn't find them. So, again, I thought I was wrong. Now I read this post, and my faith is renewed. This is honestly the first person I have ever seen who expressed anything that I have thought. I just wanted to say thank you, Dalroth, for that.
One of these days, maybe some new language talked about here will have some marverlously new way of doing things and I will be glad take some time out to learn it and use it. But for the moment, I guess I must be content to read what is here and learn all of these painfully similar languages. Does anyone out there know of any languages that are interesting and different? Please tell me about them. I am on the lookout constantly, but they all seem to be just like the next one. I guess I will just go back to reading my Assembly book. Sorry for my craziness, but I was excited enough to post for the first time, which means that I was probably not thinking in a manner fit for sharing. Here it is anyway.
Wasnt this an April fool's joke by GvR and LW???
No sig for the moment.
It is important not to judge Ruby on this article.
The content in the article is specifically designed to look like either Perl or Python. This was to generate a similarity that programmers from other languages can understand.
The second one, article in the series looks a lot less like Perl and more like Python. This is due to Ruby being a true OO, very similar to Python.
The third article will (if they let me write it) cover advanced Ruby structures and illustrate them by interfacing with the PostgreSQL database.
The fourth article will cover Ruby/Qt.
If you guys want to see these articles you may want to give some decent feedback on the Developer Works site.
Get your PostgreSQL here: http://www.commandprompt.com/
So does perl. Big fricken whoop. Any light weight scripting language is gonna have that.
Oh wow and if it's that important right a C function for it and stash it away somewhere.
Sheesh.
Haha it's kinda funny all the bangwagon jumpers are gonna have to switch to ruby now.
ho hum
just so you know, the moron AC that you're responding to isn't me (the AC 2 ticks up)
Personally, when I program, I'm not looking for my code to fit some elegant theory. I'm looking for the job to get done as succinctly as possible.
Spoken like a true hacker. But perhaps you are overlooking the fact that brevity and maintainability are two of the most important criteria for "elegance".
I found it ironic you say that because Perl has problem undergone the most intensive language development of any (and the new process probably blows efforts for other languages out of the water)
I don't know what you mean by "language development". To me, developing a language means increasing our understanding of its behavior, or increasing its expressiveness. Perl has been the subject of many superficial enhancements, but practically no rigorous analysis. There is no doubt in any informed person's mind that the best understood programming language is the lambda-calculus, which is a mathematical system that forms the core of all functional languages, incl. particularly Scheme and ML. As for expressiveness, I'm not aware of any Perl feature which cannot be macro-defined in lambda-calculus, and thus, e.g., Scheme as well.
Perl is designed so that you can write it like you almost would speak it
Spoken language is so complex and ambiguous that finding denotational models of even tiny subsets is still and will continue to be for many years a focus of research. When you write a program, you want to be sure that its semantics are well-defined and unambiguous.
But this is really beside the point. What makes you think Perl resembles spoken language is mostly to do with the surface syntax anyway. All serious research into linguistic semantics is done with mathematical models which do not resemble Perl in any way and, indeed, lambda-calculus is one of them!
BH
Fools! They laughed at me at the Sorbonne...!
Maybe you haven't noticed, but Python, Perl, and Ruby all represent objects as general purpose dictionary types, in contrast to the Lisp and Smalltalk approaches.
Beyond that, I have no idea what you railing against. Did I say scripting languages were bad? Did I say people should switch to Lisp? What is your problem?
yeah but C# really is a blatant rip off of java. C# is Microsoft's Java killer. and thats a shame because Java development is open and J2EE is very powerfull.
Sometimes it is better to be obvious and allow future developers maintaining your code to quickly understand it.
K.
K
$salut = $salut * 3 will result in the following: Oh, I am sorry. I didn't mean to warn you... Oh, I am sorry. I didn't mean to warn you... Oh, I am sorry. I didn't mean to warn you... I am sorry but i dont see the point in performing math operations on a strings. Oh, the line noise of Ruby...
I'm just learning python now. There just aren't enough hours in the day for me to learn all of these languages.
-
>Usually the latter turns out to be some baroque conglomeration of features piled on features, creating a very top heavy feeling to the language, while the former classification languages all have a purity to them, e.g. smalltalk, lisp, ....
Have you actually programmed in LISP? There has to be a good dozen and a half unique looping forms in the language. LISP is not "pure," it's the friggin' kitchen sink.
C//
C++ is almost nothing else but a huge hack. It's only strength over other languages is backwards compatibility of a way of thinking with C. Nothing more.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
It's the CLR (common language runtime) part of the whole .NET cloud.
SQL
Not always. IMO, Java built on my existing C++ and Smalltalk knowledge that it didn't really provide anything that Smalltalk (and to a lesser extent, C++) could provide- it was merely a new syntax and was a part of a different business model. For those unexposed to Smalltalk, Ruby has some aspects which may take a while to grok, but for the most part, it builds on my existing knowledge, leaving almost nothing to grok. But in many cases, it's more convenient.
I'm stil trying to get to know how to use Perl, but not just to grok it- it seems there are so many rules for every tiny thing you'd want to do that I've had to keep docs open for anything that departs from print "hello world...";
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
But why should't we spend some time having fun with other languages? We shouldn't because time is the most precious resource. Ignorance of how the small things add up to big things is how people who used to earn good money can have no savings and how people become obese. Two weeks spent on Ruby is two weeks you didn't spend on something else. If we followed Dalroth's advice, we would repeatedly waste weeks at a time on other fringe languages as well. Sure it MIGHT pay off but this is the same logic people are criticized for when they spend money on lottery tickets.
I think that learning to live in a budget is simply part of growing up. There is not infinite money to spend, most cannot eat an unlimited amount of junk food without getting fat, and one doesn't have unlimited time. One has to make hard choices. Why is it so hard to accept that people need to make time budgets, especially in light of research that it is essential to get proper amounts of sleep in order to learn.
Smalltalk isn't interpreted. It's incrementally compiled run on top of a VM. What does that mean? Methods are compiled into bytecode and then interpreted or JITered. This is similar to Java, with the exception that there is no explicit "compile" command.
In a Smalltalk browser, when you save the method you're working on, the method is compiled, and you're alerted to any errors in your code. Now, this compilation takes a fraction of a second, even on 486. It may not feel like it's compiling, but that's only because you're used to having to take the explicit step and running gcc/g++/javac or what have you.
Considering it productive was nearly the same, IMHO, as considering QuickBASIC to be productive.
It shows you've not done more with Smalltalk than "Hello, World" examples. For application level programming, in my experience, Smalltalk is more productive than C++ and Java, given both the Smalltalk and C++/Java programmers are somewhat experienced (at least 6mos). I've been using Smalltalk for a little over a year, and am quite a bit more productive than I am with Java (3mos use), C (4 years, on and off), and C++ (2 years). For one, there are simply not the same amount and magnitude of "gotchas" as the above listed languages/systems.
Frankly, I see C++ as mostly worthless, especially as an application's level language. The STL and other libraries don't let you escape from C++ and it's many annoyances, they just complicate things. I'd much rather be using Smalltalk (or another high-level language like Common Lisp, Ruby, Python) and writing extensions in C when neccesary.
In most Smalltalks and Lisps, there is a call-out interface, such that lib-extensions like those found in Perl, Python, and Ruby don't have to be written. You just tell the system the function signature and the name of the library.
You don't need a 1+GHz machine to run a Smalltalk system for development, or to run a Smalltalk-based app. You're too used to Java, which is still largely impractical for real-world apps.
GUI builders have been a part of Smalltalk for a while. Don't know a date though. Check out Dolphin Smalltalk for an implementation tightly integrated with Windows.
As far as there not being a place in the world for Smalltalk- bah. If you don't want to use it, don't. But please don't spread misinformation because your 20 minutes worth of experience was confusing. I understand some people are set in their ways, and prefer the way they've been doing for years- a contrived, BCPL-based syntax, and a very static, compilation based way of life. That's fine- but I'll continue using Smalltalk and getting my stuff done.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
I noticed this too. I'm curious what schools are pursuing this type of curriculum. When I was in school, it seemed like I was learning a new language for every class. Whatever language was most apropos was (usually) used. Freshman year Intro class? Pascal. Artificial Intelligence? Lisp. Operating Systems? C++ (that's a little odd, I admit.) Embedded Systems? 68K Assembly. Numerical Analysys? Mathmatica. The default of course was good old C, which I ended up doing a fair amount of.
Some other semantic structures that *aren't* in Py/Pl are Smalltalk-like messaging, Sather iterators, metaclasses, blocks and closures (which will be supported in the next Python, sort of supported in current Perls), blah, blah, etc. It's fun! As an aside on the internals, the Ruby GC is a non-compacting generational GC whereas Python & Perl still do reference counting. I have a lot of hope for good code speed in Ruby as it matures.
It was indeed a joke. But I've also heard discussion on the Ruby list that sounded serious about it. And nobody piped up to deny it. So, perhaps, the joke is turning serious.
I think we've pushed this "anyone can grow up to be president" thing too far.
You fail.
nt
That is, for the most part true, but there are languages that make it difficult and some that make it easy. For me, no matter how much I am forced to use it in school, C++ is still a lot harder to express ideas (especially well-designed OO ones) than some of the other languages I know. This is for a lot of reasons, from syntax to manual memory management. Now, it's not that what I want to do is impossible in C++, but there's a lot more crap I have to think about and deal with to get the same basic stuff done.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Interesting then that both Ruby and Python carry along a current version of the Tcl interpreter for use with their repective Tk modules.
Are you kidding? Object foo knowing how to bar itself is quintessential OO. Then you can have object foo2 knowing how to bar itself, or if they're derived from the same superclass & bar can be abstracted a level, move bar up to the superclass. In smalltalk to print an integer, you'd do:
:P
(5 + 4) printNl!
5+4 evaluates to an Integer object 9, which then prints itself.
If object foo knows how to Stringize itself, then foo2 also does!
print (5+4)
and its not that 'print' itself knows how to handle various objects, it merely calls the object's __str__ method, which is clearly polymorphic.
Making a (to the user) generic print function to which you pass a string/integer/character may be passing around objects internally, but if you do that (as in the snipped of python you post) the language might as well be procedural from the user's point of view - the benefits of OO were used in language design, but are lost during the actual language use.
The only 'advantage lost' is the syntatic sugar of using:
OBJECT-IDENTIFIER . FUNCTION-IDENTIFIER (Extra Parameters)
rather than:
FUNCTION-IDENTIFIER ( OBJECT-IDENTFIER, Extra Parameters)
This is an issue in Python (And Smalltalk).
The reason I said its not very OO'ish for an object to know how to print itself, because an object should not implement EVERY specific feature anyone might have thought of.
Do you think every object should implement a 'describe vocally' method, so that you could: '(5+4) say' too?
What about '(5+4) encrypt' or '(5+4) encodeMp3Sample'?
If you simply remove the difference between the notaitons:
f(a,b)
and:
a.f(b)
as it is in LISP, you get the consistency and the power.
However, it makes it a bit harder to find the list of available methods (which can be resolved easily).
Anyhow, Python allows you to:
object.print = my_print
so it can print itself
But the generic print is more OO'ish, because an object should have a minimal set of things it can do, one of them is represent its state as a string. In Python, another is returning a state object describing the state uniquely, in a way that can be reconstructed.
Brainfuck, yet another great contribution to the world of computer science originating on the Amiga.
If we're lucky Amiga OS4 will include a brainfuck compiler in the final release.
It seems that Ruby is a lot closer to Perl than to Python. I can't see why a Python addict would change to Ruby.
Wow, ok so now besides having to take classes on Cobal, Java, C, C++, Pearl, Python, and Assembly I would of had to learn this one now. That makes me glad I changed my Major to Computer Engineering.
It's not the OS it's the user that sucks. If it's user friendly, you get stupider people. - clinko
Never underestimate the power of backwards compatibility. It worked for C++, and it worked for WinDOS.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
> Um, show me another language that features attributes.
C++ with Qt.
This article is a good introduction, as advertised. The The Pragmatic Programmers Ruby Guide is an excellent book on Ruby as well.. but for a really nice book on Ruby, go to Ruby User's Guide. It is a translated book from Japanese, and since the Japanese had Ruby 7 years before we even heard about it, it out to be good.
I don't like ruby mabey it's because of the name or that i like perl and python and C++ but for some reason it just seems lame to me that some language can just like say it's as good if not better then ALL thouse.. i think that with perl python php sh and C++ you can get really anything done ^_^ so why have another langauge? besides i'm already learning 3 right now! =]
If i was you, you'd be me and we wouldn't be having this conversation
I used to have great respect for people who could speak multiple languages --I'm off topic here talking about language in general rather than programming in specific. I've got a little anecdote though and I'd like to share it.
I moved to Asia from California in my early twenties looking for fame and fotrune and sleazy discos. In the latter, I met all these cute asian babes who could speak three or four languages on average. As an American I was so impressed by this. I assumed these lurid disco dollies were really on the ball. Over time, I realized how far from the mark I was and how totally disconnected language skills and intelligence were.
I knew girls who were raped and beaten repeatedly and I made the mistake of trying to step in and act all righteous like an American boy thinks he oughtta, but boy did I find out the hard way that my assistance was not welcomed and even led to hostility from the victims themselves even when they had come to me crying and asking for help.
Fair enough, I learned a bit about the real world and how to detatch myself from other people's affairs --even the cute ones asking for help. I also learned that the ability to memorize languages is not an indicator of intelligence as I understand the term.
Having said this, I'm very proud of my own Chinese and English literary skills and I consider myself a sophisticated programmer although I wouldn't know C code from a chemistry formula.
It goes back to the phrase "to be well read." You know the deal, you can read three books and be well read; wheras you can read variations on the same trash all your life and never make the grade.
It's new and trendy.
Just for the record, SQL isn't a programming language, and doesn't really apply to this discussion.
Sure it has operators, but it's a query language (that's the QL) and you can't actually do any programming in it.
PL/SQL (Oracle) and PL/pgSQL (Postgres) are a different story, though...
Perhaps more demand, but when your supply is huge, more than needed, that higher demand is worthless. Smalltalk is far from as popular as Java, and there definately aren't as many Smalltalk jobs out there. But there also aren't as many Smalltalkers- so it's definately not impossible to get a job doing Smalltalk. Incidentally, Smalltalkers tend to make more money than Java and C++ coders, which are a dime a dozen now-a-days.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
I think the reason perl has its own /. logo is because Taco and company code in perl
No sig for the moment.
Hey, you are using the wrong association. Stability does not guarantee popularity (besides, Linux is still playing catchup), but productivity can. I don't think I am more productive using Linux instead of Windows, especially with desktop apps, despite that the latter crashes more. Smalltalk came before C, yet didn't grow up as much - if you don't think productivity is an issue, please tell me the reasons behind of SmallTalk's failure (bad luck doesn't count).
¦ ©® ±
here.
-... ---
I don't understand... do you have a ruby or a ruby Jon Katz that you want him to eat?
I guess we should be all using FORTRAN. We are, after all wasting our time with C/C++.
I have to say that Ruby really DOES have a "BASIC odor" to it, but this is merely a superficial similarity in the "feel" of the language, rather than a meaningful statement. Ruby does indeed bring to mind my first QBASIC programs, but i am sure that it is a much more elegant and sofisticated language. (not that BASIC Wasn't elegant... ;-D)
However, I mispelt Smalltalk as "Smalltlak," which is a typo, and would be taken as such by a member of the Smalltalk community. When you mispelled it, it was as SmallTalk, often taken as a sign of ignorance, rather than a simply typo. Why is that? The "proper" way is Smalltalk, but it's pretty usual for people that don't know what they're talking about, who have maybe only read about St on /. will spell it SmallTalk. No one knows why.
So, if it was a typo, my apologies, but that is my reasoning.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
ok now you're just making stuff up. There's a nice command line example packaged with gnu smalltalk & its very clean.
I was about to object to that, but then you wrote...
Thank you for being one of the few to acknowledge that while languages using similar ideas may be easy to learn once you know the first, languages using fundamentally different approaches might take some effort! Sadly few people seem to realise this.
Having said that, I'm afraid I have to disagree with your "one day" as well. You can learn a new syntax in one day, sure. But how long does it take to learn the new idioms? Java and C++ have similar syntax, but Java uses a GC and finally for resource management, while C++ has predictable destruction and uses the abysmally-named-but-rather-neat "resource acquisition is initialisation" idiom. Anyone working seriously in these languages needs to appreciate this distinction, but it's not written down in (m)any of the books.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Unfortunatly you're correct. Their perl-centric mentality is going to keep python/ruby/php icons from appearing here anytime soon.
I can understand not wanting to make a topic icon for every programing language out there (forth, pike, etc.) but after a certain number of postings (4 or so) I think that it would be in everyones best intrest.
Don't hold your breath though...
> and Ruby/Python/Perl all seem to me to have a BASIC odor to them;
>> Now you are really grasping. That claim isn't even solid enough to refute
I decided to conduct a test. I fired up the visual basic development enviornment. I sniffed around the keyboard mouse and the system itself. Then I fired up PythonWin and did the same.
I can report that the odor was in fact identical.
My conclusion: never judge a programming languange on smell alone.
<-- You are here.
And how deep is Ruby's Unicode support? If you can please point me to documentation on using Ruby's regexp engine to match Unicode characters, I would appreciate it.
Here you have an issue of implementation, not design, but at present a legitimate issue. Ruby is a product of Japan, and ironically, from the perspective of Westerners, who generally see Unicode as a sort of peace offering to Asians to make up for the dark ages of ASCII, the Japanese hate Unicode and prefer their own multibyte solution. So, the status of Unicode in Ruby is somewhat primitive at present. However, as Ruby was designed with multibyte characters in mind, it should be much easier to improve the Unicode support than in other languages.
Man, don't be so bitter- it's just Slashdot.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
is here
...which is the same functionality Perl uses. You said it not me, bub!
Which is funny, as Smalltalk itself is really a child of a Lisp mommy getting some unknown, alien artificial insemination. Some put Smalltalk in the LISP family of languages, but those who don't just avoid classifying it. Fascinating, it's family tree.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
$Simplify = $Simplify * 3
KFG
Yer a twit.
Java isn't as open as C#. C# is an ECMA standard.
I would definately agree that it's evolution, however, it's not a controlled evolution pointed forwards, like the evolutions that created Lisp and Smalltalk.
Python, Ruby, and others are adaptations of Lisp and Smalltalk to a way of thinking that people used to C and Unix can handle. Smalltalk and Lisp are too advanced and forward thinking that languages like Python and Ruby have to take a forced step backwards to accomodate those who cannot advance. It's kind of sad in a way, but I suppose it's still a step in the right direction, as there's a better chance of converting C++, Java and Perl people to Ruby than converting them to Smalltalk or Lisp, unfortunately. Better part way than none!
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
You bet they are! Ruby, Perl and Python are putting in terms of a contrived BCPL derived syntax Lisp and Smalltalk. They don't quite embody the semantics fully (Ruby seems about the closest), but as people are too lazy to learn a fully new way, they have to give people training syntactical wheels.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
It's the perfect middle ground between C and Assembly. Check it out.
Cedric Balthazar Rotherwood
Sun Certified Programmer for the Java Platform +
System Admin. for Solaris
No, the next level isn't Ruby. It's Smalltalk. It's Lisp. That's the point your post's parent is saying- if you can move from Perl to Python, why not go all the way to the source, to the acme of elegance and simplicity- Smalltalk or Lisp?
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
No, Smalltalk borrowed ideas from Simula. Other than the idea of classes, Smalltalk derived very little else from Simula. Most everything else came from Lisp.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
That's bunk. There's nothing other than what is "acceptable usage" in a coder's mind that makes something a "normal" or "scripting" language. Smalltalk is equpped with the tools to build large systems more so than most scripting languages like Perl, Ruby, and Python- but out of the box, I'd say it's also more equipped than C++ and Java. :)
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Lick my ass
I'm sure what you said is true; I'm biased against Python for the (of course) whitespace reason and admit I don't know much about it other than from the few times I've started to learn Python, but I think my brain refuses to retain a programming language that has weak typing but has strict whitespace rules. So I'm too unfamiliar with the language to make the statement that you were responding to. thanks for the reality check.
Ruby, Perl, Python, Tcl, C, C++, C#, Java, Smalltalk, Ada, Cobol, PL/I, Algol, Fortran, Forth, Basic, Lisp, PHP, even Assembly language are all for wimps! REAL programmers use "cat > myprog; chmod 700 myprog"
There seems to be something about schools that systematically damps down any enthusiasm for any subject. I'm really glad that programming doesn't feel much like math to me. I used to be enthusiastic about math, but a few years as a math major killed that. Now I avoid it to the extent possible. But programming doesn't feel like math (to me), so I've got a decent job that doesn't feel bad.
... or experiment with trying to link the two in a manner not covered by the C++ standard, and quite compiler specific in Eiffel.)
If you don't feel enthusiastic about something, then it can feel like an imposition to be required to learn something different. It doesn't much matter what. And a new language certainly can qualify.
OTOH, languages certainly do run in tides. There don't seem to be any decent books right now on "Data Structures and Algorithms the C++ way" that aren't primarilly texts. Now I'm trying to switch over to C++ after using a raft of different languages, so most of the introductory books get insufferably dull. I don't want to work through all the drill. Been there, done that. I want a guide on picking things up fast. The best book that I've found so far is "Data Structures, a PseudoCode approach with C++". It isn't really designed as a reference book either, but at least it doesn't stop in the middle of an algorithm and say "the rest is left as an exercise for the student". So I may be able to get my AVL tree working and tested by Monday. (Then I need to decide whether to switch the code over to Eiffel, or recode the Eiffel a bunch of Eiffel in C++
So using lots of languages has its drawbacks, too.
I think we've pushed this "anyone can grow up to be president" thing too far.
Now as for Python .... snake pictures anyone?
Java - Java is a lot more than a programming language, it's a whole omlette of things: language, a VM, a secure run-time environment, a server environment, a micro-device env, etc. Hence, it gets its own logo.
The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
Wow... long post... but it IMHO
CORRECT IN EVERY LITTLE DETAIL...
A serious programmer should always be interested in some new paradigm/language/tool/os/...
Only partly because he will actually USE it on a project, but to learn new things, and see variuous ways to solve problems...
Maybe you will never cody any real-work-application in LISP - but functional programming has areas where is really shines - and learning LISP (as well as learning Ruby/Phyton/Perl/C++/Smalltalk/Objective-C/....) makes you a better programmer.
I was working again within two weeks of being laid off as a systems programmer in a very large well known corporation. Most of the java people I knew are still looking for jobs.
I ate lunch with a recruiter friend of mine last week and mentioned to him that I knew some good java programmers who were looking for work. He groaned and said "please, no more java programmers. There's a huge supply of them right now, they are all losing their jobs, and nobody wants them anymore now that the dot coms are mostly dead. If you know any Unix / C / Perl people though, let me know. I always need them and good ones aren't easy to find".
Java hasn't "won" anything. Java has had a lot of money in advertising spent to convince pointy haired bosses that it is the wave of the future. There was briefly a huge demand for Java coders as the dot coms hit their boomtime. Business to business e-commerce was the "wave of the future" and Java was the language of that future.
Now even the large successful business to business companies that already had clients are struggling. The small ones are all dead or dying. There is a huge oversupply of Java coders who learned Java from a Learn Java In 21 Days book to take advantage of the boomtime, and the good Java programmers are getting lost in the flood. The word "Java" leaves a bad taste in many people's mouths, as it is now associated with the failure that was the web economy.
The tech market will slowly pick back up. Java will find a permanent niche and be used for a good time to come. However, its not all the rage anymore. Its just another language, useful for some things, not so useful for others.
Get over yourself buddy. The Java coder as king of the world, sucking down his $5.00 starbucks coffee at the foozball table in the office recroom days are over.
Hell, it is goofy syntax.
Please: "its goofy syntax" next time, so that yours is not such an eyesore.
No
The context was about "Perl's goofy syntax", so the poster's use of the possessive apostrophe is correct. He's talking about the goofy syntax that belongs to perl, see?
Eyesore my arse....That's why he gets 3 points - and you don't get any.
I don't think I'm very happy. I always fall asleep to the sound of my own screams.
wow.. ppl have horrible memories.. ..
..
..
those were an april fool's joke
parrot is a *JOKE*
joke as in "funny, haha, haha, we didn't mean it"
that's not happening..
baka..
Interesting. Can one of you Ruby or Python elmers tell me if its possible to, say, have the user input an arbitrary snippet of code at runtime
return (foo + bar)
and have the body of the multiplication operator be replaced with this, making it now an addition operator?
Exactly...changing programming concepts is the hard part, syntax is just, well, syntax. Once you learn those parts, its all a nice downhill ride.
"I would say that 99 per cent of what my father has written about his own life is false." - L. Ron Hubbard Jr.
Duh, there is actually a *gasp* reason to use $ or @ at the beginning! But since it doens't look snazy it should be removed immediatly. As long as it looks nifty, thats the important part.
OOOOhhhh!! So Ruby is very similar to Python? Call the fucking LANGUAGE POLICE! Microsoft are trying to do this as well with C# man!! (copying Java and all that)... This should be ILLEGAL for FUCKS SAKE!!
Quick! Before this Ruby thing takes off lets come up with 50283 ways to stop it!! We'll make an OPEN SOURCE version.. yeah!! that's what we'll do !!!
I think it's time for Slashdot to draw up an icon for Ruby topics. This story is about the 5th maybe 6th Ruby related item to appear on /. in the past few months. A simple picture of a good red-ruby you would find in a jewelery store would do fine, such as one of these. Anyone for it? Against it? Got a better pic to use?
The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
So is ruby gonna replace python as the the leading baby language for teenage losers and assorted other wannabe coders?
The key features of Lisp are the use of a uniform notation for programs and data, a notation that makes it very easy to write syntactic extensions, and full support for functional programming. Python 2.1 now has some limited support for lexical closures, but users almost never extend its syntax. The key feature of Smalltalk is its programming environment. As a language, Smalltalk's main feature is the use of very descriptive method and argument names. Neither of those is shared by Ruby.
Python, Perl, and Ruby are nifty little scripting languages, but don't think for a moment that if you are using them you are using the next generation of Lisp or Smalltalk. The object models of Python, Perl, and Ruby are general but slow and memory intensive, their programming environments are oriented towards scripting, not large system development, and compilation to native code, when it exists at all, is of limited benefit. If the scripting languages ever evolve into something like Lisp or Smalltalk, their object models, syntax, and semantics will have to change dramatically and incompatibly.
Name a single feature in C# that hasn't appeared in at least 3 languages prior to it.
Um, show me another language that features attributes.
As far as I know, C# is the first to have them.
It's possible to re-define a class, function, method, etc. at run-time, as often as you'd like.
The thing about Ruby is that, while it looks a lot like languages people are often used to, it has "stolen" these sorts of things from other languages.
I think, basically, Matz is a pragmatist. He's taken everything that other people seem to have gotten right and put them all together ... he's
not finished yet, of course :-).
Interestingly, it looks like Python is going the same way. Every time someone mentions something nice from Ruby, someone from the Python community jumps in and says "that's planned for the next version".
That's definitely not intended as a "we got it right and everyone else is following us" comment. What I mean is that both languages are moving closer together. I believe the next version of perl will have some of these things, too.
I say, play with as many languages as you can and choose one that you feel comfortable and productive with.
While I, personally, hate perl's "line noise", I say if you're happy with that and you get work done, use it. I also say, however, that you should never pick one language and just stop there.
I think that in, say, 20 years, very likely none of us will still be writing in any of the languages we currently love. Of course, C is still around after more than that, but very few people still write in pure C.
If we didn't create and experiment with new languages we'd all still be writing assembler or fortran or cobol.
Now where's that (Score: -1, Just Plain Wrong) option someone suggested?
Certainly C++ suffers from it's hacky nature. But to claim that it offers no other strengths over other languages is absurd. If it didn't, it wouldn't have so many users.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Having zero experience with either, I picked up SQL (Specifically, working with Postgres) and Perl in a matter of days.
:) But, this is because of my experience with other languages. While I'm more of an evil system administrator than a coder, and a good deal of people could put my code to shame (:p), I've got a pretty decent grasp of programming concepts. So all that was left was figuring out where to put semicolons and such.
;P
Syntax was the hard part though.
One thing to note though, true, even if you don't think you will use the language, you're still gaining some benefit. The real benefit is if one day, you *are* required to use the language - in that case, you've played around with it a bit, and can pick the syntax back up with minimal effort.
Besides, there's also the, "My genetalia is bigger than yours!" factor of being able to list a dozen or so languages you know.
Woah, what's this? Some one with a brain? Independant thought? Critical thinking?
Take that shit elsewhere buddy. Here at Slashdot we wanna be told what's "hot" with geeks in the now...
Similiar to Old Navy telling the masses what style they "gotta get this summer", Slashdot tells the geeks what they need to be useing and talking about this summer to be considered "in the know"!
Take your free thought shit elsewhere! j00 sux0rz!
This thread on the python-dev mailing list talks about the unification project (code-named "Parrot" :)
1 -J uly/016406.html
http://mail.python.org/pipermail/python-dev/200
There was also a thread on comp.lang.python about it:
http://groups.google.com/groups?hl=en&safe=off &th= d5fb029bd99759bc,43&seekm=X2Jb7.24637%24C7.967 1673 %40e3500-chi1.usenetserver.com
It seems "hack"-like features are defined as "things that could have been done in a library but ended up as part as the syntax instead".
For example, where Ruby has a * operator for strings and perl has the x operator which does essentially the same, PHP (also a very string oriented language) uses str_repeat().
As far as my recollection of Smalltalk goes, it has one of the most elegant and simple syntaxes I know. What exactly are the hack-like features of Smalltalk, in your opinion?
I do feel like there are people out there that are trying to promote Ruby over everything else just like the Gnome proponents act like they are getting a commission on every convert they get to switch to Gnome. Along with these, we have the people that say all Microsoft stuff is bad. Yeah, I don't like a lot of their software but show me a program (from any source) that can compete head to head with Excel and I will be impressed.
Yes, that was a troll. That is what these promoters sound like as well but they are using the authorized troll buzzwords. Listen to all the opinions but take them with the grain of salt they deserve.
I agree Ruby and Perl seem to be like the latter type. :)
Python, however, is a truly clean, well-designed, quite-pure, strong-typed language.
I wouldn't say it has a Basic odor at all, besides for a built-in 'print', perhaps
Basic is braindead and has no library - instead, it has its entire library built into its syntax in a horrid way.
Python is the exact opposite - many many libraries separated into modular modules, with only flow constructs, OO organization, functions and exception handling built in.
I think a developers productivity has less to do with the language hes using and more to do with how much experience he has with that language
bite my glorious golden ass.
You know, lots of scripting languages are fun and all (TCL, Perl, Python, etc) except for one thing: They each need their own interpreter. So if I have 5 programs that people have written, each in a different scripting language, I need all 5 interperters installed. This is especially annoying on a system with limited resources. Unfortunately, I can't think of a good way to fix this problem. So I guess we will just have to get by with it...
Posted from the wireless couch.
I always like it when dumb-ass cross comparisons
like this are explained in full.
You are what you get when you cross a dumb ass
fat idiot with my foot...
Maybe I'm just jaded, but I don't see what the use of a language is these days without a good DB connectivity library. Did I miss it in the FAQ or the Reference Manual?
FWIW, within a week you'll learn to love whitespace. Yes, it imposes a visual "order" to your code. You'll soon appreciate the consistency: you can look at other code and immediately make sense of it, without having to mentally adjust for the other programmer's weird habits.
--
Don't like it? Respond with words, not karma.
A much more important thing in this kind of competition is whether the programmer can handle the problem. The fact that one person who decided to write it in Ruby didn't get it 100% (and some of them did reasonably well), doesn't mean the programming language is broken.
He/she obviously put a fair bit of time into it (I presume, from the number of entries), but they may simply have not had the right background for that specific task.
I just wish everyone who's posting messages like "why do we need another language" would download Ruby and have a go. Surely, that must have been what people said about C++, perl, java, python at one point.
After doing so, I then wish that if they liked or didn't like it, they'd give specific reasons, rather than wishy-washy ones. You might be surprised by how receptive the developer is to suggestions for improvements to Ruby.
That way, even if the person who tried Ruby and didn't like it never ended up using it, the Ruby community could still gain something.
Not that it matters, but python supports string multiplication also.
If Python was the result of Lisp and C++ having a baby, Ruby is the result of Perl and Smalltalk having a baby.
Trolls throughout history:
Jonathan Swift
I notice strong distinctions between those languages that have been developed by actual programming language researchers and those who hack together a language to scratch an itch.
Usually the latter turns out to be some baroque conglomeration of features piled on features, creating a very top heavy feeling to the language, while the former classification languages all have a purity to them, e.g. smalltalk, lisp, and c.
Some would defend the "hack languages" as a means to Rapid Application Development, but Smalltalk has been shown to be the most productive language, and Ruby/Python/Perl all seem to me to have a BASIC odor to them; I'm wondering if people are afraid to learn a new way of speaking?
There is a DBI module at http://www.ruby-projects.org/dbi/ . There are also a number of DB specific modules. See the Ruby Application Archive ( http://www.ruby-lang.org/en/raa.html ) for a list of other software modules that are available for Ruby.
-- Jim Weirich
So when are we going to see this at ICFP? Oh wait, we already did, all the ruby entries failed.
Well, I see a lot of people complaining as usual... Why should they learn another language? So I thought I would throw in my $0.02 for all a languages (not just Ruby, which I am particularly fond of).
A lot of you people come from what I call the Computer Science Student mentality. This unfortunately something I've noticed as a side effect of the way computer science is taught in most schools. It's quite unfortunate, because that clearly isn't the aim of the Professor's when they are teaching classes this way.
I'll use my school as an example. When I started at the University of Dayton, about 7 years ago, every class was taught in ADA. It was a horrible horrible expierence. The ADA compilers were horribly lacking at the time, and anybody who has done any work in ADA will know that it is an extremely strict and picky language. That has it's good and bad sides when it comes to teaching programming, but I'll save that for a different discussion. I had no problems, since, well, I had a good solid 4 years for Pascal and C/C++ programming experience before I even started college, but this seriously affected the other students in my class.
The problem was, about two years into the program, my school decided (thank god) to switch the department over to C++. This was a great move, because now the students were being taught a language that they could actually apply in the real world (beyond the confines of the Wright Patterson Air Force base anyway). It worked out quite well for the newer students, but my classmates were blindsided. Most of them suffered through half a semester of C (the other half of the semester was 360 assembler) and never even touched upon C++. They should have just been able to pick up a C++ book, apply the concepts they learned from their ADA classes and the syntax from the C++ book and their C course and move on, but most of them had a hard time doing it.
Why was that? They all knew the concepts. They all knew how to write their algorithms, and their trees, and their stacks and queues. Yeah, they weren't taught how to write real software, but they clearly knew the basics. I spent more time helping others learn these concepts than I did doing my own homework the first two years, so I know what they were capable of from first hand experience.
The problem was entirely in their minds. C++ is a huge ugly beast, and it is a bit imposing when you first start. But if you've got two solid years of programming behind you, it should be a relatively smooth and easy transition. Most of them didn't realize this though. They were scared of C++, they were scared of new languages, and they suffered as a result.
The simple fact of the matter is, if you know one language, you know them all. It's not the syntax that makes the difference, it's the concepts that you express within the framework of the language's syntax that are the real guts of programming. My classmates took awhile to realize this (and I'm sure many of them still don't). That's the same thing with Ruby, or Python, or Perl, or just about any language. Unless you are making the jump from procedural to OOP, or OOP to Functional for the first time, you *CAN* pick up a book and learn a new language in a days time. The only thing stopping you is yourself.
Now, the other part of this is, why would you do that? I love learning new languages, and I love learning new languages for a few reasons. These reasons apply to every programmer, and I honestly don't understand why some people are so opposed to learning something new. I guess that's what seperates a good programmer from a bad programmer. So if you want to know why you should learn Ruby, or LISP, or Haskell, or even Visual Basic, I'll tell you why.
1. It helps keep your skills in tip top shape. Perusing a computer manual may remind you of algorithms or techniques you haven't used in a long time and forgotten.
2. You always seem to learn something new. Not some new technical trick that only works in one lanuage (although that definitely happens), but just a different way of approaching problems that sometimes can transcend language boundaries.
3. You may find a new language that allows you to get the job done faster!
4. You're enhanced knowlege of languages looks great on your resume no matter what you use as your primary language.
5. You learn the way other people think. And I don't want to gloss over this one. As a programmer, you frequently have to work with other programmers. Learning new languages is a *GREAT* way to see how other people do things. To learn the way other people think, so to speak. By learning Ruby and Smalltalk, you start to learn why people in those communities are so die hard about OOP programming styles. By learning LISP or Haskell you start to learn why Functional styles even exist! And it all comes back full circle. Techniques I learned from Haskell I now use when writing C++ programs and vice versa. It only made my C++ code better.
Knowlege is power, and learning new languages is one (of many) ways of increasing your knowlege. Go ahead and try it, even if you think you won't use the language, and even if you're just starting out and don't think the transition from your learning language to a new one will be easy. You just might be surprised by how much you already know, and how much you have yet to learn. That's the real benefit of it.
---
Could You Have Passed The 8th Grade in 1895?
Vanguard News Network
..so, what does it offer over Python once you get past "Hello World" * 3?
Is there anyone who can fill us in on why this language is worth using?
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."