This answer used a built-in Python function to solve the question in a very short amount of code. Should we allow it and let people not up-vote, or should we police library abuse to some degree? If the latter, where do we draw the line?
|
|
I'd suggest a certain amount of common sense here. Using But taking advantage of any general purpose built-in or any general purpose (standard or non-standard) libraries seems fine to me. Why would you leave them out? Probably this means I'll never "win", cause I pretty much use c, fortran 77 and awk for code golf. Cest la Vie. |
|||
|
|
|
This has come up on a number of Code Golf questions on Stack Overflow, but the one I remember the most is Code Golf: Calculate Orthodox Easter date, where someone was lambasted for using Mathematica's built-in But certain languages derive their power from their large cores or standard libraries: PHP and Python are two notable examples. Let them be: Code Golf involves finding the most innovative solution with the shortest amount of code; if that involves using the standard library, why wouldn't you allow it? David Sirlin wrote a series of essays entitled Playing to Win: in it, he has some helpful advice about competing using all tools available:
|
|||
|
|
|
My take on it is, does the library do the interesting part of the puzzle, or is it just a general helper? For example, using |
|||||
|
|
I guess for such trivial things a better answer would be a re-implementation which should be just as golfable as in any other language. Another such example would be to print out numbers in a readable format, where Lisp (iirc) has a built-in function to do so. Upvoting an answer that actually does the implementation should probably take care of that. However, technically it still is a shorter solution. Meh. How often does that happen, though, that there is a single function that essentially does all the golfing for you? I once had a talk with LiraNuna and he generally had the opinion that trivial golf tasks are boring and a good golf task should be a challenge in any language you might throw at it – ofttimes with a straightforward and a clever solution where it's not immediately obviuos which one is better. So I guess the more successful golf challenges here will not be the ones that simply ask you to add two numbers or print out Hello World. |
||||
|
|
|
I really just think that you should have to code everything yourself. I mean the whole point of codegolf is to solve a challenge. Just calling a method is crap. What benefit or entertainment can you possibly gain from that? It almost seems like point-whoring for the shortest answer. |
|||
|
|
