Tag: code

  • Keep your friends close and your variables closer

    Keep your friends close and your variables closer

    Back in the day, I used to have this habit of declaring all of my variables at the top of the file. My thinking at the time was it would keep everything organised so if I needed to jump to one I’d know where to go looking. While that might sound like a sensible approach…

  • How to function correctly

    How to function correctly

    Coding is a fairly amazing thing to be able to do. There are effectively no limits to what can be done when you’re more or less writing the universe from scratch. Having said that if Spider-Man movies have taught us anything (and I think we can all agree they have) it’s that with great power…

  • Simplify conditional statements

    Simplify conditional statements

    Consider the following code: Looks good right? It’s logical and easy to understand, just your standard if statement. All true, but over the course of an entire project you’ll make a lot of considtional statements like this and using 5 lines of code when 1 will do can create some serious size increases to your…

  • Avoid abbreviating variables

    Avoid abbreviating variables

    Do you know what’s super annoying when reading someone else code? Abbreviated variable or function names. Until late 2017 I hadn’t done any coding in years so I was rusty as all hell, and truthfully I still am. One thing I noticed when looking at other peoples code was how it made it far slower…