Since finishing my studies, I have been on a job hunt in my field, and while I spend most of my time on this task, I still feel the urge to keep learning new skills that could be helpful during my professional career. With this in mind, I became interested in learning some basic coding with the goal of understanding the language and at the bare minimum be able to use it for small personal objectives, like building this website. In the future I hope to be able to use my coding skills in a research context, in tandem with Geographical Information Systems (GIS) and Statistics Software (SPSS, Excel) for example.
Below you will find some resources I have found useful in this quest. This list might be updated as I advance and discover new uses, techniques, or as my goals shift. Regardless, you might find some of this useful yourself, given you decide to challenge yourself similarly.
As a newbie, I will not pretend to know the best way to help you achieve your coding goals, but here are some things I found useful:
Start at the beginning: Although you might have developed your computer skills over the years, understanding the foundations of coding is key in becoming fluent with any coding language. Coding languages are built from the bottom up and to develop your skills to adapt your code to ew tasks you will need to be familiar with the most basic building blocks of any language.
Practice, practice and practice: Following tutorials is a great way to understand the inner workings of new languages, but to remember them and learn to mix them for new purposes will require you to become fluent in them, just like a real language.
Don't forget to ask for help: As great and fun as learning to code can be, it will get frustrating when you compile large blocks of code and sometimes cannot even find the errors. So, even if you don't have a mentor, remember other resources out there! Meet Grimoire the Coding Wizard. Grimoire is a GPT built and trained just for this task. While it can provide you with complete codes for any use, and exercises for practice, try to follow his corrections and tips!
Here is a sample of something I coded!
from datetime import datetime
def say_hi(name):
current_hour = datetime.now().hour
greeting = "Good morning" if 5 <= current_hour < 12 else \
"Good afternoon" if 12 <= current_hour < 18 else \
"Good evening" if 18 <= current_hour < 22 else \
"Good night"
current_date = datetime.now().strftime("%A, %d-%m-%Y") # %A gives the full weekday name
current_time = datetime.now().strftime("%H:%M:%S")
print(f"Greetings, traveller! I am Chronos, a function created to greet you in real time. The sole purpose of my existence is to say hi to you upon your command. You might wonder when are we? Without further ado... {greeting} {name}, today is {current_date} and the time is {current_time}.\nUntil next time!")
name = input("Enter your name: ")
say_hi(name)
Okay, fair, it might seem a little underwhelming... But just you wait until I learn how to embed this code on the website using a python interpreter. The ground will shake with this powerful piece of code! This code does run on .Obsidan. Here is an example of the output:
Example:
Greetings, traveller! I am Chronos, a function created to greet you in real time. The sole purpose of my existence is to say hi to you upon your command. You might wonder when are we? Without further ado... Good afternoon Alfonso, today is Monday, 18-12-2023 and the time is 14:42:20. Until next time!