Home
Logical vs Comparison Operators in PHP PDF Print E-mail
Programming
Written by Nate Lyman   
Friday, 30 July 2010 04:35

Sometimes, you need to validate a variable passed into a function and set a default value if the user accidentally passes in a NULL.  There are a few ways to do it, a lot of developers would just use an if statement.  But not you, because it takes up extra space.  So basically there are two other easy ways to do it.

You can use a ternary operator, as highlighted in the ternary function.  Which cleans up your code a bit.

Another way is to use the logical operator "or".  In the logical function below, if the user enters in a value such as NULL or FALSE, it will use the default value of 10. Another benefit is, a lot of PHP programmers aren't aware of it.  It gives them a chance to learn something new!

Show/Hidden php code

Last Updated on Friday, 30 July 2010 04:45
 
Moving on PDF Print E-mail
Announcements
Written by Nate Lyman   
Monday, 19 July 2010 09:05

RedLaserSo, last week an opportunity presented itself, and I decided to jump on it.  In late June, eBay bought RedLaser, the best barcode scanning app around.  In building the team for RedLaser at eBay, I found out there was mutual interest.  I can't wait to dig in and really give myself a challenge.  I've been doing PHP a long time, and things just became too easy.

I like learning, a lot.  There is no way to learn like being thrown into the fire and getting your hands dirty.  Now, I've done plenty of iPhone App development, but nothing to this complexity, or with as much reach. I can't wait to learn and rock it out.

Was I looking for a change, not exactly.  It just seemed like the right time.  I've been doing my current job for a little over 2 years, and I've learned a ridiculous amount of things.  Ranging from scaling PHP, How to handle a lot of data in SQL Server, leading, and getting visibility in a large company.

I absolutely love the people I work with, and work for, which made the decision hard.   The driver of change was challenge.  I can code PHP in my sleep, and we've built such great tools, and have our best practices so developed, that we can just build things fast.

When you make big decisions like this, you never know how they're going to work out.  You leave something comfortable for something new and exciting.  I think great things are on the horizon.  The team I am joining has the 2 guys I built DealFinder with.  I know I have a great relationship with them, so there is some comfort in the excitement.

Finally, does this mean I am giving up PHP, absolutely not.  Maybe I'll port PHP to the iPhone SDK.  (Kidding)

Last Updated on Monday, 19 July 2010 09:23
 
Apple giving free bumper cases PDF Print E-mail
Technology
Written by Nate Lyman   
Friday, 16 July 2010 17:33

Steve Jobs announced today that iPhone 4 users would get a free bumper case to combat the signal issues.


I called it!

 
iPhone 4 Reception Fix: Free Bumper Cases PDF Print E-mail
Technology
Written by Nate Lyman   
Wednesday, 14 July 2010 14:39

A possible fix to the reception issue plaguing the iPhone 4 could be to give customer free iPhone 4 bumper cases.  It would be cheaper than doing a recall and admitting defeat.

Lets see what happens.

 
Headed to Europe for 3 weeks PDF Print E-mail
Technology
Written by Nate Lyman   
Sunday, 20 June 2010 07:48

Tomorrow Kate and I are leaving for Europe for 3 weeks.  This is the first time I'll be without a laptop in the last 8 years.  However we'll be traveling with our iPad, so I wont be completely off the grid.


Here is where we're going:

London
Paris
Florence
Rome
Venice
Vienna
Munich
Amsterdam
Brussels

Needless to say it is going to be a lot of fun.

 

Nate

 
« StartPrev12345678910NextEnd »

Page 1 of 11