10
\$\begingroup\$

Please post your nominations for the Best of Code Review 2016 - Best Newcomer (answer) category.

Best answer by a user who had not posted an answer before 2016.

In your nomination post, please make sure to include a link to the nominated answer. Include a short explanation of what makes the suggestions in the answer exceptional.

The following SEDE query will return all potential candidates.


Small characters at the bottom: Only one nomination per post. Nominated answers must have a creation date in 2016. Downvotes don't count. Santa reserves the right to award the top-voted nominee a special bounty as a token of appreciation on behalf of the Code Review community.

\$\endgroup\$
12
\$\begingroup\$

Cody Gray's answer on Implementing realloc in C left a good impression on me.

It started out simple enough, with the usual remarks about formatting, braces, and declarations. Then it gets more insightful:

  • The call to malloc() is buggy.
  • The call to memset() is unnecessary.
  • The entire my_realloc() function is buggy, and in fact impossible to write without access to the internals of the corresponding malloc function.

Then, there is a heavily commented suggested implementation that explains in detail how it works.

The answer concludes with a general discussion about the complexity of realloc and suggestions on how to tame that complexity.

In all, it's a very thorough and impressive discussion of just 8 lines of code — and Cody's other answers are equally top-notch.

\$\endgroup\$
6
\$\begingroup\$

Answer on "Event scheduler in C" by @Herickson. First answer posted March of 2016.

Of the most upvoted answers, this is the first one that reviewed multiple aspects of the code rather than making a single observation. It explains how to use a do/while loop effectively to reduce code length, and it thoroughly covers malloc and null pointers.

\$\endgroup\$
4
\$\begingroup\$

I'm going to nominate my answer to the question "Battle game in one 900-line class". From an answerer's perspective, this is one of the answers that I put the most effort into. I came back to the question several times over a period of days. The answer covered various beginner issues from excessive duplication through to misleading line spacing, eventually resulting in a suggested alternate implementation.

\$\endgroup\$
3
\$\begingroup\$

Answer on Constructors for a class to represent a price in € or $ by Philip C posted on January 2016.

This topvoted but unfortunately not accepted answer is made as a step by step guide resulting in an easily extensible, maintainable and readable version of the former code.

The answerer explained well how and why the changes should be made.

\$\endgroup\$
2
\$\begingroup\$

Denis' answer on Command Tokenizer was exactly what I'm looking for in a good answer. It offered both a critique on the current implementation and suggestions about an alternative approach.

\$\endgroup\$
2
\$\begingroup\$

Answer to C++ Blackjack game posted by https://codereview.stackexchange.com/users/4203/forsvarir

It has valid points on:

  • Variable scoping
  • Domain problem modellini
  • Code duplicazione (my personal favourite)
  • Bug fixing
  • Constant extraction / Naming
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .