Nostalgia
I miss…
looking at my small monitor, my old chair — aka ass poking device, our hacked air conditioner, going to Starbucks everyday, the “hot chicks”, the old elevator which keeps shutting down, sitting next to Tonio, talking about PHP oddities, triple escapes in regex, {} in sql queries, talking to Marvin, seeing him go nuts over SPAW2, seeing him go nuts over link scrubber
Banana stacks
We should really start calling banana cues banana stacks because when you prepare them, the first one to get pierced is moved to the bottom of the stick, and when you eat them, you eat from the tip to the end of the stick. (Last In First Out)
Either start eating the bananas closest to your hand that’s holding the stick (First In First Out), or stop calling it a queue and call it a stack.
LOL!
Applying the Pareto Principle in Coding
The Pareto principle (also known as the 80-20 rule, Haddad’s Theorem, the law of the vital few and the principle of factor sparsity) states that, for many events, 80% of the effects come from 20% of the causes. (http://en.wikipedia.org/wiki/Pareto_principle)
In programming this translates to, avoiding 20% of the bugs when writing code will reduce the effects of horrible bugs by 80%.
Less code = less bugs, no code = no bugs ? LOL
Introduction to SVN
What is SVN?
Subversion (SVN) is an open source code manager and version control system intended to replace CVS. It is a system that manages files and directories, and the changes made to them over time.
Why use SVN?
SVN is great because
- it remembers all the changes written to it: create, edit, update files/directories
- it saves previous states, not just the current, so we can restore from a given date/version/etc
- prevents concurrence issues like overwriting someone else’s work
How to Use libcurl
PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP’s ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication. http://www.php.net
Handy Shell Commands
The Linux shell or sometimes called the command line or terminal is a text-based interface to the kernel. With the rise of GUI tools, some would think that there is no longer a need for this. But still, I am yet to find a GUI tool that can even compare with the simplicity, efficiency and power of the shell. For those who are new, here’s a list of commands that you might find helpful. Enjoy!
Best Coding Practices List
These are some of the things that I learned from the talks made by our lead programmer Travis Low.
- If you find it too cumbersome to use very long variables, it’s ok to use shorthands or abbreviations but remember to refactor them later.
- Don’t use variables for multiple purposes.
- Avoid ifs.
- Use existing code .
- Publish code up into API/superclass. Generalize to allow future changes. E.g. wrappers, etc.
- Less code, less bugs.
- Think ahead. Provide blank method definitions for very common methods or procedures. E.g. checkForm() Similarly, if you expect to use a parameter in the future, include it beforehand.
- If you’re as smart as you can be, how can you debug it? Don’t try to put very fancy/technical codes because if something goes wrong in that code, you won’t be able to debug it.
- Be forgiving in your code, do not try to fix some data which will cause the system to break… instead try to correct the problem as you go or when instantiating
- Make someone want to use your code
- Don’t use double negatives when naming booleans.