Hackernoon logoWhat is Scala and Should it be Your First Programming Language? by@evgeniy-lebedev

What is Scala and Should it be Your First Programming Language?

Evgeniy Lebedev Hacker Noon profile picture

@evgeniy-lebedevEvgeniy Lebedev

Chief Marketing Officer Practicum by Yandex, edtech expert, practicum.yandex.com

In the early 2000s, the future of Java looked doubtful. Other programming languages had emerged, and Java no longer looked as attractive as it once had, even though it was still very widely used.  Along came Scala.

What is Scala?

Scala had several ideas in mind: 

  • Interoperability with Java and all its libraries; this means the ability to interact with Java and its libraries as part of the same system
  • Solid type system; a type system helps to reduce errors and shows which algorithms the machine should use on the data
  • Both object-oriented and functional programming; you get to choose whether you want to bring the data and its behavior together, or keep them separate for clarity
  • Modern programming benefits like asynchronous and parallel processes; this allows the machine to carry out multiple calculations at the same time 
  • More compact and legible code (compared to Java). 

Despite all those good things, Scala never took off as a mainstream language. In this article, I won’t dive into all the reasons why, but rather focus on whether a beginner should start with Scala or learn it in the first couple of years. 

Should Scala be Your first programming language?

There’s a lot of talk about which languages beginners should choose. And it makes sense: if you go into programming, you want to learn a language that will serve you well for many years. But there’s a catch. 

If you need a ‘hello world’ type of program that does simple computation and basic work with files, you can use any language. They all have the basic functionality to do those things in pretty much identical ways. Running loops, getting some user input, processing that input, even sending it somewhere — you can accomplish all of that in almost any language relatively easily. And since you’re only beginning to learn programming, you’ll be writing simple programs for months.

At this level, all languages are basically the same, and it makes no difference which one you choose. A simple program in Python will run just the same as that program in JavaScript, Java, PHP, Scala, or Ruby. In most cases, that program will even be written in near-identical ways.

Scala isn’t the simplest language in the whole world to learn. For beginner tasks, however, Scala won’t be too different than Python, which is considered a very beginner-friendly language.

However, after some time with Scala, you’ll need to move on to more complex software. And here is where things get interesting. 

Choosing a language for today’s software

Today’s software is complicated. A single program can have thousands of variables. It can require objects, classes of objects, and inheritance, which means basing objects and classes on other objects and classes. A single program may need parallel processes, asynchronous processes, and interface-related processes in which data is exchanged across boundaries. It can involve multiple views, different screens, and a whole bunch of other complexity. 

For example, for a web app, you need something small and light to load in a browser over the web. For software embedded in hardware, you need to make the code as small as possible. For slower machines, you need to optimize the code for that specific hardware. Or maybe you have a library that you need to use, and that library is only accessible through a certain language. 

It’s not like developers want to make their software complex on purpose. They need all this complexity for their products to work properly.  

And here is where the language matters. For hardware-based projects, you are more likely to use C or an Assembler-type language. For web-based apps, you’ll go with JavaScript. If you want to build an app for machines whose whole infrastructure is Microsoft software, you will most likely go for C#.

But to properly pick a language in these cases, you first need to:

  1. Know the specific requirements for your product
  2. Understand high-level concepts like inheritance, asynchronicity, etc.
  3. Have the experience to use these approaches when needed
  4. Have had the experience of working with an unsuitable language, so you can appreciate how smooth and efficient a suitable one is
  5. Have gained enough fluency in coding to express your thoughts freely, without thinking about syntax and parentheses. 

Once you’ve reached that stage, then it finally makes sense to discuss whether to pick Scala over Java; or move to Python; or do it all in C++. It’s not like you choose Scala over Java. It’s more like…your experience and expertise lead you to a certain solution. 

👉 Bottom line: Scala should not be your first programming langauge

No, you shouldn’t start Scala as your first language because it’s not super beginner friendly. 

Start with something that’s simpler like Python or JavaScript. And when you grow to need certain libraries (like Akka for concurrent distributed apps), your whole experience will lead you to pick Scala. But before you even know what concurrency is, there is no need to dig into Scala or any other high-level language that doesn’t have a simple beginner’s workflow.

When you need Scala, you’ll transition into it smoothly.

At Practicum, we teach HTML, JavaScript, and Python as entry-level technologies. Once you get going, you’ll master other languages in no time. 

So, if you’re interested in coding,  feel free to explore our educational resources. We offer online education and mentorship to help you build a successful career in tech. Beginners welcome!


Join Hacker Noon

Create your free account to unlock your custom reading experience.