Before you do anything else promote all warnings as errors.
Do static code analysis. There is software for this, use it.
Try and optimize for readability but understand what is going on underneath. In other words, don't just write code that works, write code that is efficient. Every bit of extra overhead is extra clock cycles or memory that could be used for something else. Everything is going to mobile and extra CPU cycles is battery life.
Expect that your code will last a long time. Someone else will need to maintain the code. So write good clean readable code.
Only document the things that are difficult to understand. All too often I see comments such as "\\ copy this to that". Seriously this is a lame comment. If it is necessary explain why the copy is necessary, otherwise leave the comment out because the copy will be self documenting.
Format your code correctly for the project so someone else doesn't have to do it later which will make all the blames go to that person.
Just take some pride in your code. At the end of the day you'd rather people say "damn that's some nice formatted elegant clean code, I'd love to work with them again." Think of your code as your legacy.
Thursday, September 8, 2011
You Want to Write Good Software
Posted by
Chris Bensen
at
7:05 AM
0
comments
Wednesday, August 31, 2011
Netflix
I went with 1 DVD out at a time. How about you?
Posted by
Chris Bensen
at
3:44 PM
1 comments
Tuesday, August 9, 2011
John Carmack At QuakeCon 2011
At some point toward the second half of the video (it's a really long video) Carmack talks about writing good code which is something I'm always interested in.
Posted by
Chris Bensen
at
7:00 AM
0
comments
Monday, August 8, 2011
Simple Git Usage
To update your repository type:
git pull
To commit your changes type:
git add .
git commit -m "your comment"
git push origin
But there are some pretty good clients out there. For Windows the Tortoise Explorer shell integration is pretty good. And free! For Mac I've found that SourceTree is my current favorite. It works with Git, Mercurial and Subversion. But it isn't free.
Posted by
Chris Bensen
at
7:00 AM
2
comments
Wednesday, August 3, 2011
Making Icons for Mac Apps
The easiest tool I've run across for building icons for your Mac or iOS apps is Icon Composer. It ships with every set of developer tools on the Mac in the folder "\Developer\Applications\Utilities\Icon Composer". You will need 512x512, 256x256, 128x128, 32x32 ad 16x16 images. But it's pretty simple, drag drop images to their respective sizes, save as, done.
Posted by
Chris Bensen
at
7:00 AM
0
comments
Thursday, July 28, 2011
Git Version Control System
There are quite a few version control systems. My favorite for many years has been Subversion. It's still a great version control system but it has some limitations such as every operation requires a server. The latest round of version control systems are distributed and need no server interaction until you want to commit your changes to the central repository. Git, Mecurial and Bazzar are of these latest bread of distributed version control systems. I had some dealings with Mecurial when working on some JavaFX code recently and decided to use Git for my latest project. Others have written great articles about the difference between the two version control systems:
Git vs. Mercurial: Please Relax (Git is MacGyver and Mercurial is James Bond)
The Differences Between Mercurial and Git
Mercurial for Git users
I choose Git because of it's flexibility, branch performance and ability to destroy branches fast and easily. Although Mecurial is easier to use and has way better documentation.
A good Git cheat sheet can be found here.
Posted by
Chris Bensen
at
7:00 AM
2
comments
Friday, July 8, 2011
Google+
And here I was all excited to check out Google+ only to get the error:
"This feature is not available for your account
You must be over a certain age to use this feature."
Apparently I'm too young according to the records that I've never given them. I did a quick search and found that a lot of people are in the same boat. Google, let me know if you fix this. Thanks.
Posted by
Chris Bensen
at
2:12 PM
0
comments
Wednesday, June 8, 2011
Watch The International Space Station Assembly Diagram
Click here to watch the International Space Station (ISS) assembly diagram over the years.
Posted by
Chris Bensen
at
7:00 AM
0
comments
Friday, June 3, 2011
Xcode Column Mode
Holding down the option key while dragging allows you to perform a column based selection of text.
Posted by
Chris Bensen
at
7:00 AM
0
comments
Labels: Tips
Thursday, June 2, 2011
Friday, April 29, 2011
Useful Batch Commands
Sometimes it's useful to have a few batch tricks up your sleeve. Here are two that I've used before but I had to dig around to remember/find.
The first trick is running a script file on Windows like it's executable. This is easy to do on *nix, but on Windows it requires a .bat file. So just create a .bat file the same name as the script, in this case script.php, put the two in the same directory, and then use the cryptic $~dp0 to specify the current directory of the .bat file being run and viola! The script is now an executable.
php %~dp0script.php
The second is I wanted to copy a text file to a network drive but CMD doesn't understand UNC paths. So use pushd and popd. Nothing revolutionary but useful if you need it.
pushd \\computer\volume\ copy %~dp0\filetocopy.txt filetocopy.txt popd
Posted by
Chris Bensen
at
7:00 AM
0
comments
Thursday, April 28, 2011
Remote Shutdown
Have you ever found yourself using Microsoft Remote Desktop without access to the physical machine and you need to reboot it? Or sometimes you have access to the physical machine but there isn't a keyboard hooked up for some bizarre reason that makes perfect sense to you. If so then you probably already know this and this post is pointless, but every so often I encounter someone that doesn't know the about shutdown.exe. Microsoft has a pretty old article about How To Use the Remote Shutdown Tool to Shut Down and Restart a Computer in Windows 2000. My use of shutdown.exe is to force a restart now:
c:\shutdown -t 00 -f -r
Posted by
Chris Bensen
at
7:00 AM
0
comments
Labels: Tips