Supported by

I started using ” instead of * for comments

I have always used * to comment my code. I only used ” for pseudo-comments or to leave small comment at the end of a line.

But I recently learned that using ” makes much more sense.

While * is always anchored at the start of the line, ” is properly formatted by pretty printer.

So, I spent all these years manually indenting my comments whenever my code changed and comments became misaligned while, had I used “, everything would have been properly indented automatically. Why didn’t Abapinho teach me this 10 years ago? Ah… because, since I didn’t know it myself… I couldn’t have written it. Linear time is a sad prison indeed.

Greetings from Abapinho.

Um comentário a “I started using ” instead of * for comments”

  1. Ruthiel Diz:

    Uso sempre o ” também =)

    Achava muito feito com o *, pois ficava preso na posição.

    Com o ” o código fica mais alinhado, o que torna a leitura mais fácil!

    Mas o que tenho tentado é mesmo reduzir ao máximo a necessidade de comentários, usando bons nomes de métodos e variáveis… Nem que sejam comboios! :D

Deixe um comentário

About Abapinho
Abapinho runs on WordPress
Articles (RSS) e Comments (RSS).