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…
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…

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.
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
.
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.
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!
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:
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(isSnowing) { iMustBe = "cold"; } else { iMustBe = "warm"; }
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!
George Carrette [1990].
99% of students that were in my CS degree program
Image taken from abtrusegoose
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:
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!