Introduction to Programming Languages: A comparison of popular programming languages like Python, JavaScript, and Java

Introduction to Programming Languages: A comparison of popular programming languages like Python, JavaScript, and Java

So, you've decided to embark on the journey of programming? You've probably encountered some bumps along the way and realized there's a vast world waiting to be explored. Questions like:

Where do I start?

Where do I go from here?

As much as these questions may be swirling in your mind. Don't worry, you're not alone. It becomes increasingly glaring that this programming thing is so up there. And you're down here.

Truth is, you're so not different from many of us. Whether you stumbled into the world of coding or you took the deliberate route, what counts is what you're willing to make of it.

Dispelling Misconceptions: What Programming is Not

To fully comprehend what programming is, and how it works. I believe it's best to discuss what's not programming.

For Gen Zs

Some people believe that programming is a thing for the zoomers; i.e., people who were born between the years 1997 and 2013. They are perceived to be more creative, self-reliant, and resourceful.

I'll burst your bubbles. Programming does not have age restrictions. If you are not a Zoomer and you're good at programming, you will reap the benefits of being a good programmer.

Programming and Mathematics

Mathematics is a stepwise approach to problem-solving. It involves a lot of problem-solving, chunking, modelling, and many more. It involves setting a result and looking for other parts that make up the result.

Horning your problem-solving skill will help you shape a thinking pattern that is beneficial in programming. However, this does not mean that programming in itself, is all just mathematics.

If you have little or no knowledge of mathematics, you can still be great at programming if you are willing to constantly improve on logic and critical thinking.

You need 150+ IQ

You don't have to be the most intelligent person in the world to become a programmer. Yes, it involves critical thinking, problem-solving, and a whole lot of practice.

If you like to solve word puzzles, for example, you just might be great at programming.

Having a high IQ will contribute to getting favourable outcomes as a programmer, but the key skills that are needed for programming are abstract thinking, the ability to solve problems, creativity, patience, perseverance, and paying attention to details.

C or C++

Some people's definition of programming is pretty simple: it is C or C++ and everything else. They believe that if you don't know C or C++, you are not a real programmer. But that's a big misconception.

C is a programming language that was originally developed for creating operating systems. It was developed by Dennis Ritchie.

The C programming language is very influential. It is often referred to as the mother language because most of the other languages that came after C (e.g. Python, JavaScript, Rust, C++ etc )borrowed heavily from it.

Also, most of the compilers and JMVs(Java Molecular Viewer. It provides built-in support for stereoscopic display and is also responsible for full 3D view of molecular structures on well-equipped PCs and workstations) are written in C.

Here's an example that demonstrates how functions and commands are used to complete an action:

#include <stdio.h>

// Function declaration int addNos(int a, int b);

int main() { int no5 = 5, no6 = 10; int sum = addNos(no5, no6); // Function call

printf("The sum of %d and %d is %d\n", no5, no6, sum);

return 0; }

// Function definition int addNos(int a, int b) { int sum = a + b; return sum; }

In general, not knowing C or C++ does not make you a bad programmer. However, having a good knowledge of it will make you a better programmer.

C is an old programming language. As a programmer, you should be able to recognize a C code when you come across it.

So then, What is Programming?

The concept of programming is simple. Tell the computer what to do. In doing that, however, you need to speak a language that it understands for it to execute your commands just the way you want it. These commands or instructions are popularly referred to as coding.

Programming Languages

A programming language is a type of written language that is used to communicate with computers. They enable humans to communicate with computers effectively.

Examples of programming languages include JavaScript, Python, Java, Ruby, Rust, C, C#, C++, Golang, and so on.

As with languages in general, all programming languages have their set of rules, how you write them, what keywords exist in them, and where and how a command should end. These are called syntax.

Golden Syntax Rules Across All Programming Languages

Here are the golden rules that come with the syntax of every programming language:

Case-sensitive: All programming languages can distinguish uppercase from lowercase. In C for example, characters in uppercase are treated differently than lowercase characters.

Keywords: These are predefined words that are reserved for specific use. Keywords cannot be used as variables, functions or other identifiers in any programming language.

In Python, you can not use the except keyword as any kind of identifier other than its predefined purpose, which is to raise an exception.

Statements: These are groups of expressions that are designed to act. The code below is an example of how both conditional and expression statements can be used in Java.

  1. //conditional statement

  2. if (num > 5 )

  3. {

  4. //expression statement

  5. System.out.println(num + " is complete");

  6. }

White-spacing: This is also called negative spacing. Simply put, it is the space between text, graphics, images, and blocks. Python has some characters that are known as whitespace characters. These include newline, tabs, space etc.

Comments: Every language has its way of writing comments. There are usually two ways of writing comments; block and inline comments.

Classification of Programming Languages

Frontend and Backend

This is also known as client-side. It is basically what users see and interact with on the browser. It comprises all the experiences that a user would have on each page. This includes colours, design, navigation, images, responsiveness etc.

Frontend technologies are HTML, CSS and JavaScript. Other tools include web frameworks such as Bootstrap, Tailwind, Angular, Django, CSS preprocessors like SASS/SCSS, and JavaScript library (JQuery).

This is referred to as the server side. It's the part of the website or application that users can't see. The backend is the actual powerhouse of the frontend application that everyone interacts with. It communicates with the client side, sends and receives data, stores them in the database and generally makes sure that the frontend works as it should.

Low Level and High Level

Low-level languages that sit close to actual machine instructions. There are two types of low-level languages: machine codes and assembly languages.

Machine codes are the set of instructions that a computer processing unit directly understands and can act on. It is 0s and 1s. Hard to write. Hard to debug. Can you imagine you trying to read an entire application that is full of nothing but 0s and 1s?

Assembly languages are in-between machine codes and high-level languages in the sense that you can code using words and expressions that can be easily understood as compared. It communicates with the hardware directly.

High-level programming languages include Python, JavaScript, Java, SQL, C, C++, Ruby, PhP, Perl, Rust, Visual Basic etc.

Interpreted and Compiled Languages

A compiled language is a language that is converted into machine code to enable the computer to perform the task.

An interpreted language executes directly without converting to machine code first.

How Does Programming Work?

When you write code, a compiler converts each line of code into a language - a set of 0s and 1s - that the computer understands. The computer then scans the code and acts on it.

Compilers, Interpreters and Assemblers

A compiler is a program that translates the source code of a programming language into machine codes or another programming language. A compiler takes the source code written in a high-level programming language and translates it into machine code, which is a low-level language that the computer can understand and execute. When you write codes the compiler looks through it, ensures that it is in line with the syntactic rules of the programming language you used, and then interprets.

Interpreters are programs that directly execute source code without the need for prior compilation. They read and execute the code line by line. An Interpreted language executes commands directly without having to compile them first.

An assembler is also a program. It takes the source code of assembly languages and converts them into object codes or bits that the computer processor can use to perform the tasks. Assemblers are used for converting assembly language code, which is a low-level programming language, into machine code.

Types of programming languages

While programming languages are of various types. A language can fall under more than one type.

Procedural programming languages

These are programming languages that use both functions and commands to complete an action.

Examples are FORTRAN, Pascal, BASIC, C, COBOL, Ad etc. They are engineering, gaming, and finance.

Functional programming languages

A functional programming language comprises of series of functions. They are more flexible, unlike procedural programming languages.

Examples are

Object-oriented programming languages

Object-oriented programming emphasizes the use of data fields with it's unique object features. The features that define an object are as follows:

An object can have: To define the object Person, for instance, the object, person must have certain unique attributes. Using JavaScript, let's define the object person:

const person = {

name: 'John',

car: 'Toyota Corolla'

}

An object can do: Furthermore, the object person can also be defined with attributes that person can do, and then, call a method from it.

const person = {

name: 'John',

car: 'Toyota Corolla',

walk() {},

talk(message) {

return 'Hello ' + message + '!';

}

};

person.talk('Hey!'); // Returns 'Hello Hey!'

person.talk('Good morning!'); // Returns 'Hello Good morning!'

Examples of object-oriented programming languages include JavaScript, Python, C++ etc.

Scripting languages

These languages convert high-level commands into machine language, so you don’t need to compile. Instead, it will be interpreted. Examples are JavaScript, PhP.

Logic programming languages

Logic languages are similar to SQL database languages. Here, the paradigm is mostly based on the use of logical formulas. Examples are Prolog and Datalog.

If we are to pick out the most popular object-oriented programming in 2023, Java, Python, JavaScript, Php, TypeScript, C, C#, C++, SQL, NoSQL, Rust, Ruby, Scala Swift, Go, Kotlin, Swift, R, Matlab etc.

Here's a brief comparison of the first three:

Java

Java is a popular language for building enterprise-level applications, Android apps, and large-scale systems. It has a strong object-oriented programming foundation and is known for its robustness and portability.

Java has been popular in fields like banking, IT companies, industry services etc, for about a decade now. Java is on the list of the most popular programming languages in the world.

Java runs on Windows, Linux, Mac, Pi and any operating system you can think of. Java codes need to be compiled.

Javascript

People often mistake Java and Javascript to be one language, but there's a difference.

While Java is an object-oriented programming language, JavaScript is a high-level, object-oriented text-based scripting language which runs its code on the browser only. On the other hand, Java runs in virtual machines or browsers.

Python

While JavaScript runs on the front end and back end through JavaScript backend frameworks such as node js and express. Python is a backend programming language.

It is an all-purpose language, in the sense that it can be used to develop web applications and web services, for automation, machine learning, and mostly for system scripting and data science.

The Conclusion of the Matter

It's great to see your enthusiasm and interest in programming! Starting can indeed feel overwhelming, but with the right guidance and approach, you can make progress and achieve your programming goals. Let's address your questions and concerns.

Where to Start

When beginning your programming journey, it's important to choose a programming language that suits your interests and goals.

The languages you mentioned, such as Java, JavaScript, and Python, are all excellent choices and widely used in different domains. Here's a brief overview:

Where to Go from Here

Once you have a good grasp of the fundamentals, it's essential to deepen your knowledge and explore different areas within programming. You may consider these:

  1. Web Development: Dive deeper into front-end or back-end web development. Learn HTML, CSS, and JavaScript thoroughly for front-end development. For back-end development, you can explore server-side frameworks like Express.js (Node.js), Django (Python), or Spring Boot (Java).

  2. Mobile App Development: If you're interested in building mobile applications, consider learning Swift for iOS development or Kotlin for Android development. Both languages have robust frameworks and toolsets for creating mobile apps.

  3. Data Science or Machine Learning: Python is majorly used in data science and machine learning. You can explore libraries like NumPy, Pandas, and sci-kit-learn for data analysis, and frameworks like TensorFlow or PyTorch for machine learning and deep learning.

  4. Game Development: If you have an interest in game development, you can explore game engines like Unity (C#) or Unreal Engine (C++).

Few Tips to Note

Java is complex. A little complicated to comprehend. But if you learn it well, it is a lot easy to find a job with it.

JavaScript is much easier to learn. But you might find certain frameworks a little complex. JavaScript is a hotcake in the industry. It will help you get a job, most likely as a web developer.

Python will make a really good start as a software developer. However, it is not likely that you would find a job as a web developer with just Python. You might end up getting data fields like Artificial Intelligence(AI), machine learning, and data analysis.

This would lead you to a much more complex and extensive search for knowledge outside the scope of Python. But that's what programming is about anyway. To solve problems. You get to improve on skills in statistics, calculus, algebra etc.

However, if your goal is to follow the web development career path, then you might need to learn a second language with some frameworks.

JavaScript is a safe bet. But Java and other languages on the top programming languages list will do you good.

Resources that will help you learn

Here are additional resources that can aid your learning process. they are beginner friendly, and most of them have coding challenges and problem-solving exercises that can help sharpen your skills.

Online Tutorials

Codecademy

freeCodeCamp

W3Schools

Coursera

Books

Automate the Boring Stuff with Python by Al Sweigart

Code Complete by Steve McConnell

JavaScript: The Good Parts by Douglas Crockford.

Join Tech Communities

There are coding forums that you can join, where beginners can ask questions, seek guidance, and learn from experienced programmers.

This is also true with tech communities on Slack. So, here are a few tech forums; ensure you sign up and get familiar with the activities therein.

Stack Overflow

Programming Subreddits

Remember, the programming journey is a continuous learning process. As you gain more experience and confidence, you can explore multiple programming languages and technologies based on your interests and career goals.

It's important to practice regularly, work on small projects to apply your knowledge and seek out resources like online tutorials, documentation, coding challenges, and tech communities to learn from others and get support.

Programming requires patience, perseverance, and a problem-solving mindset. Keep learning, exploring, and building projects, and you'll gradually develop your skills and become a proficient programmer. Good luck on your programming journey!