8 ms·
Smalltalk vs. Scheme, JavaScript, and Java
- Lordarminius 10y agoAnother acerbic article from Richard Eng critiquing javascript. Granted that javascript is inconsistent and poorly designed. But what does he expect a beginner programmer to do? Learn a language has neither widespread acceptance nor community support, in an attempt to get away from javascript's deficiencies? Even Google could not wean sophisticated programmers (who appreciate the issues way better than I and many others do) away from javascript despite its incredible efforts. I for one am interested in getting the job done quickly and as painlessly as possible. I dont make the tools I just use them. Thoughts anyone?
- throwaway7645 10y agoAll good points. Personally, its an idealism versus practicality argument. I personally believe (take this with a grain of salt) that we should deprecate awful languages like JS if there is truly a better alternative out there that gives superior power, ease of use, and safety. The economist in me points out that this would've already happened had they really been that much better. Kind of like one-hit wonders like "ice-ice baby" are actually not crappy songs but amazing works of art according to the masses. Maybe one day P6 will get optimized and polished enough to where all users of (P5, Python, Ruby, and TCL) say "I want that" and switch. Individuals might do that. Companies are more like glaciers.
- dri_ft 10y agoI don't think whether or not it happens (or has already happened) depends solely on whether the other languages are better. Isn't it a lot of it a co-ordination problems? People want to write in the languages that are widely used and have a lot of libraries; people write libraries for languages that are already widely used; that sort of thing? You're right about Ice Ice Baby, though.
- dgreensp 10y agoI see it as popularity vs merit. A lot of things feed into popularity, like familiarity and network effects. Also, you can be popular by appealing to the sentiments or taste of the masses or influencers, regardless of merit, unless there are strong corrective market forces.
- throwaway7645 10y agoHaha, you're right that there is a chicken and egg problem, but if DART was really an order of magnitude greater than JS, there would be a lot more DART programmers after this many years.
- paulddraper 10y agoYou don't need to have thousands of others appreciate Ice Ice Baby and create an ecosystem of libraries and tooling around it. But a successful language requires those things, for the masses (not the early adopters). That creates glacial inertia, even for individuals.
- paulddraper 10y ago> Even Google could not wean sophisticated programmers away from javascript despite its incredible efforts. Not sure what you mean. Angular 2 is typescript-first.
- gokr 10y agoWell, I agree that the article can annoy some people. But... as an avid Smalltalker with a LOT of experience with it - and a lot of experience with Javascript too (and tons of other languages) - there is a "truth" in here. Smalltalk is immensely cleaner and gives you IMHO a much deeper more gratifying experience working in it. Yes, it's OO all the way, while Javascript is... well, not sure what to call it these days ;) A hodgepodge perhaps. But the real magic in Smalltalk is in the live environment. It all boils down to the Right Tool for the Right Job. If you are looking for a really powerful tool for abstraction and working interactively with advanced domain models, often using meta capabilities - then Smalltalk totally rocks. The more advanced, the more it shines. But of course Smalltalk has its negative sides too, and it depends on your specific use case. It's (if we consider the Cog VM which is the most common one) pretty fast, but comes short of V8. It can interoperate with other languages, but it's not as easy as in some other languages. It has a decent community, but not as large as Javascript/Python/Ruby. And so on. But when your use case fits - it's really good. So my advice is learn many languages, it will make you a better developer, and its fun! <promotion>Personally I am trying to evolve Smalltalk by merging it with ideas from Lisp, JavaScript and Rebol: sprylang.org</promotion>
- horrido 10y agoJava is currently the most popular language in the world. There are far more job postings for Java than for any other programming language. Java is the enterprise standard language. Java has a tremendous ecosystem and a vast user community. Java is pretty much unassailable. However, in 1995 Java was nothing more than a hopeful upstart from Sun Microsystems. There were no job opportunities for it. It had no ecosystem to speak of and relatively few users. Performance-wise, it ran like a slug (today, the JVM is well-optimized). How did Java achieve today's status? To a large extent, it was thanks to Sun Microsystem's marketing efforts. People were drawn to the promise of "write once, run everywhere." They also liked that Java was a fairly simple and easy-to-learn language. In time, Java developed a large community and widespread usage. The point is, all programming languages have to start from zero. They either grow from grassroots, or they grow from corporate sponsorship and marketing. Incumbent languages with their large ecosystems and user communities eventually yield to newer languages with their promise of greater ease, productivity, flexibility, power, etc. Getting the job done is important, but one should also look to the future. That's the hope of languages such as Go, Swift, Dart, Julia, Rust, Elixir, Smalltalk, and so on.
- throwaway7645 10y agoInteresting how he critiques something cryptic in Scheme and doesn't show the Smalltalk equivalent. One thing that should have its own full section is performance as it is slower than Java, compiled Scheme, and I'm guessing V8 optimized JS. I know the whole hotspot JIT thing was maybe pioneered in Smalltalk though? I do like certain things about Smalltalk (Pharo looks nice), but it is hard to do certain things with it like a GUI. Well I mean it is hard to find out how to do that....not necessarily hard to implement.
- chriswarbo 10y ago> I know the whole hotspot JIT thing was maybe pioneered in Smalltalk though? As far as I'm aware the ideas used in hotspot began with Self[1], which was also the inspiration for Javascript's prototypical inheritance. Strongtalk[2] adapted these to the class/instance programming style of Smalltalk, then Sun bought them for application to Java. [1] https://en.wikipedia.org/wiki/Self_(programming_language) https://en.wikipedia.org/wiki/Self_(programming_language) [2] https://en.wikipedia.org/wiki/Strongtalk https://en.wikipedia.org/wiki/Strongtalk
- throwaway7645 10y agoI stand corrected thanks!
- horrido 10y agoIn the article, I linked to: http://techbeacon.com/how-learning-smalltalk-can-make-you-better-developer http://techbeacon.com/how-learning-smalltalk-can-make-you-be.... This is where you'll see an example of Smalltalk code. Many programmers obsess over performance, but the fact is, in today's computing world, performance is a non-issue in most situations. That's why Python, PHP, Ruby, and Perl are so useful and popular. That's why Erlang/Elixir absolutely rock for concurrent systems. That's why Smalltalk is used commercially around the world. Performance is not the be-all, end-all of computing.
- sebringj 10y agoPlease don't format code with ))))))) at the end for the love of code! Use readable indentation instead as your whole point is to make things look simple to understand. That actually warrants a slap the back of your head from a team of onlookers, one at a time.
- pg314 10y agoThe collection of closing parentheses at the end is considered good style for all of the Lisp languages I'm familiar with (Scheme, Common Lisp, Elisp). Here's an example of the style in a file from the SBCL implementation of Common Lisp: https://github.com/sbcl/sbcl/blob/master/src/code/bignum-random.lisp https://github.com/sbcl/sbcl/blob/master/src/code/bignum-ran... Any decent editor will balance the parentheses for you.
- actsasbuffoon 10y agoOnce you look at enough of it, your brain starts to see lisps differently. The parens fade away, and you mostly just see the indentation. It looks a little like Python once you adjust.
- peatmoss 10y ago
- qwertyuiop924 10y agoTo the contrary, Scheme's prefix notation reads quite well, particularly if you use indentation well. But that's just my opinion. Several of the statements in this article about Scheme are, however, objectively wrong. -Scheme isn't functional. It makes no effort to control side-effects, and a lot of Scheme is heavily stateful. In fact, the very Scheme example you wrote isn't functional at all! -Scheme isn't uncomfortable for OO. Multiple OO frameworks have been written in Scheme (most of them based upon CLOS), and many of them are very comfortable and quite excellent. If you don't like multiple-dispatch functions, it's also possible to implement smalltalk-style object-message syntax (and indeed, people have done so). In fact, if you look into the history of Scheme, it was orginally written by Sussman and Steele to help them understand the Actor Model, which is quite similar to OO: a program is modeled as many stateful actors, which can only communicate through messages. Finally, the "confusing" Scheme code in this article is not very well written. If you split the definitions like so, it becomes much more readable (also, vector-map! is already defined in many schemes, so you don't even have to evaluate the top part): (define (vector-map! f v) (do ((i 0 (+ i 1))) ((= i 0) v) (vector-set! v i (f (vector-ref v i))))) (define (make-matrix rows columns) (vector-map! (lambda (a) (make-vector columns)) (make-vector rows))) Again, there are several common extensions (in various SRFIs) that would make this even cleaner. In the upcoming R7RS-large (the Red standard, which has these functions, has just been released), I would merely need to import one library, and vector-map! would be defined for me, as is already true in many implementations.
- mpweiher 10y ago> Scheme isn't functional. "Scheme is a functional programming language ..." -- https://en.wikipedia.org/wiki/Scheme_(programming_language) https://en.wikipedia.org/wiki/Scheme_(programming_language)
- Johnny_Brahms 10y agoWell, the style in which most people write scheme and you are encouraged to write scheme is functional, but it is very much a multi-paradigm language.
- 10y ago
- zengid 10y ago>>[Smalltalk is] the perfect instructional language for teaching programming to both children and adults alike. It’s very easy to learn and extremely versatile... Where's the data to support this? Has anyone done a randomized double-blind study on new programming students using smalltalk vs groups using Scheme, JS, or Java? Why is someones biased opinion enough to justify this claim? We need to hold ourselves to a higher standard than to accept unsupported arguments (meaning they havent been tested empirically) [1]. [1] https://www.youtube.com/watch?v=uEFrE6cgVNY https://www.youtube.com/watch?v=uEFrE6cgVNY
- agumonkey 10y agoJust curious, have you learned ST ? I went through a good deal of languages and I have to admit, ST surprised me more than expected and mostly positively. I don't like the smug some STers glow when they talk about REALOO but except that it really has some exceptional qualities (self consistency, humane interface, small size of the basic system).
- zengid 10y agoI haven't learned ST yet but look forward to someday; currently I'm learning a bit of Ruby. I don't doubt that it is an excellent language, but is it actually easier to learn without any prior programming experience, or is that claim it just based on opinions?
- agumonkey 10y agoI don't know any methodical study, so it may only be opinions. That said, after suffering years of bad language features, you feel weird when one actually delivers on some bold claims. Smalltalk is not even a language, it's a system, a self contained system that is quite small, consistent, yet somehow devoid of ceremony (FP languages are small, but one has to read through the culture, ST stay low in intellectualization). I don't see many of the things that tripped me up as a noob, and lots of stuff that I ended up seeing as valuable (how booleans are defined for instance).
- 10y ago
- dgreensp 10y agoI see mostly criticisms unrelated to SmallTalk. Scheme: Show me the code comparison. How is FP vs OOP relevant, even if true? JavaScript: How is the comparison to Lisp relevant, especially after the preceding? Author just chose some appealing praise of JavaScript to tear down. Java: This reduces to an argument you should consider SmallTalk at all for systems programming.
- throwaway7645 10y agoI think a lot of his points still stand though with ST being elegant in a lot of ways and relatively easy to learn.
- allengeorge 10y agoI found the critique unconvincing, especially since I don't see any Smalltalk examples in the article to support his position. Not I that I doubt there are languages better than both JavaScript and Java.
- webwanderings 10y agoSince it is addressing beginning programmers, I would like to add my take. I'm not a programmer but I have many years worth of computer experience. Programming never appealed to me because it never came naturally. Lately I (once again) started paying attention to programming and started looking around. I went from one e-book and MOOC to another with much of the python hype (previously in my - failed - attempt, I tried Perl, PhP etc, when they were in vogue). Well I have eventually concluded, that the problem with programming is not necessarily me, but it is the lack of proper padagogy itself. There are programmers galore out there trying to teach via YouTube and MOOCs, but most are code monkeys who know what they're doing but I wouldn't call them "teachers". So my search eventually led me to Scheme/Racket where I see some signs and hope of proper learning (I'm not going to be able to afford myself to take a college level CS). I looked into Small Talk as well but as of now I don't see a proper MOOC on it. I have started Racket course (BSL) on EdX. After spending much time and energy chasing Python basics and going nowhere, i feel I can possibly and eventually learn programming the way it is meant to be.
- horrido 10y agoTry this Pharo MOOC: http://files.pharo.org/mooc/ http://files.pharo.org/mooc/ The actual course is over, but all the course material is still available. It's an excellent resource.
- webwanderings 10y agoIt's in French; adds a second level of difficulty due to language difference.
- horrido 10y agoThe material is available in both French and English. The videos have English subtitles. There is no language difficulty.