PDA

View Full Version : An if list website




macbooker15
Jul 13, 2009, 06:54 PM
Is there any kind of website or service that provides any kind of database of commonly used if statement lists? For example converting letter grades to GPAs in a home brew grading application? Or assigning each letter of the alphabet to a specific number? Because if there isn't, I'm thinking of starting one. Users would go onto the website and search for a specific kind of if list in a specific language and could get said list and copy into there program. What are your comments or suggestions if i just suck at googling and something like this already exists.



Cinder6
Jul 13, 2009, 07:27 PM
Never heard of one, but wouldn't most of the "common" ones be pretty trivial? Your examples are, at least--especially the second one, because letters already have numbers associated with them :)

What about, instead of common if clauses, just common tasks? That'd give it more scope, and it'd probably wind up more useful.

GorillaPaws
Jul 13, 2009, 07:44 PM
What about, instead of common if clauses, just common tasks? That'd give it more scope, and it'd probably wind up more useful.

Take a look at Code Beach (http://codebeach.org/).

autorelease
Jul 13, 2009, 09:10 PM
Long "if lists" are usually a sign of bad code. Use switch statements, tables, and other techniques when possible.