Introduction

I’ve realised that I always advice the same thing to people that are thinking of starting programming. “If your current job involves using a computer, start by creating scripts to automate your tasks”. The advice is not easy to follow, and it doesn’t apply to everyone, but if you can make it work it can do wonders. This is the way I got into software - I hope someone out there can find these notes useful.

A One-line Real Example

The first script I ever wrote was by accident, it is only one line of code, and I basically copied it from an article online. I say it was by accident because I was not trying to code, but I just wanted to configure my computer to turn off after a few minutes or an hour (something that could be used to leave music on for a while when going to sleep for example).

Then what I did was google “turn off computer after few minutes, no software needed” (I really didn’t want to install any software for such a simple thing). I don’t recall the exact article that I found at that time, but this one I googled just now could do if you use Windows, or this other if you use Mac.

Let’s say you use Windows. This line of code would be more or less what I used back then:

shutdown /s /t 3600

That text is a line of “Windows batch scripting” programming language. It tells the computer to shut down in one hour (1 hour has 3600 seconds, hence the number). Test it now: create a Notepad file in your Desktop, test.txt, open it and copy that line of text into it, and then after saving change the extension of the file to test.bat. Double click the file and Windows will inform you that your computer will shut down in an hour.

What Did We Just Do?

We wrote a script, and we executed it.

Not all software is an easy-to-install final product with a colourful user interface. Sometimes people need to automate a repetitive task but it’s not worth creating a full-fledged software for it.

What they do then is to write a “script” (in this case it was a one-line script). The “script” is simply instructions for the computer to execute specific actions (actions to replace the manual execution of the task at hand).

Writing scripts is a fun way to start programming. You can simplify the tasks you do every day, and gain confidence in your ability to code useful programs.

What is a Scripting Language?

This question is not very easy to answer, so I prefer to link two videos that attempt to explain it (this one, and this one), and then I give my short simple answer: often, you can think of it as “a coding language for which you’ll not need to install anything to use it”.

Examples I think are best. If you are a user of MS Office (Excel, Word, etc.), then you could use the language VBA as a scripting language. If you are a user of AutoCAD, then you could use AutoLISP as a scripting language. You can also create .bat files in Windows (like in the one line example!) or .sh files in mac - these last two are called “shell scripting”.

The list can go on and on (please feel free to add here your ideas), and in some cases you will need to install a small add-in (e.g. Python in Revit) or the language itself (e.g. Python alone, for backup scripts or files management) to have the scripting language available.

Where Should I Start?

Going back to the main idea, if your current work requires you to perform tasks in a computer, list down those tasks, and see which one is the simplest for you to give it a go at automating it.

You can use any of the AI tools out there to help you create a draft of how your script should look like. You’ll need to tweak that first draft manually to make it work perfectly.

I list below a few things you could try coding:

  • A script for creating backups.
  • A script for using the keyboard in an automated way (maybe clicking the “right arrow” multiple times to review documents?).
  • A script to send an email, or at least to write an email based of a template and custom inputs (name, title, etc.).
  • Etcetera.

Conclusion

I think there are great advantages in starting to code with scripts. It isn’t the best road for everybody, but in certain scenarios the benefits are very clear: minimum setup (easy to start and no need for admin rights), possibility of starting to code in a in a non-software position, short development time, etc.

At the same time, some disadvantages are present. Scripting isn’t software development. You can use scripting as a door into software, but you will need to cover some gaps in knowledge with further studies if you want a software position in the future. Potential employers might also be sceptical about how transferrable your scripting skills are in the context of a software position.