Okay, I stole the title from a Star Trek episode. So sue me.
For the past three years, Medium has been my battlefield for waging a campaign to promote the Smalltalk programming language. It has served me well but I’m tired of blogging, so I shall retire from this.
I shall, however, continue to answer questions on Quora, especially those that relate to programming languages and Smalltalk. This article will show highlights from Quora where I’ve left indelible marks.
The first question contains my stock answer for all beginners who ask how to learn programming:
Quora: What’s the best programming language to start with?
Second, for your chosen teaching language, follow a language tutorial or two in order to get warmed up. You may also take a look at the language reference to familiarize yourself with the language, a bird’s eye view.
Third, do a number of programming exercises, things like sorting routines, search algorithms, computing Fibonacci numbers, etc.
Fourth, start writing small programs to do simple tasks. Work your way up to larger software projects. Remember, the key to learning programming is practice. Lots and lots of practice writing software.
To be honest, there aren’t very many good teaching languages. I can only think of Basic, Logo, Pascal, Scheme, and Smalltalk. Of these, I most highly recommend Smalltalk.
For one thing, Smalltalk was designed by Alan Kay and his team at Xerox PARC for teaching programming to children. That’s a fine pedigree.
For another, the language is supremely simple and easy to learn. It only has six reserved words! The complete syntax can fit on a post card.
And yet, Smalltalk is unbelievably powerful. Read Why Pharo Might be the Future of Software Development.
Here are some great resources:
- a nice, gentle tutorial — Learn Smalltalk with Prof Stef
- the most actively developed Smalltalk — Welcome to Pharo!
- a free book — Updated Pharo by Example
- a Getting Started guide for Pharo — Pharo Quick Start
- a MOOC (massive open online course) — Live Object Programming in Pharo
- some great videos — Smalltalk 4 You
- a book that I like (not based on Pharo) — Smalltalk by Example
- another book that I like (not based on Pharo) — Computer Programming using GNU Smalltalk
- some additional resources — Resources
This book (not free) is my favourite for learning how to use Smalltalk for object-oriented programming: Smalltalk, Objects, and Design, by Chamond Liu.
I myself have published a whole bunch of Smalltalk tutorials. The latest ones are:
Quora: Why did Smalltalk become popular in the 1980′s and the 1990′s and Lisp never did?
Question details: Both are ancient languages, Smalltalk coming out in 1972 and Lisp in 1958. In the 1980s, Smalltalk emerged as a prominent OO language and its popularity peaked in the 1990s. Lisp, on the other hand, was relegated to AI development and was subsequently ignored in the “AI winter.” Only in recent years has Lisp returned in the guise of Clojure, but Clojure is nowhere close to being mainstream. What gives?
Answer: It’s quite simple, really. Which would you rather read, this:
Integer extend [
millerRabinTest: kl [ |k| k := kl.
self <= 3
ifTrue: [ ^true ]
ifTrue: [ ^false ]
ifFalse: [ |d s|
d := self - 1.
s := 0.
[ (d rem: 2) == 0 ]
d := d / 2.
s := s + 1.
[ k := k - 1. k >= 0 ]
whileTrue: [ |a x|
a := Random between: 2 and: (self - 2).
x := (a raisedTo: d) rem: self.
x = 1
ifFalse: [ |r|
r := -1.
[ r := r + 1. (r < s) & (x ~= (self - 1)) ]
x := (x raisedTo: 2) rem: self
x ~= (self - 1) ifTrue: [ ^false ]
1 to: 1000 do: [ :n |
(n millerRabinTest: 10) ifTrue: [ n printNl ]
(defun factor-out (number divisor)
"Return two values R and E such that NUMBER = DIVISOR^E * R,
and R is not divisible by DIVISOR."
(do ((e 0 (1+ e))
(r number (/ r divisor)))
((/= (mod r divisor) 0) (values r e))))
(defun mult-mod (x y modulus) (mod (* x y) modulus))
(defun expt-mod (base exponent modulus)
"Fast modular exponentiation by repeated squaring."
(labels ((expt-mod-iter (b e p)
(cond ((= e 0) p)
(expt-mod-iter (mult-mod b b modulus)
(/ e 2)
(mult-mod b p modulus))))))
(expt-mod-iter base exponent 1)))
(defun random-in-range (lower upper)
"Return a random integer from the range [lower..upper]."
(+ lower (random (+ (- upper lower) 1))))
(defun miller-rabin-test (n k)
"Test N for primality by performing the Miller-Rabin test K times.
Return NIL if N is composite, and T if N is probably prime."
(cond ((= n 1) nil)
((< n 4) t)
((evenp n) nil)
(multiple-value-bind (d s) (factor-out (- n 1) 2)
(labels ((strong-liar? (a)
(let ((x (expt-mod a d n)))
(or (= x 1)
(loop repeat s
for y = x then (mult-mod y y n)
thereis (= y (- n 1)))))))
(loop repeat k
always (strong-liar? (random-in-range 2 (- n 2)))))))))
CL-USER> (last (loop for i from 1 to 1000
when (miller-rabin-test i 10)
It comes down to syntax and readability. Lisp advocates insist that Lisp isn’t hard to read if you do this and if you do that, but they’re just making excuses. In point of fact, most people dislike Lisp syntax and there’s really very little we can do about it.
Also, when Smalltalk emerged, object-oriented programming (OOP) captured the imagination of the programming community in a way that Lisp and functional programming never could. OOP promised a better way to manage program complexity, and to help make code more maintainable and more scalable. What did Lisp promise? Homoiconicity and powerful macros. That’s not very catchy.
In other words, Lisp was, and still is, a hard sell.
Interesting factoid: in the 1990s, Smalltalk became the most popular OO language after C++. Here are the OO language market shares from a 1995 IDC report:
- C++ — 71.3%
- Smalltalk — 15.1%
- Objective-C — 5.7%
- OO Pascal — 4.2%
- CLOS — 2.5%
- Eiffel — 1.1%
- all others — 0.2%
Not too shabby! There’s no reason why Smalltalk can’t be yet again popular, especially with the release of Pharo, a Smalltalk modernized for the Twenty-First Century. Read Behold Pharo: The Modern Smalltalk.
Quora: Will the Nim and Crystal programming languages replace Java, Golang, and C# in the future (next decade)?
Answer: That’s what fans of these languages are hoping, of course. But hope is not predictive. Hope does not determine the course of history.
Hard work does. Advocacy and promotion do. Building up a healthy ecosystem does. Creating “killer” applications, if possible, would as well.
Note that Nim and Crystal are hardly alone in this dilemma. There are any number of language upstarts vying for public attention and support, for example:
- Pharo (see Why Pharo Might be the Future of Software Development)
- Dart (Google needs to try harder)
- F# (Microsoft needs to try harder)
- Rust (Mozilla needs to try harder)
- Ceylon (Red Hat needs to try harder)
- Kotlin (despite Google’s imprimatur for Android development, this language still faces a long road ahead)
The odds against Nim and Crystal are enormous. Would you care to place a bet with your Las Vegas bookie?
Quora: As senior web developers, what is one thing you wish you had known when you were starting out?
Answer: If I had known 10 years ago when I started web development what a huge clusterfuck it would become today, I wouldn’t have continued in this field.
Today, there are dozens of JS web frameworks vying for top spot. It’s like the bloody Hunger Games of web development! It’s ridiculous. Everybody is suffering from “framework fatigue” and “choice paralysis.”
And now Vue is trying to unseat React. These frameworks have the lifespan of a fruit fly!
There are countless thousands of npm packages, most of which are pure, unadulterated garbage. It’s really hard to separate the wheat from the chaff. Moreover, with their intricate interdependencies, the web is like a house of cards that can collapse at any moment with a single errant package. The most infamous example is the “left-pad” debacle.
Yes, I wish I had known all this 10 years ago.
Quora: Why has C (programming language) been in use for 35 years, yet it’s fresh as a daisy?
Answer: “Fresh as a daisy,” it is not. C is an archaic language. Who does manual memory management anymore??? The vast majority of programming languages today have gone to garbage collection.
Who uses header files and preprocessor anymore? These are ancient and crude techniques that few languages care to adopt.
C is a purely procedural programming language. There is absolutely no support for functional and object-oriented programming.
However, there’s no question that C remains a fairly small, light and agile language. Free of high-level encumbrances, C is essentially a portable assembler. At the same time, this language will not coddle you. It won’t do anything to protect you from buffer overruns, segmentation faults, and memory leaks.
It’s like programming with stone knives and bearskins:
Look, I love C. It practically paid for my early retirement as a software engineer (writing device drivers). I owe it a whole shitload of gratitude.
But “fresh as a daisy?” Let’s not go overboard. It remains a very useful language today, and that’s high praise, indeed.
In fact, I count on C when I do Smalltalk programming because Smalltalk by itself provides no low-level or OS access to the host platform. A good example can be found in my programming tutorial: Learn How To Program. If C programming is using stone knives and bearskins, then Smalltalk programming is driving a Bentley Continental GT across the devastated landscape of Scotland:
Quora: Why are people still trying to make breakthroughs in standard code when AI is the way of the future?
Answer: There are several reasons. First, AI that is truly capable of autonomous software creation is still a long ways off. We don’t know how far off. It could be decades, or it could be more than a century. In the meantime, we still have lots of shit to do and we’re not doing it very efficiently.
But make no mistake: programming automation is inevitable. It’s only a matter of time. People who make the oft-repeated criticism that AI has been the future for more than 40 years are overlooking several important points:
- Past failures do not predict future failures. If that were the case, we wouldn’t have any progress at all.
- Past failures can be attributed to the fact that it takes a long time for technology to catch up to our ambitions. Forty years ago, our computer hardware was measured in KHz and KB. Thirty years ago, it was measured in MHz and MB. Multicore technology was just a dream. It may well be that we will require quantum computing to solve the AI problem.
- Forty years ago, software technology was relatively primitive. We were still feeling our way around in AI looking for practical solutions. Today, Big Data has opened up new vistas that we couldn’t imagine back then. And who knows what other breakthroughs we will have in the coming decades. Computer Science has been advancing by leaps and bounds.
- People make it sound like 40 years are a long time. That’s a blink of an eye in human history. As impressive as our computer technology is, it is still laughably primitive. I mean, for chrissake, we’re still doing programming using files and folders and the command line! We’re still trapped by the edit-compile-test-debug cycle. Bret Victor gave a great talk not too long ago to illustrate this fact:
Second, it is unlikely that AI will solve ALL of our programming problems. It seems to me that there will always be a need for specialized programming at the frontiers of computing. We may also wish to make room for human creativity in programming.
Answer: Probably a lot of people would crawl out of the woodwork to criticize Smalltalk. Popularity always breeds contempt.
The productivity of software development, on average, would double or triple throughout the entire IT industry. The overall quality of software would likely increase dramatically, as well.
That’s because Smalltalk programmers are happy programmers, and happy programmers produce better outcomes. Smalltalk programmers are happy because their tool is so easy and fun to use, what with the absurdly simple syntax and virtually nonexistent cognitive load.
Moreover, the tool’s live coding IDE makes them hugely productive. Friction-free programming, I call it.
The ability for Smalltalk to comfortably manage the complexity of large software systems is unmatched by any other language. Java and C++ are massive headaches, by comparison.
Consider this case: one of the biggest Smalltalk success stories is when the U.S. joint military used Smalltalk to write a million-line battle simulation program called JWARS, which incidentally outperformed a similar simulation called STORM written in C++ by the U.S. Air Force. An amazing testament to the capabilities of this language.
JPMorgan used Smalltalk to write a massive risk management program called Kapital. Orient Overseas Container Lines used Smalltalk to write a global tracking system called IRIS-2.
Quora: What’s your favorite obscure programming language?
Answer: Well, it’s not exactly obscure, but it is quite far from mainstream: Smalltalk/Pharo.
It’s my favourite language because:
- It’s supremely simple and elegant. It has all of six reserved words! The complete syntax fits on a post card.
- It has a built-in, live coding and debugging IDE that’s responsible for making Smalltalk the most productive programming language in the world.
- It’s the premier OOP language. Its implementation of OOP concepts is so pure and excellent that it has been emulated by nearly every other OOP language we use today.
- It’s very versatile. Smalltalk can be used for web (Teapot: Web Programming Made Easy and PharoJS), mobile (PharoJS), desktop (Building UI Interfaces with Spec), IoT (PharoThings), data science (PolyMath and Agile Visualization and Numerical Methods with Pharo), machine learning (BioSmalltalk and Single-layer Perceptron in Pharo), natural language processing (nlp_smalltalk), scripting Unreal game engine, etc.
- It’s used by major enterprises around the globe, including JPMorgan, Desjardins, UBS, Florida Power & Light, Texas Instruments, Telecom Argentina, Orient Overseas Container Lines, Siemens AG, ALLSTOCKER, etc. It’s particularly popular in the financial and manufacturing industries.
Smalltalk/Pharo is pure programming fun!
Quora: Is Python’s lack of type safety a serious problem for large projects?
Answer: Robert C. Martin (aka “Uncle Bob”) would disagree with the premise that dynamic typing prevents scalability: read Clean Coder Blog. The key is TDD (or Test-Driven Development).
Robert Smallshire demonstrates that static typing makes very little difference to the number of software defects in real-world software projects: watch
Here’s an inconvenient truth: software projects that employ static typing can also fail miserably. But you don’t blame the programming tools, you blame the failure of project management.
It all comes down to project management. Does management know what they’re doing?
Smalltalk, another dynamically typed language, has been used successfully for several decades to write enormous enterprise-scale software with high quality and reliability. Some of the higher profile users include JPMorgan, Desjardins, UBS, Florida Power & Light, Texas Instruments, Telecom Argentina, Orient Overseas Container Lines, Siemens AG, etc.
In my home country, Smalltalk is used by Communications Security Establishment (CSE), Canada’s national cryptologic agency.
In the early 2000s, the U.S. joint military used Smalltalk to write a million-line battle simulation program called JWARS. It actually outperformed a similar simulation called STORM written in C++ by the U.S. Air Force. That by itself is an astonishing testament to the capabilities of the language.
Smalltalk and dynamic typing were so problematic that in the early 1990s, IBM chose Smalltalk as the centrepiece of their VisualAge enterprise initiative to replace COBOL. They could’ve chosen C++. They could’ve chosen Object Pascal. They could’ve chosen Eiffel. They didn’t seem particularly concerned about scalability with respect to Smalltalk.
There is a great deal of misconception and misinformation swirling around this entire dynamic typing issue. It’s bogus. There is nothing wrong with using Python and Smalltalk for large applications, if you know what you are doing. If you have good project managers who know what they are doing.
Quora: How smart must you be to become a front-end developer?
Answer: Apparently, not that smart, as everybody and their dog is now learning front-end web development.
That’s why there are soooo many crappy JS devs. So many people, blinded by the hype over web development and the promise of jobs, flock to online courses and coding bootcamps hoping to cash in on the web craze.
JS evangelist Eric Elliott has said (and I’m paraphrasing) that 99% of JS devs don’t know what the f*ck they’re doing. He’s being generous.
The fact is, most front-end web developers shouldn’t even be in this profession. If they were to switch to another field of programming entirely, they likely wouldn’t pass muster.
The bar for becoming a front-end dev is too low. We’re not filtering out mediocre minds. Anybody who picks up HTML, CSS, and some JS can call themselves a front-end dev and get an entry-level position somewhere. God help us.
Quora: What information am I missing to understand programming? I am trying to learn programming and nothing seems to make sense and I’m not sure. Why?
Answer: Why? There are several possible reasons:
- You have a poor instructor or a poorly-designed course.
- You have poor instructional materials, esp. if you’re learning on your own.
- You’re not suited to learning programming because you don’t have the right aptitude or motivation.
Without examining your situation in more detail, it is impossible to say which one it is.
Learning programming means to develop your analytical, logical and creative skills in solving technical problems. You start with small, simple programming exercises such as compute Fibonacci numbers, implement bubble sort, determine if a sentence is a pangram, compute Pascal’s Triangle, etc. Websites like Exercism.io provide plenty of exercises.
Eventually, you work your way up to writing simple programs. This may involve creating a user interface, updating a database, or producing graphical output like a chart or picture. The key to learning programming is practice. You must practice writing programs. The more you practice, the better you’ll become.
Initially, you will struggle as your mind adapts to a new skill. This is true when learning any new skill such as playing piano. Why should programming be an exception?
But if you persist and work hard, you will eventually get it. Not many people can persist.
Quora: Why does everyone and their momma want to work as a software engineer?
Answer: Because there is a general perception by the public that:
- Programming is the key to a lucrative career. There are tons and tons of programming jobs. They’re practically falling off the tree.
- Programming is easy. Anybody can learn. A child could do it!
- Programming may possibly offer the opportunity to launch a Silicon Valley startup and make you an instant billionaire. Think Facebook, Uber, Airbnb, and Netflix.
It is this kind of hype promulgated by the media and press that leads people to believe this nonsense.
First of all, while there is substantial demand for programming skills, this demand is not typically met by new programming grads with zero experience. There may be tons and tons of programming jobs but most of them are not entry-level positions.
Second, the cold hard fact of life is that there are unemployed programmers. Employment is not guaranteed in ANY profession.
Also, employment depends a great deal on geographical location, the health of the local economy, the amount of competition for jobs, and so on.
Third, programming is not easy. Anyone who says this is an idiot. Whether someone can learn to program depends a great deal on individual aptitude, motivation, persistence and willingness to work hard. To achieve any measure of programming competence requires endless practice writing software. Thousands and thousands of practice hours. This could take years.
Fourth, the possibility of becoming a Silicon Valley billionaire is much like the possibility of winning the lottery. It’s fun to dream but let’s come back down to earth. You are more likely to die in a car accident or gun shooting (U.S. only).
And finally, the programming profession faces serious threats in the future. One is globalization. Many jobs are going overseas because there aren’t enough competent programmers in domestic job markets and because labour is CHEAP. (Even overseas, there are unemployed programmers.)
Another is automation. Work is furiously afoot in the area of data science and machine learning to automate many programming tasks. In time, this will reduce demand for programming skills as end-users will be able to create their own applications easily and without programming skills. Lower demand will mean greater unemployment for programmers.
I know that many people in this profession have their heads buried in the sand (or stuck up their asses) refusing to believe that automation is coming. Fine, believe what they will. It doesn’t change the reality.
It’s hard to make predictions but I’d say programming automation is going to hit us hard in about 10–20 years.
Answer: Yes, they are completely different languages. Sure, they share a slight resemblance with C-like syntax but that’s purely cosmetic. What counts are the following:
Quora: Why do most programmers write in object-oriented languages, but for persistence, use relational database systems, and not object-oriented database systems? Isn’t that counterintuitive?
Answer: The main reason is that enterprises have long standardized on relational databases. The result is that relational databases and relational database programming have become highly optimized and efficient. There are tons of legacy databases that use relational. You don’t throw away such vast investments.
Contrary to what some may believe, however, relational databases are not necessarily superior to object-oriented databases. They both have their pros and cons. It’s just that relational databases have had so much more time and effort into making them highly efficient. There’s no reason why, in principle, object-oriented databases couldn’t enjoy similar effort.
Nevertheless, object-oriented databases can be very effective for enterprise computing. The canonical example is GemStone/S, a Smalltalk-based product that provides high-availability, high-performance, scalable, multi-tier application support for robust, mission-critical needs in finance, insurance, transportation, telecommunications, and utilities. I would put GemStone/S up against any relational database (Oracle, SQL Server, etc.), as long as you’re willing to program in Smalltalk.
Quora: Is programming made more difficult than it has to be?
Answer: In fact, yes, it is. The current state of the art in programming is firmly mired in ancient techniques using textual programming languages, and based on reams of source code stored in files and folders, and relying on the standard edit-compile-test-debug cycle. This is like programming using stone knives and bearskins:
Bret Victor gave a great talk about how programming could be so much easier and more efficient:
Right now, the closest thing we have to a programming environment that can live up to Bret Victor’s vision is Smalltalk. It doesn’t provide quite the same kind of immediacy and connection that he talks about, but it’s not too far off, either.
Smalltalk’s use of convenient and easy live coding nearly eliminates the edit-compile-test-debug cycle. Smalltalk’s image-based environment supplants the conventional file-based approach that has been with us since the 1960s.
Visual programming has been around for many years, but it has largely been limited to vertical applications and narrow niches. The continuing evolution of visual programming may open up greater opportunities in the future. We can only hope.
Quora: Given the complexity of frameworks and languages, is the web overengineered?
Answer: Garry Taylor nailed it completely with his answer. The web isn’t over-engineered. It’s a basket of crazy shit.
As if that wasn’t bad enough, instead of fixing these flaws (which would break the web), ECMA TC39 kept piling on features like there was no tomorrow, through ES5.1, ES6, ES7, and ES8. This last one has a language spec of over 885 pages!!! I. Shit. You. Not.
And they’re not done yet! ES9 and ES10 are coming.
React is the current “hotness” but front-end developers frequently complain about how complicated it is to learn. That’s why Vue is rapidly picking up steam, hoping to simplify the mess.
I ask you, what other area of IT has so much drama?