• 1 Post
  • 9 Comments
Joined 2 years ago
cake
Cake day: February 19th, 2024

help-circle

  • i and I are acceptable in small loops. But it depends a lot on the language used. If you’re in C or bash maybe it’s fine. But if you’re in a higher level language like C# you usually have built on functions for iterating over something.

    For example you have a list of movies you want to get the rating from, instead of doing

    for (i = 0; i < movies.length; i++)
        var movie = movies[i]
        ....
    

    Its often more readable to do

    movies.forEach { movie -> 
        var rating = movie.rating
        ....
    }
    

    Also if you work with tables it can be very helpful to name your iteration variables as row and column.

    It’s all about making it readable, understandable, and correct. There’s no point having comments if you forget to update them when you change the code. And you better make sure the AI comments on the 2000 lines of three letter variables is correct!








  • That doesn’t sound like a TOTP vs passkey situation though. It sounds like the program just releases the passkey when you give it the fingerprint. There wouldn’t be anything stopping the program from generating a OTP and passing that along when you identify with the fingerprint.

    I think a big issue is how difficult it can seem to be to get easy access to TOTP codes, like in your example digging up your phone. But that’s more of a browser/operating system failure for not implementing a way to generate those codes like they can already store usernames and passwords.