Programming


15
Apr 10

HECK YES C Macro, For When Something Is REALLY True

Quite possibly the most useful macro you will ever use.

#define HECK_YES true && true
 
// Usage
if(self.sleepy)
{
   self.needsCoffee = HECK_YES;
}

Now if only I could replace semi colons with exclamation points…


29
Jan 10

Emacs For OSX Is Out!

For all you Vi using, Emacs haters out there, I will fight you!


27
Jan 10

It’s A Good Day To Be A Software Developer

I was just reading this article posted on CNET news Apple’s tablet: It’s all about developers and thought to myself, it’s a great day to be a software developer.  This quote from the article got me exceptionally excited.

“Never have developers mattered more. As Apple readies its tablet announcement party for later Wednesday morning, the big question remaining is whether developers will join, or whether they’ll join Google’s Android and Chrome initiatives.”

With the release of all of these new devices, developers have just gotten much more marketable.  It’s amazing how our worth skyrockets with every new Apple, Google, or Microsoft event.  Never before have software developers had so many opportunities to be successful.

There are now over 100K applications in the iTunes App Store with over half of them being paid.  That means, Apple is making money for upwards of 50,000 software developers!

I for one, love being a software developer and am very excited for what the future holds for us.

Reblog this post [with Zemanta]

21
Jan 10

Watch Out Apple, The Kindle Dev Kit Is Almost Live

With the success of the Apple App Store, it seems that everyone is wanting  a piece of the pie.

Amazon is now looking to throw their hat into the ring and is releasing their own dev kit for their ever so popular Kindle.

http://www.amazon.com/gp/feature.html/?ie=UTF8&docId=1000476231

It appears that big name game developers Electronic Arts is also getting involved (WTH?!?!)

This just seems like it will be an epic fail.  Who really wants to play video games on their Kindle?  Maybe they can port Kirby’s Dreamland from the original Game Boy :) .

Reblog this post [with Zemanta]

14
Dec 09

XCode Shortcut

When in XCode on a MacBook Pro, doing a 3-finger swipe up will switch between the .h and .m files.

⌘-option-up will do the same thing

Productivity++

Reblog this post [with Zemanta]

4
Dec 09

Programming Tip Of The Day #2 – Difference Between i++ and ++i

To some, this should seem a bit obvious and if I am insulting your intelligence by discussing it, I am sorry.  But, one of the main reasons I want to discuss this topic is, I was asked this question in a job interview for Lockheed Martin.

What is the difference between i++ and ++i?

The answer is actually quite simple.

i++ first evaluates the value of i and then increments it

++i increments the value of i and then evaluates it

Here is a brief example to demonstrate what I mean.

// Example: i++ 
$i = 5;
echo "The value of i is " . $i++ ;
// Output "The value of i is 5"
// i = 6
 
// Example: ++i 
$i = 5;
echo "The value of i is " . ++$i;
// Output "The value of i is 6"
// i = 6

So, now if you are ever asked about this in an interview, you will have a response.

Happy programming!


3
Dec 09

Programming Tip Of The Day #1 – Ternary Operator

So, I though I’d start this series called Programming Tip Of The Day to write about useful things I come across in programming.  Both to educate my readers and as a personal archive of ideas and tips.

I will kick it off today with a quick rant about the ternary operator.  I <3 the ternary operator.  It’s quick, efficient and saves a lot of ugly code.

For those of you who don’t know, the ternary operator is made up of 3 elements: The condition and two results.  It is of the form:

(condition) ? (result if true) : (result if false);

This is much nicer than an if statement.  So here is a brief example about how a ternary operator can replace an if-statement.

if-statement

if(isSnowing) {
	iMustBe = "cold";
} else {
	iMustBe = "warm";
}

Same thing using ternary

iMustBe = isSnowing ? "cold" : "warm";

That is so much easier to read (IMHO). You can even do clever things in printing. Here is a small example in PHP for using the ternary operator when doing an echo.

<?php
  echo "I am a ".((height > 72) ? "tall" : "short")." person!";
?>

Most languages support the ternary operator. Check out this wiki page if you want more info.

Happy programming!


25
Nov 09

First learn computer science and all the theory. Next develop a programming style. Then forget all that and just hack.

George Carrette [1990].


13
Nov 09

Programming

99% of students that were in my CS degree program

99% of students that were in my CS degree program

Image taken from abtrusegoose


13
Nov 09

$13 Dollar Discount On Programming Books From Manning Publishing

manning-logo

The publishing that I’m writing the book for is having a huge Friday the 13th sale.  They are offering a $13 discount on all of their books.  For those of you who don’t know, Manning publishes all of the “In Action” books.

All you have to do is go to the site and enter the coupon code:

fri13

when checking out and you will get the discount.  Although my book iPhone In Action 2nd Edition hasn’t been released yet, Manning has some other killer programming books for sale.

So be sure to check it out!