When we think of programming we sometimes visualize a white-collar person in their office working a five-to-seven shift, or a nerd in their basement at 3 a.m trying to finish a program.
Most of the time this view is far from the truth. Some people that are not directly related to IT use it everyday – scientists creating automated reports, marketing teams analyzing last year’s efficiency or 3D graphic designers creating scripts for generating objects in one click. But are all of them math geniuses creating complex algorithms in a matter of minutes? Probably not. Programming is not only about maths or sleepless nights trying to compile code. Should you start programming as well? Well, that is not for us to decide, but we will give you some directions around the world of programming, so you can decide for yourself.
Image credit: Pixabay (Free Pixabay license)
Computers we own understand only binary code. This does not mean we have to program them by inserting sets of zeros and ones to create a program, although this is still an important part of programming. In the late 1940s Kathleen Booth wrote the first assembly language, which allowed us to write code in a more readable manner, and also a lot quicker. From that point in history, hundreds of languages arose. Nowadays we use high level programming languages (HLs).
Unlike assembly languages, code written in HL languages does not correspond strongly to instructions of a processor. These languages provide a structure and keywords that are comprehensible to humans. They also take care of many things such as managing the memory or data in the registers inside of a processor, but it costs the speed and the flexibility of a program. The evolution of coding does not end there! You may have heard of Scratch. The whole process of programming was stripped from writing code just to implementing logic visually. With visual programming, instead of writing instructions, you simply put blocks together on top of each other; but let’s not sugarcoat it: even though it is easier, you’re still the architect of an algorithm – a formula for solving a problem. Lucky for us, there are libraries. They are collections of functions and data shared by other programmers, so that you do not have to reinvent the wheel. It is a common practice to use them and there is no shame in not doing everything by yourself. A good evidence of both of these are Github and Stack Overflow – the most popular websites where you can ask questions and find the code you need.
The programming community is willing to answer the easiest question you can imagine in the most informative way. But the main and surely the most detailed source of knowledge is documentation. It consists of a description of every single function and what arguments you should pass to use them. It also covers usage examples etc. Documentation may be boring and confusing for beginners. Nevertheless, getting used to reading it will result in a deeper understanding of the code you write and using the full potential of libraries.
Figure 1: Examples of code displaying “Hello, World!” on the screen. Image credit: Jędrzej Drozdowski
Programming can be separated into different branches such as web development, mobile applications development, video game development and many more, and the lines between them sometimes get blurry. This is the reason why there are a variety of programming languages: different uses, ideas and ways of programming (also called paradigms). You might not want to use slow languages in a device taking thousands of measurements per second. That means you will probably have to learn more than one language depending on what you want to achieve. You may even have to mix multiple languages in a single project, but let’s not worry about that for now.
“I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.” – Bill Gates
Let’s be honest, humans inherently seek comfort, simplicity, and a way to avoid work. That is the sole purpose of computers – do things for us. How could you, a casual user of a computer, use programming to ease your life? Let’s look at examples of programming languages and their applications:
Python – a simple, easy to write, but a slow language, resembling plain English. Used in data science, web development, machine learning and task automation. If you are collecting a lot of data, you may use this language for data visualization. It is particularly useful if you manage your expenses or keep track of habits, such as a diet. Make a graph out of that data! Graphing is not only a great way to help you understand what is going on, but also an exercise to understand the basics of statistics. There are a lot of libraries, like the widely used Pandas and Matplotlib, that make manipulating data and graphing them very easy. When you get comfortable with the basics of programming and statistics you can dive into machine learning, feed your algorithm with numbers and potentially predict future trends.
C – one of the most popular and oldest of programming languages. It had a great influence on other languages. It allows you to do a lot of things freely and it is fast, but the drawback is the responsibility for your code – managing memory by hand, no direct error handling etc. Even though this language’s history began in 1972, it is still alive, especially in the world of embedded programming. There are platforms (such as Arduino) which allow you to program themselves using C. A little bit of electronics knowledge and a lot of patience may result in homemade devices, like an automatic plant watering system or a CNC machine.
Java – a universal language. It is used in almost all fields. Even the best selling video game in the world, Minecraft, is written in Java! Java is purely object-oriented (OOP). Some consider OOP to be the most natural approach to programming, the closest to how humans think. It might be a good starting point for beginners, even though it is not the easiest language. It is interoperable with Kotlin – a language gaining popularity in mobile applications development, so learning both of these might make a good skill set if you are planning on writing apps for mobile devices.
So, after reading this article, you need to acknowledge that all of that information is just the tip of an iceberg. Also the question in the title is rhetorical. The real question is do you have a project in mind? If you do, use the right tool for it. If there is a single, simple document to create, there is no need to spend the next month learning Python just to automate it. Same as you would not use a sledge hammer for a nail to put a painting on the wall – it is an overkill. Also, do not choose a `close enough` tool. It may look like a hammer and you can use it as a hammer does not mean it is a good hammer. You should search on the internet what is the most suitable programming language or if there are libraries useful for your project in a programming language you know, and what is the best approach. There is nothing stopping you from beginning a journey with programming other than a will to do so. Take advantage of the community that programmers have built, be curious and patient.
COW is an esoteric programming language which only consists of modifications of the word “moo”. An example code required to generate the Fibonacci sequence:
MoO moO MoO mOo MOO OOM MMM moO moO
MMM mOo mOo moO MMM mOo MMM moO moO
MOO MOo mOo MoO moO moo mOo mOo moo
The oldest programming language still in use is Fortran. It was created in 1957 by John Backus.
According to Stack Overflow’s annual survey, the most loved, dreaded and wanted programming languages are respectively – Rust, VBA, Python.
Ada Lovelace is considered the first programmer. She was a mathematician and worked on a mechanical computer known as the Analytical Engine.
A “bug” is a malfunction in a computer program or a machine. The first recorded use of the term is from 1878 in a letter written by Thomas Edison: “You were partly correct, I did find a ‘bug’ in my apparatus, but it was not in the telephone proper. It was of the genus ‘callbellum.’ The insect appears to find conditions for its existence in all call apparatus of telephones.”
This article is a joint work of Jędrzej Drozdowski (Faculty of Environmental and Mechanical Engineering, Poznań University of Life Sciences) and Karol Masztalerz (Department of Physics and Astronomy, the University of Manchester) as a part of the Science Embassy project.
Pereira, M. Couto, F. Ribeiro et. al. Ranking programming languages by energy efficiency, Science of Computer Programming, Volume 205, (2021) DOI: 10.1016/j.scico.2021.102609
Bissyandé, F. Thung & D. Lo & L. Jiang & L. Reveillere, Popularity, Interoperability, and Impact of Programming Languages in 100,000 Open Source Projects, Proceedings – International Computer Software and Applications Conference, 303-312, (2013) DOI: 10.1109/COMPSAC.2013.55.
Cifuentes, D. Simon, A. Fraboulet. Assembly to high-level language translation. Proceedings, International Conference on Software Maintenance (Cat. No. 98CB36272), (1998) DOI: 10.1109/icsm.1998.738514