6
-red
2y

auto abuse = veryReabab1eShet();
auto moreAbuse = n0tRealyNo();
auto ohNo = abuse(moreAbuse);

Comments
  • 2
    Your tags are confusing 🤔
  • 3
  • 2
    Auto a = func1();
    Auto b = func2();
    Auto c = a(b);

    If a code minifier is used.
  • 2
    It's a rant about readability.

    Someone writing in C++ chastising themselves by putting up funny variable / function names then nesting these weirdly.

    @-red has created art by abstraction and depiction of one of societies contemporary tormentments.
  • 3
    "AutoAbuse", @-red, C++, 2022-05-27
  • 0
    @scor as if it would be more readable if one would state the full type instead of "auto" 😑
  • 1
    @iiii
    Never said that.
  • 1
    @scor always out here giving credit to people. About time we do the same.
    I officially recognise @scor as the nicest person on devRant.
  • 1
    @iiii It actually definitely would be more readable, at least for me when in some situations, actual names are used instead of auto or the function names make it clear directly or indirectly what types are being used. Especially when this code is part of a larger clump of Spaghetti.
  • 0
    @-red dunno. It should not even matter what type exactly it is, only that it behaves correctly 🤔
  • 1
    @iiii Readability is regardless of that.
  • 0
    @-red still should not matter what exact type it is. The readability comes from either the initial value or the name of the function used to get the initial value. Writing exact type matters for declarations, not when you have a local variable for some intermediate results the types of which are known without explicitly assigning that intermediate variable a specific type, which does not matter in the end.

    PS: good luck stating exact types in every case if you're using standard template types.
  • 1
    @iiii I made it quite clear that my complaint is when we're not talking about templates/loop iterators/lambdas.

    Imagine you have a lot of complex structs which are meant to be transactions. It helps significantly to know what type of message you're dealing with to get a functional sense for what you're working with or to figure out what members it has and what methods it has so you can work with them later.

    Or when you're using different types inferred by auto in operations which might result in incorrect behavior when someone new to the code changes these operations in the slightest way. Simplest of them being dealing with signed and unsigned int.
    When someone sees, a < b, how many of them do you think go back and check the types of a and b before modifying this code ? Only a handful. And unfortunately for us, they are outnumbered by the rest.
  • 0
    @-red fair. Reviews are for that
Add Comment