When comparing Ruby vs Pharo, the Slant community recommends Ruby for most people. In the question“What is the best programming language to learn first?” Ruby is ranked 4th while Pharo is ranked 28th. The most important reason people chose Ruby is:
Ruby has a very clean syntax that makes code easier to both read and write than more traditional Object Oriented languages, such as Java. For beginning programmers, this means the focus is on the meaning of the program, where it should be, rather than trying to figure out the meaning of obscure characters. presidents = ["Ford", "Carter", "Reagan", "Bush1", "Clinton", "Bush2"] for ss in 0...presidents.length print ss, ": ", presidents[presidents.length - ss - 1], "\n"; end
Ranked in these QuestionsQuestion Ranking
Pro Clean syntax
Ruby has a very clean syntax that makes code easier to both read and write than more traditional Object Oriented languages, such as Java. For beginning programmers, this means the focus is on the meaning of the program, where it should be, rather than trying to figure out the meaning of obscure characters.
presidents = ["Ford", "Carter", "Reagan", "Bush1", "Clinton", "Bush2"] for ss in 0...presidents.length print ss, ": ", presidents[presidents.length - ss - 1], "\n"; end
Pro A large ecosystem of tools & libraries
Ruby has a large ecosystem of tools and libraries for just about every use. Such as ORMs (Active Record, DatabMapper), Web Application Frameworks(Rails, Sinatra, Volt), Virtualization Orchestration(docker-api, drelict), CLI tools(Thor, Commando), GUI Frameworks(Shoes, FXRuby) and the list goes on. If you can think of it, there is probably a gem for that ( and if not you can create your own and share with the community).
Pro Widely used
Ruby is one of the most popular languages for developing web sites. As a result, there's an abundant amount of documentation, sample code, and libraries available for learning the language and getting your project up and running. The most popular features are just 'gem install' away. Additionally, it is easier to find Ruby jobs because of this.
Pro Ruby on Rails
Lays out an easy to follow and opinionated MVC pattern that teaches best practices through necessity.
Pro Newbie-friendly community
Pro Hugely object oriented
Object oriented programming is one of the most important concepts in programming.
Pro Test Driven Development, #1
It's the fore-runner and trend setter for TDD.
In Pharo everything is an object. Compiler - object, network - object, method - also an object. And objects communicate with messages. No operators, no control-flow statements. Just objects and messages. Few things to learn, but you can learn OOP well.
Pro Easily learnt
There is good, free documentation including several books written by experts with extensive examples. There is an online MOOC. There are many tutorial videos. Supportive conferences and community. Even a professional support option if desired.
Pro Live updates
The nature of Pharo being a "live" environment allows you to perform live updates to your system without requiring to restart it. You can upgrade/modify classes while serving requests at the same time.
Pro Advanced code analysis tools
MOOSE environment provides extensive, easily leveraged and class leading tools for code analysis and improvement.
The framework for developing sophisticated web applications in Smalltalk is developed in Pharo. Seaside lets you build highly interactive web applications quickly, reusably and maintainably.
Pro Can run headless for production
Pro Highly productive
Pro Remote debugging
Pro Really simple networking and REST with Zinc
Pro Graphics, graphing and visualisation framework - Roassal
Roassal and Mondrian provide fantastic and easily used frameworks for graphics, graphing and advanced visualisations (comparable to D3.js) but with much less code. Visualisations can be rendered into web friendly graphics (SVG, .png etc.) without additional work.
Pro Beautiful coding patterns in your IDE
No need to search google for compact beautiful examples of how to do things, your live environment source is available and you can easily live search, see how it works and copy how the masters would do it (examples most languages still copy too).
Pro Glamorous toolkit & GTInspector
Most languages are still copying the Smalltalk tools of yesterday - GTInspector (written in Glamorous) takes live exploration of code/running objects to a new level. It's really slick, and better yet, you can easily write your own inspectors in 10 lines of code.
Pro Code can be run on rock solid GemStone environment
Con Its ecosystem is limited outside of web development
If you're looking to host, generate, manipulate or secure a website, Ruby is your language. There's also some great support here for infrastructure as code work via Chef. However, it just doesn't have the depth and breadth that Python does. Things like native UI development, high performance math, and embedded / small footprint environments are barely supported at all in Ruby-space.
Con Meta-programming causes confusion for new developers
The ability for libraries to open classes and augment them leads to confusion for new developers since it is not clear who injected the functionality into some standard class.
In other words, if two modules decide to modify the same function on the same class can introduce a number of issues. Mainly, the order in which the modules are included matters. Since you more or less can't tell what kind of "helper" functions a module might write into any class, or for that matter, where the helper function was included from, you may sometimes wonder why class X can do Y sometimes but not at other times.
Requiring a library can change the rules of the language. This is very confusing for beginners.
Con No docstrings
It's hard to access Ruby's documentation from the REPL (irb), unlike Python, Lisp, and Smalltalk which let you ask functions how to use them, which is a great benefit to the beginner, and which also encourages you to document your program as you code it.
Con Arcane grammar based on Perl
Ruby is too complicated for beginners:
- arcane Perlisms;
- semi-significant whitespace;
- parentheses are not necessary around method arguments, except for sometimes they are;
- control constructs could be elegantly implemented with block like Smalltalk (Instead they're baked into the grammar.);
- verbose block syntax, unless it happens to be the last argument. (proc lambda).
- There are too many exceptional cases and arcane precedence rules.
Con More than one way to do it
A problem inspired by Perl. The core API interfaces are bloated. There's at least four different ways to define methods. More is not always better. Sometimes it's just more.
Con Dynamic type system
Majority of bugs could be resolved with types.
Con Viewed as a web development language
Despite its flexibility and performance, Ruby is often seen as being unsuitable for other tasks by those who are not familiar with it. As such, a lot of discussion about it centers around Rails, which is not at all relevant if you're using Ruby for something else, such as game development.
Con Does not teach you about data types
Since Ruby is a dynamically typed language, you don't have to learn about data types if you start using Ruby as your first language. Data types being one of the most important concepts in programming. This also will cause trouble in the long run when you will have to (inevitably) learn and work with a statically typed language because you will be forced to learn the type system from scratch.
Con Focus on Object-Oriented Programming (OOP)
Focussing on OOP in a beginner stage is an easy and popular plan, but not the best one.
Con Small community
But they are very friendly and supportive. Best help comes through the mailing lists so not always easily googlable. There is also a Slack community where help is nearly instantaneous.
Con No 64 bit VM
Although 64 bit support is on its way, there is no official VM to work in a 64 bit system, requiring you to use 32 bit libraries.
Available in Pharo 5.