Domain: object-arts.com
Stories and comments across the archive that link to object-arts.com.
Comments · 18
-
Re:Dynamic typing in Smalltalk
That above comment was quite inciteful!
For those who haven't programming in a dynamic language such as Smalltalk: Dynamic type doesn't equal no type. Nor does it mean non-declared variables
for example in Smalltalk:
|ar | "Mandatory declaration of ar"
ar := Array new: 10. "creates new Array with 10 nil entries"
ar at: 1 put: 20. "puts 20 at position 1"
ar then has class of Array.
This can be verified by displaying:
ar class will return Array
Running in a debugger will also verify it.
Later could do:
ar := 'Hello World'.
ar class will return String.
(The array would be garbage collected if nothing else pointed to it.
And with languages as dynamic as Smalltalk or Ruby you can also add methods to any class. Even add to Array and String.
You can even add them at runtime if you are so inclined. (personally never had to do it).
Want to re-define a loop? Go ahead it isn't a fundamental keyword a'la C like for ( ; ;) { }
Want to stuff different types into a collection? Go ahead, as long as particular function you want to traverse collection with is supported.
The other critical component of using a dynamic language, as has been pointed out, is unit testing. For example, I can run a test on all methods starting with 'test'. Like 'testString'. Just add method and it will be added to test suite. And will check as many diabolical edge cases as you like. Pick your level of paranoia: Run test suite every day, every hour, or every time you commit a method.
Unit tests let you take bigger risks. The reason codebases stagnate is not due to fear of creating bugs: every developer does it. The better ones probably create more. The reason is fear of NOT KNOWING if you created a bug. That is why unit testing encourages experimentation and ultimately better code. Static type checking simply 'falls out' of unit testing, but it is a minor win compared to the edge case exercising of each method that has unit test coverage. That is the major win.
If interested, you might tryout the Community Edition of Dolphin Smalltalk.
http://www.object-arts.com/content/mydolphin/d6Dow nloads.html
For windows environment it it hard to find a more comfortable environment. And you will find it is quite fast execution speed as well. They do a lot of clever optimizations (without breaking simple language) to get good speed.
Other languages:
Personally I like a lot about Ruby (especially current popularity), but Smalltalk syntax is way cleaner. I worry the reported execution speed of Ruby apps will prejudice folks against dynamic languages.
"IO" is by far the cleanest language syntax of anything I seen, just fairly new at this point. If it had kept the self-documenting keyword: key method: met syntax: syn of smalltalk, it would be that much cooler.
Of course ObjectiveC might be the cleverest compromise ever: Ansi C plus embedded smalltalk like coding... I believe this is a key reason Apple appears to be more nimble than MS.
And going yet further out on this unsupported limb (it goes without saying someone will shoot me down). Google does quite a bit with Python. I think that being a good dynamic language is a strength and allows them to market quickly with new ideas. However, Python is not AS dynamic as Ruby or Smalltalk (weaker reflection I understand). And in some tiny way, I think this has made it harder for Google to really hone their projects. To me at least Google does a really nice job on initial release of a product (gmail, maps, picasa) but then kind of doesn't fill in some obvious missing functionality. (like saving thumbtacks or waypoints on maps for example). Kind of 1/2 baked theory I suppose.
Actually if you look at history of programming languages after smalltalk, they are ALL re-converging toward Smalltal -
Re:Hype?
it was the first language with reflection designed into its core, and it was the first language to bring OOP, Virtual Machine, and cross-platform capabilities together into a workable package.
As long as you don't count Smalltalk...
-
Re:Cool!
If you really feel that way, you should try Dolphin Smalltalk. It's a solid easy to use quick to get the job done tool for Windows. Its everything you like about C#, and even more so. I don't work for them at all. When I *have* to do windows stuff (which I avoid like the plague), there stuff's great.
-
C & Smalltalk-FORTH Estate.
"Seriously. I know it seems like an odd mix. But C is the OS language. And in learning C, you learn how computers work. You can't escape it. The stack, the memory model, etc."
FORTH.
"A know a number of schools have run successful projects using Squeak and other Smalltalk flavors to educate from primary through college ages."
[Get key from here]
http://www.bitwisemag.com/copy/other/download/down load_dolphin_smalltalk.html
[Get Dolphin XP Value Edition (DVE) from here]
http://www.object-arts.com/Downloads5.htm
Enjoy! -
Here is what the site says-Dolphin.
"I think GNOME/KDE are to Squeak what Apple was to PARC. It's great that you've got an interesting platform to play with, but you need somebody who cares about shipping a product."
http://www.object-arts.com/
---
http://www.alice.org/stage3/projects.html
"The Alice Development Kit is a framework for designing 3D worlds. It is designed to allow the novice programmer, or even the non-programmer, the ability to create fully interactive and responsive worlds."
http://www.dmu.com/croquet/
-
Testing and releasing software-Smalltalk.
Or use a language that allows something like this in approximately 900 man/days for an individual. Working with live objects in an integrated IDE is powerful, and eliminates many of the problems, and tools built to combat those problems that other languages have (BTW that FAA radio problem mentioned on "/." wouldn't have happened with smalltalk).
-
Test First ProgrammingSoftware Development Magazine had an article about test first programming of a GUI application that describes a method of incorporating the automated testing into the application.
The example GUI application is a simple game, but the methodology could be used for any GUI application.
From the article:The big question was how to handle all the stuff that would normally be considered GUI code-specifically, the hit-testing: Where do users click, and what should happen when they click there?
I suspected that hit-testing would be the most complex part of the application, so I wanted to ensure that I had tests for it. It also didn't belong in the model, since that should contain only basic game concepts. I needed an intermediary class somewhere: The Swing code would get a mouse event and delegate it to this intermediary class. The intermediary would interpret the mouse coordinates and determine if something had to happen. It would possibly do this by interacting with the model. If anything did happen, an event would be broadcast back to the Swing class.
The author goes on to discover, after searching with Google, that he had developed "a pattern known as Model-View-Presenter (MVP), a variant of Model-View-Controller (MVC)."
In MVP, the View actually serves as both the view and controller (presenting output and managing input). The Model is the Model, as in MVC. The extra middle layer is considered a bridge between the View and the Model. It's specific to the application and is often considered throwaway if the View needs to change (for example) from Swing to HTML. In this situation, the Model would remain unchanged.
Martin Fowler has a good description of how the Model View Presenter works.
The example source code is available on the site. It utilizes an automated Java test suite called JUnit
Software Development Magazine is a magazine targeted at software developers, and there is no charge to subscribe to it. -
Smalltalk and Oberon have them...Squeak Smalltalk has a plugin available for Linux, Mac, and Windows.
Dolphin Smalltalk has a plugin as well. However, like Dolphin Smalltalk itself, it is Win32 only.
One of the bigger, more business oriented Smalltalks, VisualWorks, also has a plugin. It looks like it too is Win32 only, but VisualWorks itself is cross-platform, and runs on Windows, Mac OS, and a big number of Unices.
The coolest plug-in for a language I've ever seen has got to be Oberon's Juice, by far. Unlike the Java and Squeak VM plug-ins, which take bytecode for their respective VMs, the Juice plugin takes pre-parsed Oberon code and compiles and executes it on the fly. This makes for really fast applets. I tried it a while back and it took a heckuva lot less time for Juice to download, compile, and execute the applet than it took for a comparitive Java applet to start up. Really cool stuff. However, it seems it's not been maintained in a while, and is Windows and Mac only. Seeing how Oberon itself has source available (IIRC), I'm sure that some Oberon enthusiast who wanted to get a generized Unix version going of Juice could do so.
-
Re:Consider Smalltalk
I agree with the notion of Smalltalk, but if the original poster is hesitant to spend $1000 or so for Delphi/Kylix (judging from the article, price does seem to be an issue), don't you think he might faint at the price for VA or VW?
:-) Squeak might be an acceptable alternative, although I don't know how well it really supports typical RAD type applications. I don't know of any other inexpensive cross-platform Smalltalks, though.(As an aside, if the original poster is ever interested in a different Windows-only tool, he might check out Dolphin Smalltalk. Once you get used to just about anything except VB, though, it's incredible how much it will annoy you if you're ever forced to use it again.
:-) -
Re:"friend" in C++ can *enhance* modularityBollocks.
You don't need "friend" for this -- "friend" is merely a bit of syntactic sugar that people who don't know how to use the Visitor Pattern or double dispatch must resort to to get bidirectional relationships.
In your particular example, you'd want to use a seperate object to represent the borrower-book relationship (likely a State pattern object), have a method in the Book class which registers itself with a Borrower argument (or a BookVisitor argument, more generally), establishing the relationship thusly.
Private members are private for a reason.
-
Re:Squeak
The interface that "put you off" is the original Smalltalk Human Interface. It is the same reaction that caused Apple to change that Human Interface to the one they created for their Lisa and Macintosh. Smalltalk-80Mac v0.x was one of the original Xerox License One Virtual Machines of the Smalltalk-80 image along with Dec and TI. That also means it had 100% of the source and all of the Changes as opposed to the dialects of Smalltalk that have since been derived from the code that was published in the books.
The "new" Morphic interface has been inside the image since it was renamed to Squeak and licensed by Apple as Open Source. The Squeak3.0 production release is the first to launch into a Morphic Project, and you will find the quality of the demonstration projects completely different from those in Version2. And yes... there are still some other new human interfaces hidden in the image that are being developed. Think of them as Easter Eggs, that include all of their source.
The Dolphin Education Center Information is great source of information and patterns about Smalltalk though the free version has not changed since 1998. Their document explaining the issues with the Model-View-Controller model in Squeak and the Model-View-Presenter approach used in Dolphin is an excellent explanation of both models. I am not aware of a Mvp Project being created for Squeak, yet.
- Squeak
http://www.squeak.org/ - Dolphin 2.1
http://www.object-arts.com/Downloads2.htm
- Squeak
-
Re:Smalltalk is obsolete
T_f_J, you're entitled to an opinion, of course, but your vocabulary in itself demonstrates the problem. To serve the economic and egoistic purposes of various Influential Entities, programming languages have become like car styles and Parisian fashions. Who judges that a programming language "belongs in a by-gone" era? What's the basis for that judgment? Is it that it hasn't a Roy Oily animal character and book assigned it yet? Is it that there's no John Wayne icon picked for it? Surely, a programming language is judged based upon the readiness with which its practitioners can build real systems while keeping an eye on long term costs and adaptability to changes in requirements.
If popularity were the test of achievement, then Visual Basic is (and remains, despite some deflation) king of the hill. You can't really mean that.
Most people who embrace Smalltalk have tried many other languages in professional contexts and are simply compelled to use it. There are lots of reasons why programmers unfamiliar with Smalltalk are missing out, even if they don't or can't use it. It's a powerful idea. I've described some of these in a letter to the editor of Dr Dobbs about a year ago. Smalltalk repeatedly surprises even its afficianados with rediscovered power and grace.
And if you want to see some of the other reasons Smalltalk wins, check out John McIntosh's site, Peter Lount's place, and the nifty (IMO) Dolphin Smalltalk.
-
Re:Smalltalk is obsolete
T_f_J, you're entitled to an opinion, of course, but your vocabulary in itself demonstrates the problem. To serve the economic and egoistic purposes of various Influential Entities, programming languages have become like car styles and Parisian fashions. Who judges that a programming language "belongs in a by-gone" era? What's the basis for that judgment? Is it that it hasn't a Roy Oily animal character and book assigned it yet? Is it that there's no John Wayne icon picked for it? Surely, a programming language is judged based upon the readiness with which its practitioners can build real systems while keeping an eye on long term costs and adaptability to changes in requirements.
If popularity were the test of achievement, then Visual Basic is (and remains, despite some deflation) king of the hill. You can't really mean that.
Most people who embrace Smalltalk have tried many other languages in professional contexts and are simply compelled to use it. There are lots of reasons why programmers unfamiliar with Smalltalk are missing out, even if they don't or can't use it. It's a powerful idea. I've described some of these in a letter to the editor of Dr Dobbs about a year ago. Smalltalk repeatedly surprises even its afficianados with rediscovered power and grace.
And if you want to see some of the other reasons Smalltalk wins, check out John McIntosh's site, Peter Lount's place, and the nifty (IMO) Dolphin Smalltalk.
-
Some of us use it
I have to do some of my development in Windows, and boy was finding Dolphin Smalltalk a nice thing for me. And no, I'm not some holdover from the 80s - when I started to do programming in the past couple of years (my training is really in mathematics; I wound up here via a winding path), I looked into various languages, tried them out for some of the things that I need to do, and found that two "old-timers" languages (Common Lisp and Smalltalk) fit many of my needs (which, incidentally, are not at all exotic - I do programming for a small trading firm).
It's a shame that so many people have preconceptions about various languages (often formed on the basis of where they were twenty years ago rather than where they've advanced to today) and therefore avoid checking them out to see what good things they can do.
-
Bad business sense, mostly
To oversimplify, there are two big reasons
- The first is that the syntax and the environment are a shock for people raised on file-based, statically typed, "edit it in vi" type of languages.
- The second and more important are the business reasons. Smalltalk was doing quite well commercially in the early 90's, but mostly in the high-end corporate developer space, with costs of thousands of dollars per developer seat. IBM had a big push behind it. This frightened the two other big commercial vendors, who attempted to merge, failed disastrously, and left IBM almost alone in the market, a position it didn't want to be in. With the high-price policies there was no low-end or open source base to sustain it. Then Java came along and picked up a lot of the pieces.
Nevertheless, Smalltalk has refused to go away. Significant open source efforts have started with things like Squeak and Camp Smalltalk, and even in the commercial world VisualWorks has a free download and Dolphin Smalltalk is an inexpensive very nice, clean windows environment. For a language that doesn't get used much, it runs fabs, auto assembly lines, massive payroll systems, and untold numbers of financial systems including a very respectable fraction of the stock trades in the United States.
Disclaimer: I recently quit a Java startup (WebGain) to go work for Cincom on Smalltalk development.
-
I'm not impressed- I've seen all this before...
The state of language design these days is down right depressing. The world can't seem to move beyond all of those silly Algol-derivatives like C, C++, Java, and now C#, making Smalltalk- a language designed throughout the 70s and finialized as Smalltalk-80 in 1980- still the height of language design.
What does C# add to Smalltalk, and contribute to the the innovation of language design? Not much. It has "attributes," which are nothing more than embedded XML comments; COM integration (good if you're on Windows, but you could always use Dolphin Smalltalk for that; SOAP integration (Dandy, but it's available for almost every language around); compilation (you can do this with Smalltalk MT); and the ability to regress back into C-pointer mode to write "unsafe" code, to make sure the incompetent GC doesn't eat your objects (which were never rooted, probably by an incompetent programmer).
Many of these things are neat and useful, but reek of the sad state of language design nowadays, and available elsewhere with or without add-on packages.
What's almost as sad, is that a lot of programmers are in awe at the power of C# and Java, with their heads too buried in the sand of C's syntax to see the innovations that Smalltalk (cf. Squeak) made 20 years ago. -
A good Smalltalk; some really visual environments
Squeak has a lot going for it, but familiarity for Windows users is not on the list. Probably a better choice would be Dolphin Smalltalk; it "feels like Windows" (a good thing in this case), it's a real Smalltalk, it comes with good tutorial documentation, and there's a free (as in beer) version available.
Good news: Smalltalk was designed (back in the 1970s, assuming computers as powerful as we have today!) to be a programming language for kids. Bad news: Really smart kids took to it like fish to water, but most really struggled.
Those of us who cut our teeth on punch cards and Teletypes were used to command line (or worse) interfaces and text programs. Today's kids aren't; even typing Smalltalk programs may bore them.
Consider Stagecast Creator or Toon Talk as a couple of purely visual development environments. They're more suited towards development of games and simulations, but that's a plus if the goal is to get your children excited about programming (probably the right target at first).
Here are a couple of stories about teaching kids to program: This one from Kids Domain has a lot of links to resources, while this one from Suite101.com is an interview (with fewer but entirely distinct links). -
Re:Merits of Java
I have to admit I don't particularly enjoy Java, even tho' it has a great many virtues compared most application programming languages in general use. Especially something like C++.
I have the feeling one set of people don't like Java because its object-oriented at all and it's not directly compiled down to machine code -- on Linux these people will moan about the 'inefficiency' of garbage collection and advocate pure C -- another set don't like it because tho' object orientation is okay in small doses Java takes it way too far, plus enforces static typing, is too formal, and you have to compile it at all -- On Linux these people will advocate Perl, elsewhere they might favour VB.
Yet more will complain that it looks too much like C, isn't dynamic or introspective enough, and you have to compile it at all -- these will probably advocate Lisp/CLOS/Scheme.
Myself, I'm afraid I've irredemably been infected with Smalltalk, so I moan that Java has any sort of static typing at all, syntactically looks too much like C, you have to compile it at all, and isn't dynamic or introspective, or even object-oriented enough.. (-;
Point is, Java hits a particular compromise position between a number of language styles which means that it inspires either great love for being the improved leading-edge and, most importantly, well supported (so you can persuade your boss to let you use it) successor to language-X you've always been waiting for, or great hatred as the unaccountably successful, horrible screwed up missed opportunity to bring all the neat features and advantages of favorite language-Y to the mainstream.
obActualTopic...
From my limited experience of Swing it has quite a nice design, but I'm not sure I'm convinced with the way the VC part of the MVC triad seems to have been merged.
For a different take on an updated MVC, have a look at MVP at IBM or a somewhat simplified Smalltalk implementation at ObjectArt s