• 0 posts
  • 18 comments
Joined 3 years ago
Cake day: July 23rd, 2023
  • For programming languages that make use of {}, the reason is (almost always) scope.

    Take for instance this:

    for i in 0..10
    do_thing();
    do_other_thing();
    

    compared to this:

    for i in 0..10 {
        do_thing();
    }
    do_other_thing();
    

    The intent of the first one is unclear. In the second one it’s clear you should loop do_thing() and then run do_other_thing() afterwards. The indentation is only for readability in the above though. Logically there would be no difference in writing

    for i in 0..10 { do_thing(); } do_other_thing();
    

    Languages that use indentation and line breaks for scope look more similar to this:

    for i in 0..10:
        do_thing()
    do_other_thing()
    
  • Generating quick programs like “a python script that calculates the mean value of two hex colours, outputting the result as a HTML file displaying the resulting three-color gradient”? Yeah, AI is decent at stupid simple tasks like that, and it’s much faster than me writing the script or calculating the values myself. I tend to generate things like these when I’m working on something else, don’t want to spend time on things outside the project I’m working on, and can’t find a website that does the thing I want.

    Touching my actual code? Hell no.

  • Been thinking about that game I started building a while back. Got some new ideas. Might pick it up again soon. It’s been so long though that I have to read all my notes and figure out what I was doing before I can do anything new. Dreading that part.

    1. Start writing a small game in Godot using GDScript (basically Python)
    2. Use the Godot docs to read about C# alternatives to GDScript as you go, compare them and see how they differ
    3. Translate bit by bit of your game to C# using the docs
    4. Congrats, you have written a game in C#