Today, everyone who wants to get into IT asks the question – which programming language to learn? Everyone is looking for a universal answer that will predetermine a dizzying career. Yes, before the invention of the Internet and the emergence of mobile platforms, it was possible to master one language, write a program in it and be in demand as a developer. Today the realities are such that even juniors have a huge list of requirements, including knowledge of several languages.

Judge for yourself: for web development, it would be nice to know PHP, JavaScript, Python, Ruby, as well as HTML and CSS; in the mobile sphere – Swift, Objective-C, Java, C #. You don’t even have to start the list of languages ​​for creating desktop applications – in fact, everyone will be useful. That is why we took upon ourselves the responsibility to name 5 programming languages ​​that need to be studied at least in a nodding manner in order to be called a programmer today.

Python


Python is perhaps the simplest programming language on our list. There are a minimum of service symbols, dynamic typing, the most understandable syntax. And if you didn’t understand much from the last sentence, this is a reason to start learning with Python.

Despite its visual simplicity, this language is one of the most powerful. It can be used with equal ease to work with text and build neural networks. Take a look:

def fib_recursion(i):
	if i > 1:
   	 return fib_recursion(i-1) + fib_recursion(i-2)
	return i
            	
for i in range(10):
	print i, fib_recursion(i)

In this code, we created our own function to calculate the Fibonacci sequence, and then display it on the screen. Only 6 lines were required to describe a rather complex mathematical operation.

It is worth mentioning that two versions are currently relevant: Python 2 and Python 3. You’d better take the latter as a basis, since support for Python 2, and therefore active development on it, will end very soon.

JavaScript


The next must have among languages is JavaScript, a browser is enough to work with it. The syntax here is an order of magnitude more complicated: service symbols and constructions with motley brackets appear, the names of functions do not always reveal the essence of the action, and even the simplest code has a structured form. Let’s take a look at the rewritten code with the Fibonacci function:

function fib_recursion(n) {
   return n < 1 ? 0
    	: n <= 2 ? 1
    	: fib_recursion(n - 1) + fib_recursion(n - 2);
}
 
console.log(fib_recursion(10));

The amount of code has remained almost unchanged, but readability has decreased. After learning Python, you can easily figure out how the return structure works, and appreciate the convenience of just this way of writing.

In addition, the JavaScript ecosystem is richer than Python. It offers an abundance of development environments, code editors, frameworks, libraries. This is another step towards understanding how “adult” programming works.

In general, JavaScript is slightly inferior to Python in terms of the range of tasks it can solve, but its capabilities are “deeper”. Knowledge of this language will come in handy when developing programs on any platform.

C #


If you have not decided on the language, then you have not yet decided what attracts you: web, mobile or desktop applications. Then your solution is C #, a universal tool for all areas of development. To create desktop applications, you need Visual Studio (the Community version is free). For the mobile world, install Xamarian, and for the web, ASP.NET comes in handy.

Let’s take a look at our C # code:

static void Main(string[] args)
{
	int number = 10;
	fib_recursion(number);
}
 
static void fib_recursion(int n, int a = 0, int b = 1)
{
	if (n == 0) return;
	Console.WriteLine(a);
	fib_recursion(--n, b, b+a);
}

The code has become slightly more complicated again – this is due to the use of the static keyword. At this stage, you will get acquainted with the competent use of memory, data scopes. Well, if you didn’t have time when getting to know JavaScript.

Swift


We come to the most interesting – languages, perfect knowledge of which will help you get into the field of mobile development. Swift is not quite versatile: it hasn’t completely supplanted Objective-C from Apple apps yet, but the outlook is bright.

The fourth version of Swift was released in 2017: it contains many improvements for working with strings, collections; increased reliability and much more. This is no longer a “raw” language, but a classic representative of the top of the TIOBE rating with a systematic development. With Swift, you can build apps for all Apple products: macOS, watchOS, iOS, and any new system if it comes up.

Let’s look at the Fibonacci sequence code:

func fib_recursion(num1: Int, num2: Int, steps: Int) {
 
	if steps > 0 {
    	let newNum = num1 + num2
    	fib_recursion(num2, num2: newNum, steps: steps-1)
	}
	else {
    	print("result = \(num2)")
	}
}
fib_recursion(0, num2: 1, steps: 10)

Java


For more than two decades, this language has been on the list of the most in demand, and that already means something. Today it is mostly associated with Android application development – but this is only a small part of its capabilities. With Java, you can create graphical widgets for the web or write desktop applications – the principle of platform and device independence is alive and well in Java.

In addition, Java is a great language to fully understand programming: all the principles of OOP are implemented here, work with memory and peripherals is organized, you can practice with functional programming.

And this is how the Java code of our sequence looks like in the simplest imperative case:

public class MainClass {
 
  public static long fib_recursion(long number) {
	if ((number == 0) || (number == 1))
  	return number;
	else
  	return fib_recursion(number - 1) + fib_recursion(number - 2);
  }
 
  public static void main(String[] args) {
	for (int counter = 0; counter <= 10; counter++)
  	System.out.printf("Fibonacci of %d is: %d\n", counter, fib_recursion(counter));
  }
}

It may seem overwhelming, but in reality these are nothing more than basic constructs that make the code understandable and reliable.

Leave a Reply

C#

04/02/2021

Node.js

06/01/2021