Writing Code

A few things I’ve learned in writing code:

  • $huge_array is a perfectly valid name for a large array… Until you realize that you were actually trying to create a hash, which is apparently not a PHP feature at all, in which case you suddenly realize that you’re going to need like six $huge_array’s… In which case I broke down and gave them decent names.
  • To determine if something is sound programming practice, try it and see if the program crashes, or, in my case, if PHP throws errors. If not, you’re golden.
  • The PHP.net manual is amazing. I just learned how to use foreach() tonight.
  • Coding is like swimming: even if you’ve gone years without exercising the skill, you can pick it up in no time. And also like swimming, if you’ve sucked at it all your life, you’ll still suck at it just as much later on.
  • When you can’t think of a good way to code in a feature, just put in a comment indicating what it should do. (So far, though, the PHP compiler hasn’t done a very good job with filling in code based on my comments…)

4 thoughts on “Writing Code

  1. Changing variable names is where refactoring tools in an IDE can come in very helpful. Or so I am told. I’ve never actually needed to use them. OK I have but not since they started to actually be there for me. πŸ™‚

  2. To determine if something is sound programming practice, try it and see if the program crashes, or, in my case, if PHP throws errors. If not, you’re golden.

    Please don’t get a job here. πŸ˜‰

  3. lol, but then I could just walk down the hall to ask you to remind me how foreach() works. Every single time I write a program.

    Does vi count as an IDE?

Leave a Reply

Your email address will not be published. Required fields are marked *