Learning to write programs stretches your mind, and helps you think better, creates a way of thinking things that I think is helpful in all domains.
-Bill Gates,Microsoft.
I think everybody in this country should learn how to program a computer…because it teaches you how to think.
-Steve Jobs, Apple Inc.
In fifteen years we'll be teaching programming just like reading and writing…and wondering why we didn't do it sooner.
-Mark Zuckerberg, Facebook.
Don't just play on your phone, program it.
-Barack Obama, POTUS.
Technology, be it in the form of computers, phones, or anything in between, has become ubiquitous in our lives, and it will continue to shape our future. Logically, all the applications and advancements that make our lives more comfortable are fueled by the efforts of those behind the scenes, developers and engineers who work day-by-day to bring us a better product. Not only our reliance on these is going to keep increasing, but the job landscape in the next few decades will be in a state of constant change due to the automation of many jobs as artificial intelligence (AI) keeps phasing out entire industries.
However, computer-related occupations such as engineers and technicians working with computers, programmers and software developers are expected to keep growing and taking a bigger percentage of the market share. 7 out of the 10 best jobs in America for 2021, according to Glassdoor involve programming.
Added to this are all the endless applications of programming. George Gilder, an American investor, described computers as "inscribing worlds on grains of sand". From mobile applications and webpages, to videogames, to intelligent assistants; all these are powered by the same core methodology: coding instructions for a computer to follow.
I wouldn't consider myself an expert programmer, not even close. But I have studied and used different programming languages during my life. Among these, roughly in order, are Visual Basic, Java, Arduino©, MATLAB®, Python, C++, HTML and CSS. By far the ones I'm the most comfortable are MATLAB and Python, with C++ taking a distant third.
I used MATLAB during most of my undergraduate studies, since that's what we were provided and "taught" in our engineering classes. However, the proprietary nature of MATLAB, made it difficult to use after graduation since the licenses were expensive, and at times it could feel more like a calculator on steroids rather than a fully developed, multi-purpose programming language.
During my last semester of undergraduate, I took a course in Python and since then I haven't looked back. I will briefly try to summarize the main reasons why I would recommend Python to beginner and novice programmers, and most people planning to do work on scientific computing, including but not limited to data science, machine learning, deep learning, computer vision, natural language processing and others.
It's extremely easy to get started with due to its natural, human-like syntax that includes no variable type declaration, among others that make it easier for both beginners and seasoned programmers to read and write. See the comparison below for the most basic program to start with Hello, world! written in C++, Java, and Python:
Python usually comes pre-installed on MacOS and Linux, and it's easy to install on windows. There's also many alternatives online including Coding Ground Python Online Interpreter, Google Colab, Kaggle Kernels, and others.
A picture is worth a thousand words. Below you can see examples of how IPython/Jupyter Notebooks make it easier to execute and visualize what you're coding.
This combined with abstraction and high-level APIs allow for developers to build powerful applications in relatively few lines of code, without as much understanding of what's happening below the hood, compared to others. Note: I still think it's good to understand what's happening but it's not always necessary.
I already gave a few examples above on how we can in just a few lines obtain visualizations, but we can also even setup machine learning models (in this case for image classification) in a similar fashion:
Other possible languages to learn include C, C++, Java, Javascript, but I would still recommend Python for starters, and then based on your goals you can learn another. After all, programming is all about learning and keeping up as technologies further change and develop.
Automate the Boring Stuff with Python by Al Sweigart. It's, in my opinion, the best book to get started with programming. It covers the basics in a really intuitive way, and then goes through a number of possible simple use cases for scripting and automation of tasks. It's available in a text format in the provided website, as a hard-copy version, a Udemy online course, and a YouTube playlist. The first 7 chapters (starting from 0, so 0 to 6) are absolutely essential to understand the basics of the languages and I would recommend them to anyone that's getting started to grasp the fundamentals of programming with Python. From there the rest of the book covers different automation tasks, so it's skippable but still pretty interesting and can be good practice depending on your goals.
Another one that is widely acclaimed as a great starter book is Python Crash Course by Eric Matthes. This one is available to purchase as a hard-copy book, e-book available in that website, but the PDF can also be found online. To be honest I have never read it, but I deeply agree with his views on coding:
Code is power, and learning to code gives you power. The more you understand code, the more you understand how much impact tech platforms and products have on people's lives - whether through the implementation of specific features, or the lack of implementation of certain features. When you've built a platform that a significant part of society uses for communication, for example, your code has direct impact on society itself. When you write code that helps determine who gets a loan, you impact who can afford to buy a home.
Those who have power are desperate to hold on to that power, and are willing to use force to hold on to that power.
As you learn to code, please be aware of the power you are gaining. As you work on projects, whether your own projects or those that are controlled by someone else, please focus on projects that share power. Please refuse to work on projects that consolidate power, especially for those who will use it against others.
-Eric Matthes, Coding is political.
Asides from this there's many online courses in Udemy, Coursera, edX and YouTube, with special shoutout to the ones from FreeCodeCamp and Corey Schafer. In the end we all have different preferences when it comes to learning, so a possibility is checking out a few minutes of each course to get a feel of the instructor style and the course structure, and go with one that you like. After all, this is just the beginning.
Simultaneously while learning programming in Python, it may be good to get a basic understanding of Computer Science, how do computers work and why they work the way they do. This, and much more, is what you will learn in edX CS50x: Introduction to Computer Science with Professor David J. Malan, from Harvard University. The first few lectures of this course are hands down one of the best educational experiences I've had in my life. Some of the topics included in the course that are fundamental for anyone taking programming seriously include abstraction, algorithms and data structures, among many others.
At this point you should be familiar with the following basic concepts: variables, flow control (ifs and loops), basic data types (ints, floats, string, bools) and data structures (lists, sets, dictionaries), functions and ideally classes. Classes are not covered in Automate the Boring but here's a good playlist on the topic.
What comes later? Well you could take more courses in more specific applications, for which I may (see section on Python for scientific computing) or may not have specific recommendations. Something I definitely recommend though, for everyone who has gotten to this point, is to read or watch at least a bit about version control and why it's important for anything software related. I personally think the following playlist is one of the best regarding the topic: Git, GitHub and Version Control Playlist from The Net Ninja
To be honest, at this point, the best thing I would recommend doing though, is to look for something, something where you could apply what you've learned, even if you don't know all the details, because I've found that most people learn the most by doing. You can read and sit through lectures all you want, but it's not until you have sitten through an end-to-end project, that you really get to connect all those dots of everything you've learned. And usually during the process you also end up learning quite a lot of new things. So go there and build (or break) some program!
In my opinion, programming is much more about than knowing a language specific syntax, or remembering which functions or library to use for what. Rather, programming is knowing how to think algorithmically; this is, how to break a big problem into smaller problems you can solve in a methodological fashion.
"Select multiple columns of array python"
-Common search I often do while working with data
It's normal to feel lost. Sometimes it can help to write your ideas, draw them, or discuss them with others. Also, if you don't know how to do something specific, as long as you can express it in the correct, concise way many times you can just Google it! For me, one of the most important parts of programming is understanding how to break a big problem into those small, solvable problems that you can Google, then put everything together.
If you're already familiar with Python, or with programming in general, but want to begin getting into scientific computing, then this is probably in my opinion one of the quickest tutorials to learn the basics: Stanford CS231n Python Numpy Tutorial (with Jupyter and Colab). It includes three important libraries for scientific computing: NumPy, for linear algebra, SciPy for scientific and engineering applications, and Matplotlib, for plotting. If you come from a MATLAB background this tutorial may also be good: NumPy for MATLAB users.
This post provides a list of resources for people looking to get started into programming, focusing on Python.
If you like this post, or have any questions, feel free to leave a comment or contact me on any of my socials, found at the bottom of my Github Pages.