:LinksProgramming

Useful resources for learning programming

Books

Good starter languages

Other language stuff

Simple beginner challenges

  • Program that just prints "Hello, World!" to the terminal

  • Ask the user for their name, then print Hello, <name>!

    • Ask for birthday too, print Happy Birthday! if today is their birthday

  • Number guessing game:

    • Program picks a random, secret number between 1 and 100

    • User enters a guess, program replies with Too small!, Too big! or Correct!

    • Loop until user guessed correctly

  • RPN Calculator

    • read lines of text from user, evaluate each one separately

    • start with basic operations (add, subtract, multiply, divide)

    • e.g. entering 1 2 3 + + 7 * should output 42

    • decide how to handle more than one element on the stack when outputting (e.g. fail, output only top element with warning, output entire stack)

    • add constants (π (Pi), τ (Tau, Pi · 2, the cooler Pi), e (Euler/Napier constant), …)

    • add support for more complex functions (e.g. roots, powers, logarithms, trigonometry, …)

    • add support for reading & evaluating an entire file (i.e. all at once, not line-by-line)

  • ToDo list application:

    • accept commands:

      • add <arbitrary text>

      • complete <index>

    • after each command, display a list of items with their indices

    • add save & load functionality: when given a filename, the program should try to load the todo list from that file & save it on exit (e.g. add a command exit or react to Ctrl-C or Ctrl-D)

    • also save date & time for each added item (if you haven't already, maybe switch to JSON or YAML for your savefile format?)

    • add sort <what> command, what can be text or time, sort todo list by that, ensure that it's persistent (when you save & load, the order should be the same since the last sort)

Advanced challenges

Things to avoid:

  • Learning a specific language instead of general techniques

  • Trying to build too big too early / skipping over small exercises

  • Python (for general purpose programming; it's still a nice scripting language)

  • Rust:

    • extremely over-designed

    • oriented more towards intellectualism than actual problem solving

    • highly fragmented package ecosystem; dozens of packages for the same thing

Subhyphae