I am about 8 months into developing with Objective C and XCode for the iPhone and I thought I would give a list of the pros and cons.

Pros:
  • The navigation controllers rock.  There is no better navigation paradigm out there.
  • Watching your code run on an iPhone or iPad is a truly exciting event.
  • Adequate string handling

Cons:
  • Sudden deallocation of an object even when that object is marked with retain.  This is a random yet completely frustrating event.  This problem tends to be less of a problem when using ARC, but if you are like me you have old code to maintain which does not use ARC and would take too much time to convert and debug.
  • Brackets instead of parenthesis - come one with the horrible smalltalk syntax.
  • In today's world of screaming hardware do we really need to allocate and deallocate our own objects?
  • XCode is horrific in comparison to Eclipse and VS.
  • Variable values displayed in the debug area are often just plain wrong.  Using NSLog shows the real values of the variables.
  • Debugging takes way too long! 
  • No overloading?  Yes, that's right, no overloading.
  • Dangling pointers even when the object is marked with retain
  • Poor examples on the Apple site including an example of how to create a singleton class, which as it turns out is totally incorrect.
  • No low level try catch block.  That's right, try catch is mostly worthless and should probably  be removed from the language.
  • Did I mention garbage collection is not present?
  • Method names are far too long and hard to remember.  Keep Google up and running at all times because you will forget the names.
  • You can use dot operator syntax with object.property, but not object.method



I could go on  but I think you get the point.




 

This is one of those code snippets that took me a while to find on the net so I thought I would put it here so maybe someone else might come across it without too much difficulty.  Its just one of those weird iOS development problems.

How to center a UIImageView within a custom cell?

    UIImageView *pic = [[UIImageView alloc] initWithImage:[arr objectAtIndex:indexPath.row]]; 
    pic.center = CGPointMake(cell.contentView.bounds.size.width / 2 , 60);
    pic.contentMode = UIViewContentModeScaleAspectFit;
    cell.selectionStyle = UITableViewCellSelectionStyleGray;
    [cell.contentView addSubview:pic];

 [arr objectAtIndex:indexPath.row]] is just an array holding my images.  It could be any image here.
"Easy now line up the sights and squeeze the trigger", my grandfather whispered as I held the Remington .22 rifle.  A moment later the telltale crack was heard as the bullet raced to the tin can sitting on an old stump only 20 yards away.  The can flew up into the air and I yelled "Yes!."  My grandfather, who had seen this many times in the past said.  Good shot but you didn't hit the can.  "What do you mean I didn't hit the can?  I will just run down to the stump and get the can and show you.", I replied.

Moments later I returned with the can and sure enough there wasn't a hole in it.  The only thing about the can that appeared different was a bit of gritty Pennsylvania mud on the base .  "You hit directly under it.",  Gramp said in a matter of fact way.   It didn't matter to me.  In my mind I was happy and I was totally hooked on this interesting device called a gun. 

What is it that attracts a man to firearms?  Perhaps it is the raw power one feels when behind one or maybe it is loud noise it makes when fired, or maybe the joy of hitting a tiny target 100 yards away.  I don't know, but whatever it is, is unique to men.  I know, I know women enjoy shooting also, but somehow I don't think it is the same as it is with a man.  There is something unique about a man and his shotgun or rifle.  Men have used guns to hunt food for their family, defend and fight for our country.  They are as much a part of America as the apple pie or the American flag.

Those who find guns appalling  need to understand how owning a gun is an American tradition that has shaped us. It is part of who we are as a society.  Personally I have no desire to hunt animals or harm others.  I simply and plainly enjoy shooting.  I have no trouble with those who hunt as it is an excellent past time which can provide the family with healthy and unprocessed food as well as various clothing items such as gloves and coats.  I grew up with hunters all around me and they are a great bunch of people.  I'd take a bunch of hunters as friends any day to the average liberal coward we have turned out in our major cities.

Well I am 38 now and I guess you could say I have my own .22.  One day, just as my grandfather did, I will take my son to the shooting range and show him how to hit that tin can.  Gramp, I love you, and thanks for taking a kid shooting.


Many years ago as a child, my mother thought that it would be prudent to send me for a dental checkup with our family dentist. She had made an appointment for me earlier in the month and the big day had finally arrived. Yep, the big day.  The day when I would find out what a dentist was, what he did and how he did it.

So we hopped into our VW Dasher and began the drive downtown.  The trip seemed  longer that day than most and my mind continually wandered onto thoughts about what this experience would entail and how my experience would compare to other stories I had heard.  Terrible!, terrible stories had been told to me by other family members. Including stories from my often animated Uncle Mark who could put the fear of God into a five year old boy with his dazzling talents.

Well the trip ended a  few minutes later and we made our way into the office parking lot finding a nice place to park near the front of the building.  Have you ever noticed you can always find a great parking place at the dentist office?  We entered the office through the side door and into an area I later was told was the reception area.  Entering this room, I glanced around to find fake plants, patients fidgeting and old torn, probably uninteresting, magazines littering  tables in each corner.

I took seat on one side of the room and my mother took the seat next to me.   The next half hour, I carefully watched each patient as one by one the poor souls  were called back to take their turn with the dentist.  Even at the tender age of five, I knew something was not right in this place.  Perhaps it was the look on the faces of the patients or the strange odors wafting in from the long hall whenever the hygienist opened the hallway door.

Well, it wasn't too long before my name was called and off my mother and I trudged down the hall and into an empty examination room. It probably wasn't that cold in there  but it seemed that way to me. My arms had goose bumps and my face had that funny tingly feeling you get when you have had too much sugar.  My mom tried to keep my mind off where I was, and told me I had nothing to worry about and that everyone has to go to the dentist.  Later, when I became a parent I found out that this tactic is about all a mother can do to help her poor child get through bad experiences and that the parent wants to get out of there just as much as the child.

 After a few minutes of sitting in the chair and looking at the pictures of teeth plastering the wall, I was greeted by the dentist.  He made a couple jokes that I smiled at even though I had no idea what he was saying or the meaning of what he said.  The man had short hair and seemed middle age to me, but he was probably in his early thirties at most. At five, everyone looks old.

The dentist began by shining a light in my face and examining my mouth with some kind of pick.  Every once in a while he would stop and scrape the tool on a tooth then tell me to spit in a little bowl mounted to the chair (this was before those suction things they use now).  After the exam  he turned toward my mother and informed her that I had a small cavity and should have it filled.  "Filled? Oh no!", I thought. "I remember this from those horrible stories my uncle told. I believe, in those stories, he may have mentioned something about a drill and horrific eye bursting pain." Before I could utter a word of protest,  a high pitched sound broke through my thoughts.  There it was, in front of me. What I now know as an instrument of pure evil.  It was...  The drill!  Now some of you are reading this wondering if I missed something.  Perhaps I missed the part about needles and numbing my mouth. No, no I didn't forget to mention that, this boy was being drilled without novacane, as they called it then.  Yep this guy didn't give me one drop of pain killer. He was going 19th century on me.

Of course, it only took a few seconds of drilling before I began to feel the pain. The smell of a dentist who had smoked too many cigarettes  combined with the smell of burning decayed tooth filled the air. I must have been turning white, because he glanced at my mom and  assured her that people my age do not feel pain when drilling and if the do it is very minor.  I can now and could at that moment say that was utter and total nonsense.  My job, however,  at this point was to be the tough little man and hang in there.  Pain was part of life, my Marine father often said.  This was one of those times where I would have to push through the pain and be a tough little Marine.

I don't know how long it took.  It seemed like maybe 15 or 20 minutes, but it was long enough.  When I sat up from the chair I was exhausted and laden with sweat.  I now completely understood what a dentist was, what he did and how he did it. All of my questions had been thoroughly answered without uttering a word.  He was a sadist quack!

My feelings toward dentists have not changed.  They continue with each visit to reinforce my ideas formed at a young age.  Perhaps there are good dentists out there but I doubt it.

  




The smell of the turkey roasting in the oven brings back many a memory of family gatherings around the holidays, but something is mysteriously missing at this years Thanksgiving.  Great Food!

I remember my grandmother making huge batches of mashed potatoes, bowls of turkey gravy, several pumpkin pies, and of course, the ever delicious apple pie.  Unfortunately all of this is but a distant memory. Today, the culture is all about healthy foods and how to "immitate" the Thanksgiving experience with substitutes to those famous dishes.

So what are we having this year?  Well thank God the turkey and stuffing are still present, but that is where the similarities come to a total halt.   This year the potatoes have been replaced with "real" vegetables, the pies are crustless pies because of course white flour is evil and the gravy well, you know, it is fatty of course so that is missing.

Is this celebrating?  I find it a poor and totally lacking substitute for the real deal.  At the same time I get the fact that we are becoming a fat, lazy and unproductive society.  It seems, however, that we could still be a productive society, yet still eat all of those great foods.  Our country fathers made the country what is is today and I'll bet they had some apple pie at Thanksgiving.

I recently wrote a Windows service using Microsoft .Net technologies to act as a broker between two heterogeneous systems.  Being a service, there is obviously no user interface for one to get feedback on how the process is executing or if it has gone into a state of error.  My solution to this was to build a very complex logging mechanism which logs information to the Event Viewer, a text file and when needed snds emails to the administrator.

All of this of course works very much as expected, but what about data integrity.  What if one of more of my systems has suspect data?  Of course the typical response to this question is for the developer to simply say, "Well the data has to be right since the app has to have good data at the very least in order to have basic operation."  So I don't believe anyone reading this would argue with that, but there are times when dealing with third parties that data can become corrupt due to errors in both their database and the communication layer.  When this happens, who is really hurt by the bad data?  The answer of course is the developer and his management chain.  It is not immediatly the third party.

To battle this problem there has to be a mechanism for at least handling data integrity issues so that better information can be sent to the admin to combat the issues.  Currently, the way we are dealing with this is by placing in-line rules into the service code as needed and passing as much data as possible back to the admin to further investigate so he can escalate the issues with the vendor.

Many information technology departments, already saddled with a heavy load due to budget cutting in a bad economy will have a difficult time building the appropriate rules into the code simply because they don't have enough time in the day.  Currently I don't have a good solution to the problem other than to make sure that every company has a data steward.  Just a food for thought blog entry.

Introduction
I have been in the software development business now for twelve years.  I have worked as a contractor, consultant and an in-house developer and thus have been on many an interview along the way.  First, it should be understood that companies generally do not know how to interview as noted in the book "What color is your parachute?" by Richard Halls, but worse than that most companies put other developers in the room to interview the job candidate as they wish.  These are people who have their own agendas and often expect more in the interview than they would expect from an interview.  I want to outline several problems I have seen over the years in the IT interview process so that perhaps someone might read this blog and find a better solution to this dilemma.  I don't expect you to agree with everything here but please read it with an open mind and try to make real changes in your interview process.

The Standard IT Interview Process
Interviews usually go through the following workflow.  First, the resume is received by a human resources team or a recruiter who specializes in finding IT talent.  On their desks it is scrutinized for spelling mistakes, overselling and the ability of the job candidate to articulate his skill set.  I really do not see a problem here as this is what one would expect from a good HR employee.

Next, the handful of candidates who were chosen based on their resume are often scheduled for a phone interview.  The phone interview varies but is often peppered with questions about who you are and where you have been and in many cases a series of basic programming syntax questions are asked. 

Finally, one or two candidates are chosen from phone interview for a face to face interview.  A candidate coming in for a face to face interview could be subjected to several interviews with various levels of management and development staff.  In some cases these combined interviews can last several hours and produce very little toward the goal of hiring a candidate.  The last step is often repeated one or two more times until the company in question is sure they have the right employee.  Below I have outlined several interview types which I have identified over the years and why they are effective or in most cases not effective.

The Test Driven Interview
Nothing is more daunting to both the developer and the interviewer than the test driven interview.  In this interview scenario, there is often a verbal and/or written examination which can vary from simple syntax questions on a particular language to full blown project related questions where a developer codes a business scenario under a given time window.
Testing has a purpose in an interview, but testing is often not realistic and not focused.  First, asking a seasoned developer syntax questions is often just an exercise in futility.  Veteran developers have authored projects in languages ranging from Java to  T-SQL to Objective C and realize that syntax is pretty much the same across all OO languages.  A good handle on Google is about the only tool a long term developer needs.  So if you are interviewing a senior or lead developer keep the syntax questions to a very minimum. It is better for the interviewer to tailor their questions toward the subject of architecture and problem solving.  In other words, a for loop is a for loop so who cares how it is executed.

The Good Ol' Boy Interview
In this type of interview, general questions are often asked which probe the developer to see what kind of a fit he would be in a particular team.  I have been asked questions such as "Do you drink beer?" or "Do you play World of Warcraft?" or "What is your political affiliation?"  These types of questions do have a  place in the interview but one needs to be careful that the entire interview isn't questions about hobbies and life stories.  Personally I would stay away from questions regarding alcohol and political preference.  The interviewer should be able to get a good feeling about the candidate without asking personal questions.  Just as a note, I usually excel at the Good ol' Boy interviews because, well, I am a good ol' boy.

The Bad Cop, Bad Cop Interview
Did I mean "Good Cop, Bad Cop?"  No, I meant bad cop, bad cop.  In this type of interview the interviewers make every attempt to intimidate the developer and make him crack.  I think somehow they think if the ask every question like a police office trying to get someone to confess to murder they will weed out the weak.  In this particular case they often project themselves with a solemn face and ask questions in monotone.  My personal feeling is that they really don't want to be there and they really don't want another developer on the team so they try to run the poor guy off.  Usually they ask very difficult questions in an effort to completely fluster the candidate.  In one bad cop interview I was asked "How many parameters can be passed into a stored procedure in SQL Server 2005?"  Really, is anyone passing 1024 parameters into a stored procedure?  Think about the questions you ask. Are they practical and meaningful or just trivia?  In one instance I became so angered by the silly questions they were asking, I just started asking them difficult questions.  Of course they didn't know the answers either.  Interviewing is not a game of Jeopardy, it is a way to find out if a candidate will be a good fit and be productive in an organization.

The Senate Hearing Interview
Similar to the Test Driven Interview, in this scenario, the candidate is faced with a panel of perhaps 6 to 10 developers firing away question after question ranging from simple to the absurd. These interviews can often last over an hour.

In our world, there is a concept called fight or flight.  When a person is put into a pressure cooker situation such as a panel of interviewers the fight or flight mode is activated.  I have reacted in this situation in one of two ways.  Either I become angry that they are asking so many questions from so many directions and I begin to get defensive or I just give up.  Remember that you are hiring a developer not an attorney.  A software developer does not need to be able to stand up to a barrage of questions coming from 10 different directions.  Most developers are involved in very small groups and do a large amount of head down development with small meetings scattered in.  By the end of this interview the developer is tired and generally turned off about your organization.

Conclusion
An interview should be composed of between 1 to 3 people and be structured as follows.

  • Get to know the developer time  (10 minutes) - question to ask might include topics about where he is from where he went to school and what type of hobbies he participates in.  Do not ask him where he sees himself in 10 years.  This can be a huge turnoff for me anyway.
  • Project Related Questions (10 minutes) - questions might include topics about the business problems solved and how architecturally they were solved.  Also ask questions about technologies used to solve the problem.
  • How To Questions (10 minutes) - questions might include topics about how would I connect to a database and what types of objects are involved. Be creative here but not ridiculous.  Don't ask questions about the value of "x".  This is a waste of time!
  • Questions from the Candidate (10 minutes) - this is the time for the candidate to ask you questions.

The interview lasts no longer than 40 to 45 minutes!  Note that in the end no interview process is going to giv e you the perfect candidate but it can make the choice a little easier.  Culture and fit probably play the biggest role of all in finding the perfect developer.  Technology can be learned but communication skills cannot.  Finally, don't forget about the technical references.  Usually they are coworkers or a manager and can offer good insight into what technologies he knows and what he has done.