WalaWiki content from p1k3.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.6 KiB

  1. WareLogging, IdeaLogging.
  2. = hate =
  3. * The culture.
  4. ** Boolean flags to functions.
  5. ** Detailed and highly inaccurate in-source comments about who added what and when.
  6. ** Code reuse should not mean ctrl-c, ctrl-v.
  7. ** Whitespace. How hard can this be?
  8. * God, I miss Perl quoting, regex syntax, and POD.
  9. * preg_*
  10. * min(), max()
  11. * [http://us2.php.net/manual/en/language.types.string.php#language.types.string.parsing String parsing], [http://us.php.net/manual/en/language.types.string.php#language.types.string.conversion String conversion to numbers].
  12. * global
  13. * case-insensitive function names
  14. * Constants
  15. * include
  16. * Would it have been so hard to pick either of C++-like or Perl-like comment markers?
  17. * rename() is essentially mv.
  18. * Comparison operators. ===? Are you fucking kidding me?
  19. ** Ok, scratch this. It's not the operators, per se. It's the finicky, brittle, poorly abstracted type system that really drives me to fits of spittle-flecked rage.
  20. ** As an addendum, if this hasn't bitten you, either you haven't done much with the language or you just don't know how badly you're being been bitten yet.
  21. * <? ?>
  22. I used to miss having switch statements around in Perl. Now I'm fairly convinced they're one of the most ill-advised constructs you can make available to a vigorous amateur.
  23. Why I hate PHP, in a nutshell:
  24. brennen@hyperion 12:06:16 ~ $ php -r
  25. function fuck () {
  26. print fuck;
  27. }
  28. FUCK();
  29. ''^d''
  30. fuck
  31. brennen@hyperion 12:06:41 ~ $
  32. = don't so much hate =
  33. * At least it has function prototypes.
  34. * It's pretty painless, syntax-wise, to build a multidimensional array.
  35. * file(), at least when it works.
  36. *
  37. * They finally got around to adding closures. It's flat-out amazing what this does for the language.
  38. = am somewhat bemused by =
  39. * if (! function_exists('func')) { function func () { } }
  40. * [http://php.net/ob_start ob_start()], ob_get_contents(), ob_end_clean() - output buffering.
  41. = whack idioms i have seen =
  42. $foo = array('something', 'some other thing');
  43. foreach ($foo as $bar) {
  44. switch($bar) {
  45. case 'something':
  46. # do a whole shit-ton of stuff
  47. break;
  48. case 'some other thing':
  49. # do a shit-ton of other stuff
  50. break;
  51. }
  52. }
  53. = perl to php =
  54. * chomp(), chop() -> [http://us.php.net/rtrim rtrim]
  55. * shift() -> array_shift()
  56. = other =
  57. * http://www.steike.com/code/php-closures/
  58. * http://pear.php.net/package/MDB2
  59. As annoying as one-package-one-file can occasionally be in the Perl universe, I suddenly find that it is really nice to have a predictable directory structure emerge naturally from the hierarchy of modules/classes.