Simple versus Complex - on code commenting

in #programming6 years ago (edited)

Screen Shot 2018-05-03 at 10.11.07 AM.png

Recently, utopian added a new question to score contributions. It's about the quality of comments. In order to score high, you need to add comments to your code.

Let's forget this for now and talk about simplicity.

Every man's life ends the same way. It is only the
details of how he lived and how he died that
distinguish one man from another. - Ernest Hemingway


It's clear enough, right? You can understand the author's intention without further explanation.

Our generation has had no great war, no great
depression. Our war is spiritual. Our depression is our
lives. - Chuck Palahniuk


It's the same. No bullshit, just straight to the point.

Let's see another quote:

“Once there were brook trout in the streams in the mountains. You could see them standing in the amber current where the white edges of their fins wimpled softly in the flow. They smelled of moss in your hand. Polished and muscular and torsional. On their backs were vermiculate patterns that were maps of the world in its becoming. Maps and mazes. Of a thing which could not be put back. Not be made right again. In the deep glens where they lived all things were older than man and they hummed of mystery.” - Cormac McCarthy


It's hard to read. I need to focus each sentence and try to understand.

Code commenting


I believe codebases are the same. Source code should be simple and easy and should explain itself in the source.

Screen Shot 2018-05-03 at 11.33.58 AM.png

Rob Pike on code commenting

If you do something hacky, tricky you can add a comment to the related part. That's a real requirement for the code comments, but can you say, these comments add any value? (Taken from a real open-source project.)

Screen Shot 2018-05-03 at 11.37.30 AM.png

Oh, it's the current buffer...

Sort:  

Writing good comments is almost as difficult as writing good code. You have to decide on which parts you want to comment and how (you don't just want to replicate in words what the code does but rather why and maybe how).
Comments can make one's life so much easier!

Great post. I've read a couple of Cormac McCarthy's books and they are frustrating to read. I'm glad he doesn't write code!

You're quickly becoming one of my favorite content creators here. I love reading your posts, stay awesome.

I remember in my 3rd year. My programming lecturer always wanted code comments. It turns out I had a bad style for code commenting. Code comments are an integral part of coding. Right now, I almost always comment on my codes.

This post was an excellent way of reminding me about code comments. Thanks!!!

I never comment, makes it easier to avoid all responsibilities:)
But yeah, got a complaint about that in my last utopia post

When you look at your uncommented code after a long period of time, do you know what you did? :-)

I wouldn't even know after a short period of time looking on my commented code:)

That score system doesn't work at all. They try to open it to all but It collaps with friends scoring :D Then A supervisor come and delete all scores. And add his scores. That means. There is no need to score if you are not supervisor or mod. The system is keep changing. I don't believe anymore it's getting better.

Hey! I'm actually the person responsible for most of this scoring system. And you're not wrong - if a Moderator or a Community Manager reviews a post, it's close to impossible to change the score in any way by yourself. We're aware of that, it was meant to be this way until users of higher reputation come into the picture. This system is meant to be scalable, which means that in the future, when we might have far too many contributions, our moderators will not check each and every post and the community will decide on what should pass and what shouldn't.

That being said, feedback is always welcome, feel free to DM me on discord if you want to talk about it ;).

I hope to see that system work with a larger participant from the community. I think It's a good thing to give control to the community but as you know there will be always abusers who will try to abuse. The mechanism that moderator can cancel the scores is well thought. The human nature is the problem I think. We can't solve that at least I don't have a solution to this bad reflexes. "I don't believe anymore it's getting better." part wasn't about score system. I tried to tell myself in design channel but I don't think I could :) Utopian made me improve in many ways back then. Yes, It improved too with rules and dealing with abusers. But It lost its soul I think. I still can do something and get rewarded if I look a bit how to do. But the real problem I don't want to anymore. Maybe your score system can take it back. I don't know what was it and how utopian lost it. Utopian needs to look back and think sometimes. Thanks for the comminication ;)

Thank you so much for your feedback. We're facing a very difficult time internally and it's sure that a lot of changes are to come. We focused so much on making sure we don't get absued that maybe we really lost the soul of the project. We couldn't see it from our position, but if that's how you feel, I'll make sure this will get discussed on the next occasion.

I hope you'll be back with us eventually ;)!

I hope that too :)

This is one of the reasons that takes time for open-sourcing hede.io and developing on utopian. I had asked if self-explanatory code is counted as comments but unfortunately it is not.

Thank brother to info

Coin Marketplace

STEEM 0.15
TRX 0.15
JST 0.028
BTC 54179.48
ETH 2261.18
USDT 1.00
SBD 2.31