• 1 Post
  • 251 Comments
Joined 3 years ago
cake
Cake day: July 23rd, 2023

help-circle




  • 404@lemmy.ziptoProgrammer Humor@programming.devTOML
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    10 days ago

    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()
    





  • 404@lemmy.ziptoComic Strips@lemmy.worldWhat bothers me...
    link
    fedilink
    English
    arrow-up
    15
    ·
    24 days ago

    I feel the same about trigger warnings where the warnings are more triggering than the content. The ridiculous ones have petered somewhat, but at its peak you’d see stuff like

    TW: mental health, suicide, self harm, narcissistic abuse

    Post: I feel sad today :( my mum is telling me to clean and she doesn’t get me