Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are five things you hate about your favorite language? [closed]

Wow, I'm surprised that SQL hasn't made it up here yet. Guess that means nobody loves it :)

  • Inconsistent syntax across implementations
  • Subtle code differences can have massive performance ramifications for seemingly obscure reasons
  • Poor support for text manipulation
  • Easy cost of entry but steep learning curve towards mastering the language
  • Minimal standardization across the community for best practices, this includes syntax style.

...And a few bonus reasons to hate it, at no extra charge

  • the WHERE clause goes last, making it easy to prematurely execute an UPDATE or DELETE, destroying the whole table. Instead, the WHERE should go somewhere up front.
  • It's difficult to implement relational division.
  • I can set a value to NULL, but I can't test it for equality with NULL. I can check IS NULL, but that just complicates code -- needlessly so, in my opinion.
  • Why do we need to completely respecify the formula for a GROUPed column, rather than setting an alias on the column and then GROUP BY the alias (or column index as with SORT)?

Five things I hate about Java:

  • No first-class functions.
  • No type inference.
  • Lack of sane defaults in eg graphics.
  • NullPointerException not containing more information about what is null.
  • The proliferation of pointlessly "configurable" frameworks/service provider interfaces/factory classes/dependency injection systems. The configurability is almost never used, DRY is violated egregiously, and code quadruples in size and halves in legibility.

I know, I should check out Scala.


JavaScript:

  1. All the coolest things are insanely complex, but then, all the coolness is also wrapped up in such a small amount of code that you feel stupid for struggling to follow it

  2. '+' is an absurd choice of operator for concatenation in a weakly-typed language. Were they trying to scare off the noobs?

  3. It's a cross-browser compatibility minefield (never mind if it's even turned on or not)

  4. It's generally untrusted - associated with scummery such as blocking the back button, pop-ups that never die, etc.

  5. It's nearly impossible to debug because there are only a few different error messages and a few different types (Number, String, Object, etc.)

If it wasn't for jQuery, I'd probably still hate it as much as I used to :)


PHP:

1) Forces me to make unnecessary variables:

$parts = explode('|', $string);
$first = $parts[0];

2) An implementation of lambdas so lame it is roughly equivalent to using eval() and so hideously wrong I have never used it (see http://www.php.net/create_function).

3) A try/catch system which can only catch about 80% of errors that might occur.

4) Regex support just as lame as lambda support because it has to be written inside regular strings, making one of the most hard-to-learn programming tools about three times as difficult. And PHP is supposed to be an "easy" language?!?!?

5) No way to safely pull stuff out of $_POST without writing it twice or building your own function, or using the '@' operator:

$x = isset($_POST['foo']['bar']) ? $_POST['foo']['bar'] : null;

6) Bonus answer: '@'. If you can't be bothered writing your code correctly, just add '@', and too bad for anyone who has to debug your code later.