159
Hitman
8y

Real programmers don't comment their code. It was hard to write, it should be hard to understand.

Comments
  • 6
    More like fuckit mode on
  • 16
    I comment in binary
  • 3
    I only include salted hashes of my comments. Now all the evil h4ck3rs cant decrypt them
  • 2
    I prefer not commenting on easy code and commenting on hard code so all code is understood at the same level of hardness.
  • 2
    @tisaconundrum thanks, now I'll always convert my comments to binary
    Maybe even Morsecode
  • 4
    @n1had lets build a plug in for ides that does the conversion automatically
  • 0
    @Jase i get that. In your example it would be unnecessary.
  • 2
    @Contumil !#/usr/bin/good-luck
  • 1
    @tisaconundrum You comment literally in ones and zeroes or comment (hex editor?) the binary file? If the second choice - do you at least give the courtesy of not stripping the dev release?
  • 2
    If you're a professional you should comment your code if it's not trivial. Sometimes the code is self explanatory, sometimes you should search through many files to understand just few lines of code.

    First, you have to write good code which does not require comments. That doesn't happen most of the time.

    If you're expecting that people just understand because you do at the time of writing try looking to your code after a year. Still clear? That means you're project has the complexity of a 'Hello World!'.

    Second, projects require documentation. That is a way of documenting something.
  • 1
    @shasha in my experience 9 times out of 10 you're not writing for other people - it's for the future you! So really how much time do you want to spend with it down the road? If you like puzzles without all the pieces or if you're a professional code golfer (note to self: does that exist?!) Then no comments, otherwise don't be a jerk to future you.
  • 2
    @shasha completely agree. For sale of completeness and by way of example, here is a recent commit to "ls.c" -- literally a patch for the 30 year old ls command (if your on Windows.. don't worry, I'm sure 'dir' is well commented but that code is a golden trade secret. Last commit was during cold war ( :) Anyways.. http://git.savannah.gnu.org/cgit/... I think there is more comment than code, but suffice to say that the devs are "professionals"
  • 1
    I sometimes write comments before code as a way of organising my thoughts as to what the code should do before I write it.
  • 2
    Good code should be self explanatory though
  • 0
    @chrisrhymes great tip. Thx man.(right now i am on simple stuff so i don't need it. But later it will be helpful.)
  • 1
    @SweetHuman #greet the user
    echo "hello world" 😌
  • 1
    "I'm smarter than you". Or this bloke only works on his own code that nobody else does.
  • 1
    @shasha Amen to that.
  • 1
    @bp85 I think that was addressed at me?! I don't normally go by bloke but wth...

    It's not that I want to, but rather if a bug ticket comes back and people refuse to touch it unless you're out of the office. Personally, I was taught to pull the ticket, fix, verify, ship it, but this shop's different I guess.
  • 1
    I comment it because I don't understand it after typing 😂😂😂😂😂😂
  • 1
    watch?v=1cXquTPBpWo&t=1919s
    Chet Haase puts it in "proper" perspective
  • 0
    I accidentally saw your post, it's great with a lot of interesting information.
  • 1
    Like many aspects of programming, the decision to comment or not depends on the specific context and the preferences of the development team
  • 0
    @jeffreestar Striking the right balance between clarity, conciseness, and documentation is key.
Add Comment