The rpmbuild post reminded me of my list of stupid language designer tricks.
This is a file I add to every time I read about some stupid mistake (or
"brilliant" feature) in a language and think "if I ever write a language I am
remembering not to do THAT!"
But really I'm gathering fodder for a talk to make fun of every language.
Here it is.
* It's OK to be verbose, the IDE will write the code for you.
* See also Java
* The defaults suck, but that's ok, you can turn them off.
* "Just change the grammar" (Perl 6 special)
* Instead of thinking, let's just paste in what C does!
* Everyone's switch/case (except Perl 6)
* gm/localtime() (particularly the year) and stat()
* $! is unstable
* X is a big enough number for anybody
* X+1 is "infinity"
* No warnings on over/underflow
* Everything's global by default!
* Perl
* Auto declare undeclared variables
* PHP, Ruby
* Typo protection out the window
* Terminate statement on newline
* Ruby, Javascript, Kurila
* Yay difficult to debug ambiguity!
* Function scope is good enough
* Who needs closures?
* Let's reserve a huge list of useful words and never use them.
* + should add or concatenate
* Bonus points if your language is dynamic
* Arrays are just hashes with numbered keys
* (Maybe not such a bad idea)
* Everyone should program in X style
* Who cares about <OO, Functional, Logic> programming?
* Significant whitespace
* Python
* Oh god why Kurila
* YAML does it right
* So does Ruby
* Objects are just magic hashes
* Perl
* Javascript
* Everything is an object... except this stuff over here
* Java
* Perl
* Lists count from 0
* Everybody does it
* Everybody's wrong
* See also "let's just paste what C does"
* Let's compare case-insensitively by default
* Powershell, MySQL
* A typed language with no way to define new types
* SQL
* No namespaces
* Lua, Javascript
* No function pointers
* No dynamic code generation
* No WYSIWYG strings
* No anonymous functions
* PHP (they finally woke up)
* Here-docs done wrong
* PHP
* Perl
* No multi-line strings
* Java, here's to you!
* C
* final methods
* Bad design for short term performance
* final
* special case for core types (Java, Perl)
* Function arguments are just lists
* Perl
* Language spec?
* Language tests?
* Warnings off by default
* Perl
* PHP
* Error codes as human readable (and changable) strings
* Perl
* Error codes as numbers
* BOTH!
* Use the same function for two totally different things.
* eval BLOCK; eval STRING
* select FILEHANDLE; select BITS, BITS, BITS, TIMEOUT
* We'll add threads later.
* Perl
* We'll add Unicode later.
* Perl (FULL RECOVERY!)
* FUCK UNICODE
* See also arc
* Loading your language with flavor of the month features (see also PHP)
* "If the assertion is given as a string it will be evaluated as PHP code by
assert()."
* What will assert( $gee_i_hope_this_is_true ) do? Who knows!
* A clumsy way of allowing assert() to print its code.
* What if the string contains variables? Context issues!
* No trailing commas on lists (PHP, SQL)
* "Special" comments
* Many HTML extensions: <!-- DIRECTIVE -->
* rpmbuild: expands macros in comments
* Perl: #line file
* javadoc
* Mixing file and URL operations (guessing what the thing to be opened is)
* Hideously insecure
* Slows down file operations
* PHP's open
* Enforced syntax style
* Code that might be more clear in a different style now must be crammed
awkwardly into the one true style
* Just makes it harder to see bad code
* No embedded documentation
* Give programmers no excuse not to write docs
* Put it in early or you'll commit "special comments" later
--
184. When operating a military vehicle I may *not* attempt something
"I saw in a cartoon".
-- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
http://skippyslist.com/list/