Hacker News new | past | comments | ask | show | jobs | submit login

[dead]



A great example of how NOT to write Java. You say absolutely nothing with a whole lot of extra words.

For example: //============================================================== // Ajqvue Constructor //==============================================================

   public Ajqvue()
The constructor definition is already clear, I don’t need a big header telling me what a constructor is.

Instead, use comments generously where needed - for example, if you have a piece of business logic, a comment explaining the intent behind it can help the maintainer (likely you) a year down the road. What I mean by this, is that what your code DOES should be self evident - but documenting the business decision behind the implementation has done wonders for me.


Anyone suggesting their -own- code as an example of the "most elegant codebase" is dubious. Practice some humility.


I’d be a little forgiving if it was almost an art piece. Like, they spent a year making the most elegant JSON serializer possible.


The getWebsite method comment says it returns the version. That's an example of how not to comment - totally pointless and misleading if it diverges from the code. The code is nice and clear without the comments.


This is pretty good! I'd be happy to work with you :-)

There are undoubtedly some pointless comments, but there are some good ones too, and the code is understandable. I think the sibling comments are being overly harsh and are zeroing in on single examples and missing the forest for the trees.

I suspect recommending your own code as an example of the most elegant codebase is triggering to others, so there's probably a negative initial reaction and probably a lot of people clicking your link so they can point out why you're wrong


Good structure overall and appreciate the summary at the top. For the inline comments more "why" and less "what" would give higher signal-to-noise as a large percentage of that content is adding nothing that basic Java syntax and variable names don't already tell you.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: