4 ms·
Array-oriented Programming
- RodgerTheGreat 15y agoAt first I thought this article might be about array programming languages[1], but then I remembered today's date. If I understand correctly, this "technique" relies on the fact that PHP "arrays" are associative structures that might be called a map in conventional terminology- wouldn't "Map-oriented programming" make more sense? [1] http://en.wikipedia.org/wiki/Array_programming_language http://en.wikipedia.org/wiki/Array_programming_language
- courtewing 15y agoYou are correct. PHP arrays are actually just ordered maps, so "map-oriented programming" would be appropriate in PHP. However, there is no traditional array implementation in PHP, so calling it "map-oriented programming" within the context of PHP would be ambiguous. That all said, this "technique" could be used with a traditional array, in theory. The array in the example is fixed-length, and the keys themselves aren't really used at all.
- EamonLeonard 15y agoThe best part was when the ninja's put candy in my pocket. "PHP has curly braces so that servers do not get confused".
- dbh937 15y agoI can't tell if this is an april fool's joke or not.
- dbh937 15y agoNever mind.
- EamonLeonard 15y agoslow start to the day?
- mdwe 15y agoConsidering these april fools jokes aren't supposed to be on the front page, this is forgivable
- courtewing 15y agoNot that I have control over who upvotes this, but did I miss a memo or something?
- mdwe 15y agoActually, it looks like I misunderstood. "All April Fools' Day Jokes on the Web are Here (so they don't clutter HN)" was the top link when I opened HN today so I thought it was some official stance. It appears to just be another submission. My bad.
- EliRivers 15y agoIt's no crazier than any other "paradigm-redefining" introspective code blog post we see the web churn out day after day.
- courtewing 15y agoAs the author of this blog post, let me just say that that is a sad (but not untrue) statement, my friend.