Bits

If you want to start coding and don't know how, then you might find some inspiration here!
< Go Back

What is this?

When I first started my studies I had little to know knowledge about computer science or programming and was intimidated by the reputation that precedes it. If you are in the same situation as I was, then you might find something on this page where I share resources that helped me to get started together with things that I whish I would have known earlier.

Getting Started

Learn how to internet!

First things, first! Learn how to google! It is important that you need to find your solutions on your own before asking anyone else for help. Asking for help is good and very important but i think its very embarrassing to aks a college for help and seeing him / her to google the answer and getting the solution from the first result (no that never happened to me, I promise).
A few tips:
  • Include as many strong keywords as possible. Which language are you using? What error message did you get? What operating system are you using? Which version of your language are you using?
    Example: NameError: name 'plt' is not defined Python 3.11 Mac Matplotlib
  • StackOverflow is your best friend. I don't know why, but there are many many highly competent people that are answering random questions on this site. But be careful with asking questions... if it's a dumb one (yes there are dumb questions) then you will be destroyed. But most of the time, you will not be the first person encountering the error.
  • When asking a question include as many information as possible. What is your goal? What did you try? What is the exact error?
  • Use googles advanced search feature. There is a lot however most of the times I use - and " to search for either exclude keywords from my search or to explicitly search for a word.
This list is inspired by "Weniger schlecht programmieren" von Johannes Jander und Kathrin Passig (btw. a nice and funny book with useful tips)


What Language do I start with?

The harder the language, the more you learn. If you understand FORTRAN perfectly then you will (presumably) have no problem understanding Python but not vice versa. I learned Java first and I hated it, but I was forced to learn a lot that I would not have learned when starting with Python (Object Oriented Programming, private vs. public vs. protected, etc.). I would say learn Java (or even C) first if you really want to dive deep into programming, however if you want to have quicker achievements and you will only use programming for some data science / plotting, start with Python.

First Steps

First getting started with coding seems pretty challenging since a programming language does not look like anything you have seen before (and i guarantee you it's not like in the movies). However there are only a few core functions that are intersecting with almost every programming language, for example loops, conditional statements (if, else), variables and functions. In the future I want to create a road map for learning how to code the easiest way but for now it helps to get familiar with variables and the definitions of data types first.

List of useful resources:
  • Corey Schafer is the g.o.a.t. He has many, many, many videos to all kinds of topics but I think the first 8 videos of this playlist will already help a lot with getting started
  • Fireship - 100 Seconds of Code is an awesome playlist to get a quick introduction to alls kinds of coding related things.
  • Fireship - Copmuter Science 101 For a quick and very dense packed overview about computer science, watch this video. The goal of your studies is, to be familiar with those terms... but don't worry, this will take a while!
  • w3schools feels illegal to visit since the tutorials are very great and free. It covers HTML, CSS, JavaScript, Python and many more. Try it out!
  • FreeCodeCamp offers all kinds of courses and blog articles about programming. There are also various articles about getting started that might help!
  • Of course I have to mention ChatGPT in that context. It helps you to ask specific questions about coding and even (re-)writes code for you.

To Look like a Pro

In this section I present some python techniques that are nice to know and will let you look like someone who knows what he / she is doing! Of course you should read this with a wink because you should only use it when it makes sense.

List Comprehensions

# Do this:
times_three = [x * 3 for i in range(10)]  # [0, 3, 6, 9, 12, 15, 18, 21, 24, 27]

# Instead of this:
i = 0;
times_three = list()
for i in range(10):
	times_three.append(i * 3)
# [0, 3, 6, 9, 12, 15, 18, 21, 24, 27]
As I said, it depends on the use-case but often this approach is much faster and much more fun to write! A more detailed description of this feature can be found here.

F(ormat)-strings

Inserting variables into strings can be a tedious task, as the process of converting their values to strings and then concatenating them with a plus sign can be both cumbersome and visually unappealing. Fortunately, Python has provided several methods for streamlining this process over the years. The %-formatting method and the .format() function were both introduced as alternatives, but in Python 3.6, a new method called F-strings was introduced. These F-strings allow you to easily create formatted strings by preceding the string with an 'f' and enclosing the variables within braces. This allows for the use of arbitrary expressions, making the syntax more concise and precise while also improving performance. Unless you are working with a version of Python earlier than 3.6, I recommended to use F-strings for string formatting tasks

name = "Adrian"
some_float = 1.234567

# before
print("Hello my name is " + name + " This is a rounded float: " + str(round(some_float, 2)))
# Hello my name is Adrian This is a rounded float: 1.23

# after
print(f"Hello my name is {name}. This is a rounded float: {some_float:.2f}")
# Hello my name is Adrian This is a rounded float: 1.23

# even expressions are possible
print(f"8.4 times 5 is: {8.4 * 5}")
# 8.4 times 5 is: 42.0

Game Dev with ChatGPT

Contact

I'd love to hear from you! Whether you have a question, feedback or just want to say hello, I'm always here to help. Fill out the form below and I'll get back to you as soon as possible. Thank you for reaching out! 😊