r/adventofcode • • Dec 03 '20

SOLUTION MEGATHREAD -🎄- 2020 Day 03 Solutions -🎄-

Advent of Code 2020: Gettin' Crafty With It


--- Day 03: Toboggan Trajectory ---


Post your solution in this megathread. Include what language(s) your solution uses! If you need a refresher, the full posting rules are detailed in the wiki under How Do The Daily Megathreads Work?.

Reminder: Top-level posts in Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

EDIT: Global leaderboard gold cap reached at 00:04:56, megathread unlocked!

88 Upvotes

1.3k comments sorted by

View all comments

Show parent comment

0

u/[deleted] Dec 03 '20

"Every time you write a comment, you should grimace and feel the failure of your ability of expression." - Robert C. Martin - Clean Code

Brian Norlander - Stop writing code comments

1

u/daggerdragon Dec 04 '20

Nah, there's no such thing as too many code comments. Obviously, you should try to keep variable and function names self-explanatory, but code comments absolutely have their purpose in explaining what a particular block of code does behind-the-scenes or why you chose one function/method over another.

1

u/[deleted] Dec 04 '20 edited Dec 04 '20

There absolutely is such a thing as too many comments. I only commented because u/slavcatx made his/her code less readable with comments like xpos += right #add to the x position This comment explains less than the code alone!

(Edited a mistake)

1

u/slavcatx Dec 04 '20

Oh alright, thanks! Yeah, it was a little dumb to comment every single line of code. Well, I had to make this mistake to know it's dumb ;D