Can anyone else think of a cleaner, more highly used piece of “pocket code” than the good old State enumeration that they have used time and time again in projects?
I just skinned this cat today in Grails with a custom taglib. Grails makes me all giddy. It even includes the ability to pass in a selected state by default. Rought 8 lines of code, (minus the actual key:value pair Map of course, but suppose I could have put that all on one line *wink*).
Heh... You could code the ten commandments, that did not change in the last two thousand years, so we could call it constant. (as much as history is constant)
But it really perfectly demonstrates how some american coders ignore the rest of the world. No kiding, I know people over there still using ASCII :-) It is just not reusable at all.
Comments
lifewithryan replied ago:
I just skinned this cat today in Grails with a custom taglib. Grails makes me all giddy. It even includes the ability to pass in a selected state by default. Rought 8 lines of code, (minus the actual key:value pair Map of course, but suppose I could have put that all on one line *wink*).
kenman replied ago:
If you're going to claim something so definitive using adjectives such as "most", "ever", and "period", it better damn well be worth it. This isn't.
To be truly reusable, why not structure it in a manner which makes it language agnostic (XML comes to mind)?
Gregg Bolinger replied ago:
Weak
lem z replied ago:
you know... planet USA only has about 5% of the world's population...
goshki replied ago:
The title should rather be "The Most Reusable Piece Of Code Ever In The US…Period" to prevent confusion.
willcode4beer replied ago:
because all we do is write code that needs a list of states and their abbreviations......
post was weak
kocka replied ago:
Heh... You could code the ten commandments, that did not change in the last two thousand years, so we could call it constant. (as much as history is constant)
But it really perfectly demonstrates how some american coders ignore the rest of the world. No kiding, I know people over there still using ASCII :-) It is just not reusable at all.
Voters For This Link (5)
Voters Against This Link (37)