Get started Bring yourself up to speed with our introductory content.

Learning modern programming languages like Ruby made easy

Interested in learning Scala, Ruby, Java or JavaScript? Do you want to learn one of these modern programming languages quickly? Here's a strategy to help you do just that.

As a software developer, Java is obviously the language you need to know if your software development is targeting a JVM-based stack, but in 2016, polyglot programming is the new normal. And to be truly on top of your game, you not only need to know how to compile source to byte-code but you also need to know how to program in other modern programming languages, such as Ruby, Scala and JavaScript.

TheSeverSide's compilation of roshambo-based applications will help you quickly learn Scala, Ruby, JavaScript and more.

Learning a new programming language is never an easy thing to fit into your schedule. The challenge busy software developers run into is finding the time to read up on Ruby, or run sample code in JavaScript, or apply knowledge gleaned from a tutorial in a Scala environment in an effort to retain something they might have learned. To help take the pain out of the process of learning a new programming language, TheServerSide is running a series of tutorials, repeated in JavaScript, Java, Ruby and Scala, so that a software developer who is adept at any one of these languages can run through the tutorials and quickly learn the ins and outs of the language with which they are less familiar.

The challenge of teaching modern programming languages

When teaching a programming language, one of the biggest challenges is developing a scenario that will help drive the learning, without bogging down the developer in the semantics of the problem itself. When a programming language is first taught, it's a tradition to start with the obligatory "Hello World" example. This is a great test to ensure the environment is working and that a user can indeed compile and run a piece of code, but as far as actual learning goes, "Hello World" really doesn't have much to offer.

Problem-based learning is always the most effective way to learn, regardless of whether the goal is to become an expert at software development or a world-renowned pastry chef. Adults always learn faster if they are forced to apply recently acquired knowledge to solving a particular task. The challenge when doing course development or stringing together a set of tutorials is determining the type of problem with which the user should be challenged.

The "Hello World" example is far too simplistic. Any software developer who experiences a training course that never goes beyond "Hello World" should be angry. They haven't been challenged and they really haven't been given the opportunity to apply their learning.

On the other hand, many courses, learning guides and tutorials tackle problem domains that are far too complex. Some respectable IT companies sell courseware in which the learner is expected to work through the development of an online shopping application that rivals Amazon.com in scope and complexity. The problem domain is so complex that it usually takes students three or four days to figure out exactly how the application works and what the application is supposed to do. The problem itself is so overwhelming that the student fails to learn any software development skills.

Balancing complexity and simplicity

In an attempt to identify a problem domain that resides somewhere between "Hello World" and Amazon.com on the complexity scale, the coding challenge TheServerSide chose is the implementation of the ubiquitous rock-paper-scissors game or, as it is known in other parts of the world, roshambo.

A Java Swing-based GUI approach to the rock-paper-scissors game.
Figure 1. A Java Swing-based GUI approach to the rock-paper-scissors game.

Why does rock-paper-scissors work well as a learning aid? First and foremost, it requires little explanation. Most people understand the basic nuances of the game in which rock beats scissors, scissors beat paper and paper beats rock. There's no need for extensive use case diagrams or Agile story boards to describe what is going on. Having said that though, if a developer was tasked with creating use case diagrams or writing user stories, he wouldn't have a hard time doing so, because he already understands how the problem domain works. On the other hand, if use case development was part of an exercise or challenge, the roshambo application would still be a great problem with which to drive the learning, because the developer would be able to concentrate on the technical aspect of creating these Agile and UML artifacts and not have to waste time on understanding the business problem.

The roshambo problem also has very distinct parts that map well to key software development challenges, such as obtaining user input, processing the input, handling errors and outputting results back to the client. Furthermore, the game is very testable, with very clear outcomes given a particular piece of input.

A JavaScript-based approach to the rock-paper-scissors game.
Figure 2. A JavaScript-based approach to the rock-paper-scissors game.

The extensibility of the roshambo application

The scenario is also very extensible. If you follow this series, you will be amazed to see how many different ways the roshambo application can be used to demonstrate different programming constructs. The first few tutorials will demonstrate basic programming skills, including conditional logic, variable declarations and iterative structures. From there, a highly procedural application will be refactored into something much more object oriented. Once object orientation is complete, we will use testing frameworks such as JUnit, TestNG, Cucumber and Gherkin to make sure everything is working properly. And once testing is complete, we'll distribute the whole application, providing the opportunity to see how you might integrate Enterprise JavaBeans, distributed persistence, NoSQL databases and even SOAP-based or RESTful Web services into the mix.

A Ruby-based command-line solution to the rock-paper-scissors game.
Figure 3. A Ruby-based command-line solution to the rock-paper-scissors game.

In this set of tutorials the same problems will be solved using different modern programming languages. If you're a Java developer, you can quickly compare a Ruby or Scala application to the approach used by the language with which you are more familiar. Being able to compare, analyze and evaluate different approaches to solving a problem is perhaps the most effective way to learn and expand your knowledge.

If you're interested in expanding your knowledge of software development and are interested in picking up some software development skills that will take you beyond the singular world of Java, stay tuned and enjoy TheSeverSide's compilation of roshambo-based applications that will help you learn languages such as Scala, Ruby, JavaScript and more.

What software development language do you think compliments Java the most? Let us know.

Modern programming languages made easy for Java developers

For those interested in learning Java, or for those who know Java and are interested in leveraging those skills in order to learn a complimentary language like JavaScript or Ruby, TheServerSide is providing a number of problem-driven tutorials that will help you master the fundamentals of these languages.

The catalog of tutorials currently includes the following:

This was last published in January 2016

Dig Deeper on Software programming languages

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchCloudApplications

SearchSoftwareQuality

SearchFinancialApplications

SearchSAP

SearchManufacturingERP

DevOpsAgenda

Close