In PHP, there are a couple ways of writing an if-else statement. One is:
if($variable == 'something'){
$result = 'the variable equals something';
}else{
$result = 'the variable does not equal something';
}
echo $result
Another way of writing the above if-else statement is:
if ($variable == 'something') : $result = 'the variable equals something'; else: $result = 'the variable does not equal something'; endif; echo $result
I used the first of the above syntax for a long time (the second I never really cared for).. but couple months ago, I started paying more attention to a completely different if-else statement syntax, used particularly for assigning values to a single variable based on the met conditions in the if-else statement. Here’s the example:
$result = $variable == 'something' ? 'the variable equals something' : 'the variable does not equal something'; echo $result;
What I like about this alternative way of writing an if-else statement is not only less code, but cleaner code as well.
A little less than 3 months ago I outlined my editors of choice for my work and low and behold it didn’t take me 6 months to review that list! it actually only took me one heh. Back in May, I started looking at a few tools out there after hearing some great reviews from some fellow devs. I ended up substituting Coda and NetBeans with Transmit and TextMate.
TextMate
Everyone has always raved about TextMate but at first glance it didn’t look all that great… but then I discovered it’s real power. The way it handles Language Support Plug-ins. Bundles, as they called in TextMate, are extremely powerful! I am able to switch between auto-complete and syntax highlighting for languages on the fly with keyboard short cuts (I still haven’t figured out however, how to add a keyboard shortcut to access php bundle though..). but really the best part of it all is the ability to use and create keyboard shortcuts for virtually anything very easily and quickly.
Here’s an example of html keyboard short cuts and tag usage that I found on YouTube:
Now.. imagine this kind of power with not only HTML but also any language that you can find a bundle for. mind you, all these tags and shortcuts are fully editable and customizable, so if you need a new tag.. you can fairly easily add it.
Transmit
For a long time I felt that an FTP client on it’s own was not very useful to me (especially when I already had Coda which was an editor and ftp client in one), but Transmit has become my FTP application of choice because it is simply by far one of the best ftp/remote file management and file synchronization tools I have found. It gives me all the power of opening remote files with any of my editors and then saving them back to the server automatically that Coda gives me, as well as give me an effective method of synchronizing my local and remote files or transferring files from one server (development) to another (integration or production) as simply as drag and drop. Transmit also has (of course) permission control options for remote files and directories, which is something every FTP program either has, or should have.
