Live data from Hacker News

How learning Smalltalk can make you a better developer

techbeacon.com

51–60 of 73 posts

Re: How learning Smalltalk can make you a better developer

#51

Earlier quoted context omitted.

Yes, because you incorrectly presume those are different things that should be separated; in Smalltalk the language and environment are so deeply interwoven to create a live coding experience that what you want is simply the wrong approach, you can't get the correct experience doing what you want. This is a case of "what you already know" getting in the way of learning.

As a young Scratcher, Smalltalk was one of the first languages I tried. Before I even know emacs, or any of that stuff. It's not what I know that's getting in the way: It's what I don't know, and is never explained, because the Squeak docs are TERRIBLE. If somebody would explain how it works, I'd be willing to try. And I just got some new resources, so I'll give it a shot.

I learn Smalltalk a few years ago to port a C++ interactive geometry software (http://drgeo.eu) to Squeak/Etoys then Pharo. I can testify documentation was never an issue, there are plenty of free books to learn from and a very helpful and talented community.

Smalltalk is still so revolutionary in its concepts, I am afraid you have to do your home work to get it and work on the text book.

Re: How learning Smalltalk can make you a better developer

#52

Earlier quoted context omitted.

Haskell has something even cooler. Automatic program synthesis through examples: http://nautilus.cs.miyazaki-u.ac.jp/~skata/MagicHaskeller.ht... For example: f "hi" == "HI" Gives: f = (map toUpper)

From the abstract: > The synthesis algorithm takes a generate-and-test approach: it generates an infinite stream of all the expressions having the same type as f; then, they are tested against the given predicate. I'm really impressed that such a simple approach works. Initially I thought it was something similar to FOIL[0]. FOIL was a program that could learn function definitions by examples. One version of FOIL was…

The Smalltalk mechanism (Squeak/Pharo) also uses generate and test, just FYI.

Re: How learning Smalltalk can make you a better developer

#53

Article very briefly mentions Squeak[0], which I think would be worth looking into if you wish to pursue Smalltalk as a modern language instead of simply a historical footnote. Alan Kay, Smalltalk's creator, continues to contribute to Squeak, which he considers closer to his original ideal of what the language should be than Smalltalk-80. [0] https://en.wikipedia.org/wiki/Squeak

Hmmm, I find this slightly misleading. It was a long time ago that the original Smalltalk creators were involved in Squeak (Dan Ingalls is the main developer, Alan Kay the visionary).

It should also be mentioned that Squeak (and Pharo too) was and still is VERY close to Smalltalk-80.

Re: How learning Smalltalk can make you a better developer

#54

Earlier quoted context omitted.

SBE is so far out of date that many of its details are now simply wrong. GST's docs are actually up to date, organized, and easy to find. However, I haven't seen all of these resources, so thanks for the tips.

> SBE is so far out of date Pharo By Example is being revised for Pharo 5. The first 13 chapters are done... https://github.com/SquareBracketAssociates/UpdatedPharoByExa... The whole book can be downloaded from... https://ci.inria.fr/pharo-contribution/view/Books/job/Update...

Thank god.

Are there any major differences between Pharo and Squeak I should know about?

Re: How learning Smalltalk can make you a better developer

#55

Earlier quoted context omitted.

And how am I supposed to learn all of that? ;). Maybe there's a reason Smalltalk never caught on...

> And how am I supposed to learn all of that? ;). Those who want to learn, do. > Maybe there's a reason Smalltalk never caught on... There is, that wasn't it. The reason it didn't catch on was lack of a free version during the period of time it could have taken off. It cost a fortune and was competing with languages that were free to developers, Java took off instead.

sheesh, I was kidding. I know the real reasons ST didn't catch on.

Re: How learning Smalltalk can make you a better developer

#56

Earlier quoted context omitted.

> Someone who wants to learn Smalltalk should try Pharo or Squeak, not GNU, GNU will just leave them with a bad taste of weirdness for no good reason. As someone who has tried Pharo and Squeak, I was left with a bad taste of weirdness for no good reason. The colorful Playskool environment, while neat at first, was not only ugly and alien, but also quite minimal compared to Vim or Emacs. I still don't understand how a…

If you see programs as a collection of static text files, you're not going to understand, but if you approach it as Smalltalk does, no files, no compile time, see the image as a live runtime, you'll realize you can prototype things via on the fly tinkering faster than virtually any other environment; you don't even need a database as you can just store collects of objects in class variables since it's always run-time…

I'm familiar and reasonably comfortable with the "image" concept from Lisp, but frankly I think outside of prototyping it's an inferior way to program.

When you're doing some sort of exploratory/experimental programming or trying to incrementally prototype some program, the ability to modify a live environment is fine, but it's only just barely better than coding in a file, and only because it saves you a small amount of time.

But once you're ready for distribution, images have a ton of drawbacks. For example:

* The running image is either particular to some physical machine, or it's constrained to a virtual machine, leaving you to pick one of portability or efficiency.

* I have to believe that there's some way to remove the development environment from the final image, but I didn't find a way to do that with Squeak when I tried it -- if there's really no way to do that, then suddenly your production image includes a full development environment in addition to your application, costing you and your customers unnecessary storage space, memory, and bandwidth.

* There's also a question of how well the environment within the image can communicate and interact with the host environment -- from the end user's point of view, it looks and behaves differently from everything else they use; how is it for the programmer?

The biggest problem with the image-based development style is reproducible builds. If your application has been created by incrementally tweaking a live environment here and there, how do you make that reproducible? How can you then save all the necessary code and data to recreate that state from a fresh image? Lisp solves the issue by supporting the file-based paradigm in addition to the image one, with constructs like LOAD, COMPILE, and COMPILE-FILE. At a higher level, Lisp also has a notion of "systems", which can be defined in a file and describe how to map a set of files to a final product (c.f. ASDF). Even in Lisp, however, you run the danger of forgetting about some change you made to the image and forgetting to include it in your source files. How would you do any of this in Squeak?

Along the same lines, how would you work with source control? Checking an image into git doesn't seem like an ideal solution.

In regard to code organization: files let developers organize the code however they feel is best, not the way some browser author decided is best. The idea of cohesion isn't just a sound engineering principle -- it's also a sound stylistic principle that can aid understanding of a system. Furthermore, a good text editor can help with navigating, exploring, querying, and processing text as well. Text editors aren't somehow limited to only enabling writing -- they have features to assist in reading and comprehending text, too.

I, for one, never felt more productive in any Smalltalk-type environment I've ever used, and such a development model seems to have quite a few drawbacks in exchange for only very few, very minor advantages.

Re: How learning Smalltalk can make you a better developer

#57
post #34

Earlier quoted context omitted.

> Someone who wants to learn Smalltalk should try Pharo or Squeak, not GNU, GNU will just leave them with a bad taste of weirdness for no good reason. As someone who has tried Pharo and Squeak, I was left with a bad taste of weirdness for no good reason. The colorful Playskool environment, while neat at first, was not only ugly and alien, but also quite minimal compared to Vim or Emacs. I still don't understand how a…

The article explains how you can be productive. It's mostly in the "live coding/debugging" environment, which dramatically shortens the edit-test-debug cycle. The low cognitive friction of the language itself is also preeminent. The clutter-free Smalltalk IDE is one its main selling points. I've used Xcode and Eclipse and Visual Studio, and the Smalltalk IDE is a breath of fresh air. Beauty is in the eye of the behol…

> Beauty is in the eye of the beholder

I think this is what it comes down to in the end. I don't find anything about it beautiful, from the aesthetics to the workflow to the isolation from the rest of the system. But I'm coming to realize thanks to the massive response to my comment why someone else might find any or all of those things beautiful, so thank you for that.

I find it interesting that you compare it favorably against Eclipse, considering that Eclipse is a direct descendant of IBM's VisualAge Smalltalk environment. Would you mind going into more detail why it is that the Squeak or Pharo environment is better for you than Eclipse?

> In practice, you don't need the full power of Vim or Emacs in a programming environment where you're ever only dealing with small methods and where everything is laid out neatly in the System or Class Browser. I love Vim, but I don't miss it here.

I disagree, and I think that dealing with a well-organized codebase composed of cohesive modules each containing an array of small methods (or equivalent) is an area (though far from the only one) where Emacs and Vim shine, especially when making use of multiple buffers, windows, netrw/dired-mode, wildmode/wildmenu, something like ctags/etags, registers, marks, ... the list goes on and on. I have a feeling that if you're not missing Vim or Emacs when using the Squeak/Pharo environment, you likely weren't making full use of Vim's or Emacs's power (which is excusable, given the learning curve of the those tools).

When I say that I've been using Vim for over 10 years, the implication is not that I've just been getting used to it for 10 years, it's that I've been constantly learning it for 10 years, and even now not a month goes by where I'm not able to more fully utilize its power than before. The only environment I've found that's more powerful/productive for me than Vim has been SLIME with Emacs (I've recently found out about SLIMV and am looking forward to giving it a try, though I tend to have an aversion to using plugins in Vim).

In the end, though, I think what it comes down to is the different emphasis on the environments. Whereas Vim and Emacs emphasize navigating and manipulating text, Squeak and Pharo emphasize navigating and manipulating a live environment. I personally loath that style of development because I'm lacking tools to track changes to the product and tools to reproduce the product from a fresh image. But if that style of development has been beneficial for you, then of course a tool like Vim or Emacs isn't going to cut it. To each their own, I suppose.

Re: How learning Smalltalk can make you a better developer

#58

Earlier quoted context omitted.

> Someone who wants to learn Smalltalk should try Pharo or Squeak, not GNU, GNU will just leave them with a bad taste of weirdness for no good reason. As someone who has tried Pharo and Squeak, I was left with a bad taste of weirdness for no good reason. The colorful Playskool environment, while neat at first, was not only ugly and alien, but also quite minimal compared to Vim or Emacs. I still don't understand how a…

> The colorful Playskool environment That was likely Squeak, not Pharo. Pharo has muted a lot of the UI colours to be more appropriate for a business environment. > How anyone could possibly be productive in such an environment. What is it that's so attractive about it to Smalltalkers? Perhaps its useful to get some outsiders perspectives.... Avdi Grimm has written a few books about Ruby. He records his experience tr…

> That was likely Squeak, not Pharo. Pharo has muted a lot of the UI colours to be more appropriate for a business environment.

I've used both. Yes, Pharo is considerably more professional-looking, but it's still rather ugly and alien (as in, it looks very odd when juxtaposed with the other applications running on the host system).

> Avdi Grimm has written a few books about Ruby. He records his experience trying Pharo in "I make you hate Ruby in 7 minutes"

Does it normally take 7 minutes to write "hello world" in Pharo? If so, that doesn't sound productive to me at all. Really, the only thing I saw in that video that made me feel envious in the least was the exemplary method search. But you don't need an environment like that to have exemplary search; I've been told Hoogle offers something like it for Haskell, for example.

Apart from that, I was pretty unimpressed with most of what I saw in that video, to be honest. The class browsing didn't seem particularly different from what Eclipse has to offer (which should be unsurprising given Eclipse's heritage in IBM VisualAge Smalltalk). The debugger didn't seem to be anything special -- it looks like a debugger. Going further, the heavy reliance on the mouse and the floating/stacking model of window management seriously cramp my style and slow me down.

Even as a language, I don't see what Smalltalk has to offer the programmer when compared to other languages. Yes, it's nice- and clean-looking. Yes, it was hugely influential. But it forces you to build your entire application out of nothing but objects and methods belonging to them, and cannot offer the flexibility of a multiparadigm language. Even as a strictly-OO language, it limits you to single inheritance and single dispatch. What other tools does it offer for creating and composing abstractions beyond its degenerate notions of objects and methods? Perhaps in 1980 it was an excellent choice, but we've had better choices since the 90s rolled in.

I've got enormous respect for the likes of Alan Kay, Dan Ingalls, L Peter Deutsche, and their whole crew at PARC. They certainly made history and have had a great deal of influence on our field. Notwithstanding, they were not alone in their innovation, and their product was not and is not perfect. Perhaps nothing will ever be perfect, but I feel as though Smalltalk has been surpassed at this point in time.

Re: How learning Smalltalk can make you a better developer

#59

Earlier quoted context omitted.

> The colorful Playskool environment That was likely Squeak, not Pharo. Pharo has muted a lot of the UI colours to be more appropriate for a business environment. > How anyone could possibly be productive in such an environment. What is it that's so attractive about it to Smalltalkers? Perhaps its useful to get some outsiders perspectives.... Avdi Grimm has written a few books about Ruby. He records his experience tr…

> How anyone could possibly be productive in such an environment. What is it that's so attractive about it to Smalltalkers? Now you've probably heard that in Smalltalk everything is an object. Sure its an nice catch-phrase but hard to grasp its significance. Consider then, that classes and methods are live objects within the Image. You can operate on them as you work within the live Image and from your application pr…

That's pretty neat. Thank you for taking the time to write all this up.

That said, you can get the same kind of flexibility in Lisp or even Lua, among others, and I'm having a hard time thinking of a use-case where such a thing would come in handy.

Re: How learning Smalltalk can make you a better developer

#60

Earlier quoted context omitted.

If you see programs as a collection of static text files, you're not going to understand, but if you approach it as Smalltalk does, no files, no compile time, see the image as a live runtime, you'll realize you can prototype things via on the fly tinkering faster than virtually any other environment; you don't even need a database as you can just store collects of objects in class variables since it's always run-time…

I'm familiar and reasonably comfortable with the "image" concept from Lisp, but frankly I think outside of prototyping it's an inferior way to program. When you're doing some sort of exploratory/experimental programming or trying to incrementally prototype some program, the ability to modify a live environment is fine, but it's only just barely better than coding in a file, and only because it saves you a small amoun…

>I'm familiar and reasonably comfortable with the "image" concept from Lisp,

I'm primarily a Schemer, so correct me if I'm wrong, but lisp, at least since the death of the lisp machine, doesn't have an image: it has a live environment in RAM, and there's no easy way to dump that to disk. It's just a REPL.

>I have to believe that there's some way to remove the development environment from the final image, but I didn't find a way to do that with Squeak when I tried it

You certainly can, presumably just by stripping them out, but I'm not 100% sure, as I've never tried. MIT did it though, back in the days of squeak 2.X, leading to MIT Squeak, which is Squeak stripped down to just the bare necessities to develop Scratch. They didn't remove the class browser, workspace, transcript, or debugger, but I imagine it wouldn't be too hard, and besides, if there was a problem with your code in production, you'd want them there.

>There's also a question of how well the environment within the image can communicate and interact with the host environment -- from the end user's point of view, it looks and behaves differently from everything else they use; how is it for the programmer?

Squeak's got an FFI, and has binding for network access, etc., but one of smalltalk's greatest failings is its inability to play well with others. Scratch 1.X is probably the best example of a Smalltalk UI in action that you'll see, and you can see how foreign that looks.

>The biggest problem with the image-based development style is reproducible builds. If your application has been created by incrementally tweaking a live environment here and there, how do you make that reproducible? How can you then save all the necessary code and data to recreate that state from a fresh image?

And this is where the misunderstanding stems from: The image is a live environment, yes, but it is also your entire application, and your source code: When you hit 'save' in a smalltalk image, all of your code, as well as a snapshot of the state of every single object in the system, is saved to disk. There is no file to forget to add things to. If you added it live, it's in your system, same as if you'd typed it into a text file in lisp.

>Along the same lines, how would you work with source control? Checking an image into git doesn't seem like an ideal solution.

It's not. Which is why Smalltalk has its own version control system, and (I believe), a git bridge, allowing you to save only your classes, your projects, and what you've changed to a repo, and download them to other images.

>In regard to code organization: files let developers organize the code however they feel is best, not the way some browser author decided is best.

You're still thinking in terms of files: In a smalltalk vm, the browser isn't organizing files: it's organizing classes. And you can sort those classes into packages, and the methods into protocols. Not perfect, but pretty good.

>Furthermore, a good text editor can help with navigating, exploring, querying, and processing text as well. Text editors aren't somehow limited to only enabling writing -- they have features to assist in reading and comprehending text, too.

An ST environment can query, navigate, and explore the objects that text represents, and tell you far more about what your code is doing that any text editor.

Post reply on HN