Comment

Comment by nikster

Yeah well...

Great code needs no comments.

Bad code needs lots of comments.

I've seen examples of both recently.

I randomly met a guy who told me of his idea to implement a UX framework with windows, buttons, views, etc in python.

A week later he sends me the finished framework. And it's perfect. It's easy to understand, all the names of things make sense, it's orthogonal. Not a single comment anywhere, but perfectly clear. Great code basically.

And there's a project I am maintaining where some parts of the code are pretty much impossible to understand, full of duplicated code - somebody loved copy&paste - duplicated method and class names, and threads going off in all directions. There is a comment for every line of code but despite the fact that I consider myself pretty good at reading other people's code, I am not touching that thing with a 10 foot pole.

My goal is to write code that doesn't require a lot of comments.

parent nikster 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton