How many programming languages should you know ?

September 5, 2021

So in today’s topic, I’m going to be trying to answer the question, how many programming languages do what you need to know. Now I want to start by saying, this is a very subjective question. If you ask a bunch of different software engineers, you’re probably going to get a bunch of different answers and it’s very hard and probably actually impossible for me to tell you a strict number on how many languages you should know.

I can’t simply tell you, you need to learn four programming languages, or you need to know six, or you need to know seven. Because again, this really depends on what you’re going to be doing with these programming languages and also what type of programming languages these are. S

o rather than me focusing on telling you to learn, say five or six programming languages in this topic, what I’m going to focus on is the type of programming languages that you should know and what you’ll gain in terms of knowledge and computer science fundamentals from learning those programming languages. So with that said, let’s go ahead and get started and talk about how many or what type of programming languages you should know.

Why You Should Learn Multiple Languages

Well, we dive in, I think it makes sense to discuss why you might want to learn multiple programming languages, even if you’re not planning on using those programming languages to build applications or work on projects. Now, the reason you might want to do this is because it makes you a better and more well-rounded program. I personally find that by learning multiple programming languages, I learned more about programming in general.

There’s no way to learn everything about programming from one or two programming languages or languages that are the same type. And while it’s really valuable to learn different types of programming languages, because they introduce new concepts and new features that you’ve maybe never seen before. Another big reason is this allows you to have a lot of tools under your belt and be able to make better judgements about what language or technologies you should use for a specific project

. After all programming languages are really just tools and they’re used to accomplish a task. Ideally, you want to use the best tool to accomplish a task. And if you only know one or two programming languages, you might not even know that there is a better option out there for what you’re trying to do. So that’s kind of my rationale or reasoning behind learning multiple programming languages.

And I will quickly state the one of the best and fastest ways to learn a new programming language is to just do a little bit of research about it, and then immediately start practicing on programming problems. If you’re at a beginner level now of 110 practice questions is not enough algo expert Alto has a data structures crash course in a brand new mock interview feature that you can use to practice coding interviews with other users on the platform.

I used algo expert to ACE my Microsoft and Shopify interviews. And now I am a proud instructor on the platform. My first five algo expert questions are live right now.

Imperative vs Declarative Languages

All right, so now let’s talk about the different programming language paradigms. Now there’s kind of two main categories of programming languages, and I’m pretty sure all programming languages fall within these categories. We have either imperative programming languages or declarative programming languages, and there’s more specific categories within those. But first, when we’re talking about imperative programming, what does that mean?

So an imperative programming language is a language in which we tell the computer how to come up with the solution. So the important word is how we are actually designing an algorithm coming up with the steps in the process. And we are concerned with how we actually kind of find the solution. Whereas declarative programming is more us stating facts and asking questions and having the computer come up with the solution for us, we’re less concerned with how we got that solution, but we’re more concerned with is the solution correct?

  How to use microservices properly ?

And what do we need to give the computer such that it gives us that correct solution? So a good example of declarative programming would be something like SQL. You don’t really describe how you’re actually going to come up with the query. You just type out the query and the computer gives it to you. So now that those make sense, let’s go into the specific examples within imperative programming and declarative programming and talk about them.

Imperative Programming

So I’m on the computer now, and I’m going to start going through programming paradigms within the context of imperative programming. Now there’s three main paradigms that are kind of belonging to imperative programming, and those are object oriented, procedural and parallel processing.

Now there’s a few others as well. In fact, there’s many different programming paradigms, but these are kind of the main ones. So it’s worth noting that many languages implement multiple different paradigms. For example, Python implements both the object oriented paradigm, as well as the procedural paradigm. So now I’ll show you some examples of object oriented and procedural programming languages, but I’m going to skip over the parallel processing and the other less common paradigms just for the purpose of this topic.

Object Oriented Programming

So the code in front of me here is written in Java, which is an example of an object oriented programming language. Now it does implement other paradigms as well, but object oriented is the main one we think of when we think of Java. So this probably looks pretty familiar to you as a good chunk of the most popular programming languages today implement some form of object oriented program. Regardless.

The idea behind object oriented is to represent the program as a collection of objects that store their own internal data and have external accessing parts, say like a method. So object oriented, programming languages use programming principles like encapsulation inheritance, polymorphism. And so on the things you’ve probably learned in a high school or university class, some of the main advantages of this paradigm are that features like inheritance can reduce redundancy and allow the same functionality to be used in multiple classes without having to rewrite it. Programs are typically easy to maintain and code is easily reusable.

There’s also some security benefits that can be achieved through data hiding and abstraction that you can’t get in some other programming paradigms. Now, if we’re talking about cons of object oriented programming, usually the size of your programs are quite large. It also usually takes a lot more effort to design and create these programs.

This has to do with the complexity of this paradigm in general, and just the larger amount of code that you need to write it. Lastly, speed object oriented programs are usually fairly slow and those are kind of the advantages and disadvantages of the object oriented programming paradigm.

Procedural Programming

So next one, Von to procedural procedural programming languages execute a sequence of procedures, which are usually called routines or sub routines, a routine gene or sub-routine is simply a series of computational steps to be carried out in a specific order. Procedural languages usually rely on block and scope. So you’ll see keywords like if, for while, et cetera. And these are used to implement the control flow of the program.

  Top 5 Tips To Get Better At Programming

Now in front of me is some C code, which along with other languages like Pascal Cobell basic and Fortran is an example of a language that is a purely procedural language. So for talking about the advantages of procedural programming languages, those are that first, they don’t require much memory. They also work well with interpreters and compilers, and generally they have a simple structure and require a minimum amount of code.

Now looking at the cons or the drawbacks, usually they don’t protect data very well. Air catching and debugging is pretty difficult. And this typically requires a deeper knowledge of the language and computer instructions to write in a procedural language.

So in time we’ve covered two main paradigms within the field of imperative programming. Again, the point of this is just to give you an idea of how programming languages differ. And again, why you may want to learn programming languages that are different paradigms because there’s different concepts and advantages and disadvantages of them.

Declarative Programming

So next, we’ll move on to declarative programming. Now within the field of declarative programming, there’s a few main paradigms and those are logic functional and database. Now, right now, we’re just going to cover functional and logic, but database would be something like SQL. And you can probably imagine why that would be a declarative programming language. Based on the explanations I gave previously, I have in front of me is prologue code.

Logic Programming

And this implements the logic paradigm, the logic paradigm is based on formal logic and essentially sentences, which state a fact or rule about some domain. So when you want to actually solve a problem, you ask questions or write queries that return results about the facts that you’ve declared. So logic programming allows you to express knowledge in a way that does not depend on, on the implementation. You’re not really telling the computer how to, to solve the problem.

You’re just telling it what problem want it to solve. So the main advantage of logic programming is that facts or information is separated from how it’s used. So separated from the implementation, and it’s useful for non-computational disciplines. And it’s very efficient and proven correctness of solutions. Now its main disadvantages are that it’s not easy to learn or use. And it serves a very specific purpose that is not appropriate for many of the tasks that you want to achieve.

Functional Programming

So moving on in front of me now, I have some OCaml code. Now OCaml is a language that implements the functional programming paradigm and functional programming avoids shared data state and any side effects using only pure functions that return values rather than modifying the state of a program. So functional languages rely heavily on recursion and the passing around a functions as arguments and return values and functional programming evolved from Lambda calculus and is implemented in some popular languages, namely lisp, scheme, scaler, and even are now functional languages are actually fairly popular.

And many people are fans of languages like OCaml, which you can see here because of the following reasons. So first in the functional paradigm, pure functions always return the same result for the same input, making them easier to test easier to debug and easier to comprehend. Lastly, functional programming also makes parallel processing and concurrent programming much easier. Now, if we talk about disadvantages of functional programming, those are that it’s very difficult to represent or implement some notion of state and recursion is used almost anywhere. So there’s no standard loops and a lot of people do not like that.

So that’s all I wanted to show you for this section. I just wanted to show these four paradigms. The point of these examples is simply to illustrate that there are many different programming languages and each has a lot of unique features and use cases. Yes, some of these languages are outdated and you probably don’t want to use them, but that doesn’t mean there. Isn’t a lot of value that you can learn from picking them up and kind of experimenting with them for a few hours.

  Top 5 Tips To Get Better At Programming

Language Recommendations

So now that you understand the different programming language paradigms, I’ll leave you with a few languages that you could learn that covered those paradigms. Now I’m not necessarily recommending that you learn all of these. I’m just trying to give you an idea of some languages that are in those paradigms that I think have some value in at least looking into. So starting with some older programming languages, these are languages that I would never use for a real world project that I simply think have some value in at least just exploring and getting an idea of what they are. So, first of all, when I was in school or as I’ve been in school, I had to learn a language called scheme.

Now this a purely functional programming language, it’s really weird. It’s completely different from anything that you’ve probably ever used before. If you’ve only used kind of modern new programming languages or at least the really popular programming languages. And personally, I found it really interesting and really valuable to figure out how to write code in that style. So I’ll leave it out that you can have a look at that language if you want, but I think there’s some value in at least looking into that for a couple hours. The next one that I had to learn, this was a purely logic programming language.

And this one is called prologue again, really old ancient programming language. I would never use it for any real project, but it was really cool to see again how to write code in that different style and be forced to use a bunch of different things that I would really never use when I’m traditionally programming, especially in sale language like Python.

So those are kind of my two old programming language recommendations. If you’re looking to get into something like that, but in terms of more modern programming languages that cover some of these paradigms that I think will make you pretty well-rounded I would recommend the following kind of three combinations of languages. So the first programming language I would recommend learning. If you don’t already know it is Python or Java script.

Now, of course you can learn both of them, but I think learning either of those two is great. And the reason for that is they are both scripting languages and they are both dynamically typed. So that already gives you a really good introduction to a very specific type of programming language that you can do a lot of stuff in. And it’s kind of in its own category in a sense, the next programming language I would recommend learning would be Java.

The reason for that is this a strongly typed language. It is also a object oriented programming language, and it teaches you a lot about kind of object oriented design and just good programming habits and ways of writing kind of production level code that you might not get in. Say something like Python or JavaScript.

And my last recommendation would be learning something like C or C plus plus. Now the reason for this, again, it’s pretty obvious, but these would be considered maybe lower level programming languages and these languages, you would need to use things like pointers. You would need to learn about memory management and there would be a lot of programming concepts that you may not have seen in languages, say like Java Python or Java script, that would be really valuable to learn in those languages.