Editing 1960: Code Golf
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 8: | Line 8: | ||
==Explanation== | ==Explanation== | ||
− | + | {{w|Code golf}} is the attempt to use as few characters as possible to write a computer program with a certain function, analogously to {{w|golf|regular golf's}} goal of getting the ball into the hole with as few strokes as possible. Reverse code golf would be to write a given program, probably to achieve a trivial outcome, using as many characters as possible. Randall's approach to this in the code example shown in the comic is to create overly long function names, using [https://en.wikisource.org/wiki/Moby-Dick/Chapter_1 the beginning lines] of {{w|Herman Melville}}'s notoriously long-winded whaling novel ''{{w|Moby-Dick}}''. Regular code golf also results in names of functions and variables that have nothing to do with their purpose in the program, but would minimise their length. | |
− | + | Using "as many characters as possible" to produce code is actually an impossible goal. It would be a trivial task to make any given program longer by inserting useless code or comments. Furthermore, some programming languages place no limit on function names, so these could simply be made longer. Even if the language Randall is using does limit function name length, he has not maximised the ones he has used, since the first two are 50 characters long, and the last much shorter. The code is written in a programming language that looks similar to {{w|Python (programming language)|Python}}, but with the keyword “define” instead of “def” to define functions. Python has no limit for function name length. | |
− | + | The first two functions defined implement “zero” and “successor”, the two basic operations of {{w|Peano axioms|Peano arithmetic}}. Presumably, the programmer will next implement natural number addition, then integers, then whichever branches of mathematics the original problem needs, all from scratch. Generally, you would use built-in functions to perform mathematical operations, so it is redundant to implement them yourself from scratch. | |
− | The | + | The title text suggests that Randall has also invented a reverse version of regular golf, where the aim is to take as many strokes as possible to get the ball in the hole. Similarly to ''Reverse Code Golf'', the only challenge here would be the player's own boredom threshold, since they could always add more strokes by tapping the ball in a direction other than that of the hole. |
+ | |||
+ | The title text states that he has been playing for years, across the country, this implies that the distance traveled with the ball would have been quite large. This implies a rather incomplete understanding of the rules of golf as this suggests the ball is being played out of bounds. | ||
− | + | In golf, "[https://en.wikipedia.org/wiki/Out_of_bounds#Golf Out of Bounds]" is defined as being beyond the boundaries of the golf course or any part of the course so marked by the committee in charge of the golf course. If a ball is out of bounds, the player must play a ball, under penalty of one stroke, as nearly as possible at the spot from which the original ball was last played. If the player does not play the penalty shot from the original spot the ball was played this can lead to even more stroke penalties or a disqualification from the match. | |
− | |||
− | + | So the reverse round of golf that is being played will have accumulated a large number of penalty strokes or the round was long since been ruled as a DQ within the rules provided by the USGA. | |
− | Interestingly, the comic ends with an unmatched left parenthesis (something which might be intended to [[859|create unresolved tension]]<!-- ) -->. | + | Interestingly, the comic ends with an unmatched left parenthesis, (something which might be intended to [[859|create unresolved tension]]<!-- ) -->. |
==Transcript== | ==Transcript== | ||
Line 32: | Line 33: | ||
:[Caption under the black box:] | :[Caption under the black box:] | ||
− | :My hobby | + | :My hobby: Reverse Code Golf |
− | :Reverse Code Golf | + | |
==Trivia== | ==Trivia== | ||
Line 41: | Line 42: | ||
***The previous one, [[1795: All You Can Eat]], was released early in February 2017, and this one at the end of February 2018. | ***The previous one, [[1795: All You Can Eat]], was released early in February 2017, and this one at the end of February 2018. | ||
***This is by far the longest span between My Hobby comics, since the first, [[37: Hyphen]], came out in comic 37 back in 2005. | ***This is by far the longest span between My Hobby comics, since the first, [[37: Hyphen]], came out in comic 37 back in 2005. | ||
− | **It also followed directly after the second [[:Category:Fun fact|Fun fact]] comic in the same month, [[1959: The Simpsons]], after more than two years break from that series. | + | **It also followed directly after the second [[:Category:Fun fact|Fun fact]] comic in the same month ,[[1959: The Simpsons]], after more than two years break from that series. |
***That Fun Fact comic was also in the [[:Category:Comics to make one feel old|Comics to make one feel old]] category, a subject he had not returned to since October last year (so not that long, but still a return to a well known theme). | ***That Fun Fact comic was also in the [[:Category:Comics to make one feel old|Comics to make one feel old]] category, a subject he had not returned to since October last year (so not that long, but still a return to a well known theme). | ||
***The first of the two Fun Fact comics was [[1950: Chicken Pox and Name Statistics]]. | ***The first of the two Fun Fact comics was [[1950: Chicken Pox and Name Statistics]]. | ||
**Finally in the very next comic he returned to his problems with [[Small Talk]] and social interactions in general in [[1961: Interaction]], something he last dealt with in three comics released for about two years ago, the last being [[1650: Baby]]. | **Finally in the very next comic he returned to his problems with [[Small Talk]] and social interactions in general in [[1961: Interaction]], something he last dealt with in three comics released for about two years ago, the last being [[1650: Baby]]. | ||
**This comic also refers to another recurring theme [[:Category:Programming|Programming]], but there has been no break from this as this was the third of those already in 2018. | **This comic also refers to another recurring theme [[:Category:Programming|Programming]], but there has been no break from this as this was the third of those already in 2018. | ||
− | |||
− | |||
− | The | + | This was the first comic in the ''[[:Category:My Hobby|My Hobby]]'' series for over a year. It followed directly after the second ''[[:Category:Fun fact|Fun fact]]'' comic in the same month, [[1959: The Simpsons]], after more than two years break from that series. It seems that [[Randall]] returned to his [[#Revitalizing_old_themes|old themes]] this month. |
+ | |||
+ | Python was previously featured in comic [[353: Python]]. | ||
{{comic discussion}} | {{comic discussion}} | ||
+ | |||
[[Category:Comics with color]] | [[Category:Comics with color]] | ||
[[Category:My Hobby]] | [[Category:My Hobby]] | ||
[[Category:Programming]] | [[Category:Programming]] |