Over on the Code Golf StackExchange site, people will post programming challenges with the goal of the challenge (usually) being to write code in the language of your choice that solves the problem in as few bytes (or characters) as possible. What I want to talk about today is a submission I made to a challenge where I actually missed the mark for the shortest, but was still proud enough to post my answer.
Programming With... Starfish?
Competition in these challenges can get pretty fierce as people try to shave off bytes wherever they can, and whole (if you can call them that) languages have been crafted just to reduce byte counts. These esoteric languages, or esolangs, can reduce the bytes required to perform an action by a significant amount. Of course, if the language lacks a feature, it can also increase the bytes needed by a significant amount. One such esolang, which was created by a friend of mine, Discordian, is *><>. This language, called Starfish, is actually a derivative of another esolang, ><> , or Fish.
The answer that I was beat out by was actually in
><>, while mine was in
*><>, so it could be said I’m perfectly fine posting my answer. It is, after all, a different language. That said, best as I can tell, any
><> program is also a valid
*><> program. To liken the two languages to shapes, I offer the following analogy:
square : rectangle :: Starfish : Fish. All this to say that I ultimately was still beat by this other answer.
So You Lost. Why Post It?
From my experience, it’s very common in the tech world to be dissuaded from posting your code if it’s not the best. “Don’t reinvent the wheel,” the saying goes. While I understand its merit for some things, I think that this adage’s widespread usage can be very hindering for progress. This can be especially damaging for new programmers, who are likely to then just copy/paste “the best” code, and never come to understand it.
So I post my “inferior” answer, because even if it didn’t have the least amount of bytes, it was unique and I did learn a lot writing it. Plus, it uses features available to
*><> that aren’t available in
><>, so even if the other answer is shorter, it can be said that mine definitely is a