KevinUp

real world programming

Follow up : Case of the Mondays

Posted by kevinup on October 9, 2008

thought I’d follow up briefly to my Case of the Mondays post.

I’ve got some other pics which I might add to Picasa later, but this is probably the best one. The cop said the damage didn’t look so bad, once they put the car right side up. He thought a lot of energy was expended lifting our car up and turning it during the collision. The crater in our car was probably 20 inches at the deepest part. Part of the other drivers license plate was embedded in the crater as well.

The other driver was sited for ‘Failure to Yield’. When the cop was taking her statement she insisted that she had come to a full stop before accelerating again. The cop tried to explain to her that it was impossible to be at a full stop accelerate 20 feet, collide with another car and flip it. Some people are just stupid, ignorant or both. He estimated that her 2003 Impala was going at least 45 MPH, and due to the lack of skid marks, he felt she didn’t even try to stop.

After looking through the court records online, I found she had to pay a fine of $80 dollars. Eighty freaking dollars! Are you freaking serious!??. She could have killed the three of us. She had a Indiana license. I thought initially that she was from out of town and unfamiliar with the area. . But through the court records I found that she lives less than a half mile from our house. Give her no excuse for her reckless driving.

Of course she was unemployed and uninsured, so our insurance is covering our medical expenses, and car replacement. State Farm has been really good to us, so I’m probably a customer for life now. State farm is planning on going after her for the money its cost them so far, I estimate its probably almost 20k. I doubt they’ll get anything. One state farm rep suggested that they could help us sue her for ‘pain and suffering’. I think I’m just happy that we’re all ok, so we’re going to pass on that.

We bought a new Rav42008 last weekend. So in my mind we’ve been made as close to whole as possible.

Posted in Uncategorized | 5 Comments »

How do you implement a feature?

Posted by kevinup on October 7, 2008

I just got off an interesting interview with a potential client. It went ok. We had some intelligent conversations about WCF, Link, web services, a general work up. One questions that he kept circling around too left me baffled and struggling to understand what he wanted to here. He kept asking ‘How do you implement a feature.’

Typically I like the vague, open-ended questions. I felt like I could see where he was coming from. Some developer he’d probably worked with would over think a solution, gold plate it, and deliver it, and the end result was nothing that satisfied the specs. I know I’ve seen that happen to projects I’ve been on.

My answer, while I didn’t think was wrong wasn’t the answer he was looking for. I would write some unit tests that satisfy the requirements for the feature as best that I could. I would then create the classes that would be needed to pass those tests. I would then create and DB tables or fields as needed, or mock out any other dependencies that my code depends on. And wolah, feature implemented. Obviously there are some things you would do differently depending on your architecture or UI changes. But I think you could follow that methodology 80% of the time.

He didn’t like my answer. ‘Yeah but how would you implement a new feature?’ he would reiterate. I tried to rephrase or expand on what I was saying, but it didn’t seem to satisfy him. He rephrased his question a couple times and each time I couldn’t come up with something significantly different than what I had already told him.

So my question to anyone out there is ‘How do you implement a new feature’. What should I be doing differently? What am I missing?

Posted in Uncategorized | Leave a Comment »

vb

Posted by kevinup on October 6, 2008

I recently finished a seven month assignment. It wasn’t anything glamorous. It actually was somewhat miserable at times. The worst thing about it was the client wanted their solution in VB.net. At first I was thinking, that’s ok, I’m a multi-lingual kind of guy. I prefer C#, but I’ve done some VB.net in my past, so it shouldn’t be that big of a deal. The assemblies are the same, it always compiles down the same or similar IL right? While that’s all true, I could never be so wrong about being multi-lingual.

Let me start of complaining about the IDE. In C#, when I was creating a class, I would drop in my private properties first. Then traverse back through and simply right click on the properties, and select ‘encapsulate method’. The IDE would code out my public properties. This would allow me to create my classes pretty quickly. In VB.net you get nothing. I thought initially it was a mistake. I checked on a couple other developer machines, and I got the same result. So instead of it taking 30 seconds to create a class, it took 5 minutes of boring copying and pasting.

Next: There is no extract method. Like any good developer I like my methods to be short, quick, and concise. A good method will usually start out around 5-10 lines. As the code matures, it might get to 15-20 lines, which I consider the max a function should be. Above 20 lines, its time to refactor your code. At this point I like to evaluate the method and try and isolate a couple lines that are specialized enough to be its own method. At that point you can highlight those lines, right click, select ‘extract method’, and BAM!. Done. In VB, not so much.

Next: Nullable types. I love nullable types; I don’t know how I used 1.1 without them. In C# a nullable type is declared as: ‘int? myInt’. In vb you can to say: ‘dim myInt as Nullable(of Integer)’. If you do that a couple times it will make you want to shoot yourself. The same applies to generics. A generic list in C# is just: ‘List<int> myList’ in VB its ‘dim myList as List(of Integer).

Those are my main gripes about VB.net. I found it so frustrating that I went to the client multiple times to try and convince them that C# was better, with no luck. The application had been in production for 4 weeks and generated 2.5 million in revenue by time I left. They were impressed enough that they offered to hire me away but I had to turn them down with my number one reason being VB.net. Ironically the week I was leaving they decided all new development would be in C#, and re-offered me the job again. C’est la vie. Too little to late in my book.

Posted in .net | 2 Comments »

Case of the Mondays

Posted by kevinup on September 19, 2008

We, as well as most of Cincinnati, were plunged into darkness Sunday when remnants of Hurricane Ike blew through. On Monday power was still out at home. Carrie Julia and I decided to head out to Old Spaghetti Factory. On the way back we managed to get within 2 lights of our house uneventfully.

At the second to last light we were turning left. The light was totally out, and everyone was treating it like a 4 way stop. Or maybe I should say almost everyone treated it that way.

When our turn came, I was careful to make sure everyone had stopped and I committed to my turn. In mid-turn I looked right out the passenger side to see a car about ten yards away and flying towards us. I had zero time to react. The thought that crossed my mind was ‘Why didn’t she stop?’. I tried to use my non-existent telekinetic powers to slow down her car and move us out of the way to no avail.

When the car blasted into us, Carrie, who was in the back seat with my daughter, screamed at me “KEVIN” in a tone I’d never heard before. It wasn’t a ‘Kevin please help me with dinner’ tone. It was a “Kevin, are you aware that there is a car slamming into us?” I hope to never hear that tone again. Hopefully I’ll just be helping out with dinner from now on.

After the car blasted into us, it seemed like she just kept coming. She got up under us, and I could feel that side of the car lift into the air. I braced my arms against the roof of the car as we began to roll.  After we were rotated 90 degrees, the driver side window shattered. I felt like the window behind me shattered, but later I found out it was still intact. We started to roll more, but didn’t make the complete rotation to get upside down. We rolled back and settled with the driver’s side resting on the ground. My next thought was “Wow, the car engine seems to be really loud.” I realized that the engine was still on, and my foot was still hitting the gas. I took my foot off and turned the car off. Simultaneously Carrie was in the back saying ‘Oh my God’ over and over again.

It seemed like an eternity before I heard Julia start to cry in the back. In a way I was somewhat relieved to hear her, but we were still sitting on our side in what seemed to me a pretty serious crash. Some people outside the car had come up and were asking if we were okay. My wife and I pretty much ignored answering that question directly. I think I screamed “Call 911!”, and my wife screamed that we had a baby. Time was going very slow, but I think I was probably getting hit with a bunch of adrenaline at the time.

I unbuckled my seat belt and stood up on the side of our car. I reached back to try and get Julia’s car seat out. Her seat was in the middle of the back, and my wife was in the passenger side in the back. Someone had managed to open the back door on our Rav4 and was encouraging us to come out that way. I took out the headrest to the seat behind me to make room to get out. Someone on the outside suggested we unbuckle Julia and pass her out to which Carrie and I replied “No, she’s staying in the seat until a doctor can see her.

Carrie, who was suspended in the air, couldn’t get her seat belt undone. I reached up and slid my hand to Carrie’s buckle to release her. She slid past Julia seat’s seat and then got out the back. I got to work then trying to release Julia’s seat. The whole time Julia is not happy. She a good cross between terrified, pissed off and potentially in pain. I kept telling Julia that we were going to be okay. I got her car seat unlatched, at which point someone had pried open the door above us. I lifted Julia, who was still in the car seat, up to the guy reaching down at us. I tell him one more time to keep her in the seat. After Julia was out I scrambled out the back. I found Julia still in her seat crying, and Carrie sitting in front of her trying to soothe her.

Everyone seemed to be out of their cars asking if we were okay. I guess with the sight of our 2004 Rav4 on the side it was hard to fathom that my wife, daughter and I were inside just moments ago. The EMTs seemed like they were there within 60 seconds.

I told the first police officer I saw that we were leaving to take my daughter to the hospital. He took a quick statement from me, gave his card, and asked where I wanted the car towed to, which was kind of funny because that was the least of my worries. I asked if he could figure it out, and he said he would. I jumped into the ambulance, and we were off. The whole thing seemed like it lasted less than 10 minutes.

So yeah, I think I had a case of the Mondays…. :)

The doctor at the ER checked Julia out and gave her a tentative all clear but suggested we follow up with her pediatrician. The pediatrician gave Julia the all clear as well. She ended up with one scratch on her stomach and bruises around her legs, but she seems to be back to 100% with her walking, talking and personality.

I took Carrie to urgent care the day after the accident because she was having head pain. The doctor there said we should go straight to the ER and get a cat scan to rule out a brain injury which we did. We were at the ER for 6.5 hours. The CT was negative, which was good. The doctor diagnosed her with a concussion and gave her some meds to help with the headaches. She also ended up with bruises on her legs.

I just ended up with some sore muscles, so I’ll live. I’ll try and post some pictures, and some more information in a follow up post.

Posted in Uncategorized | 3 Comments »

How to screw up an interview

Posted by kevinup on August 28, 2008

I’ve been doing some reflecting recently about an interview that I had within the last year. There were various things that went wrong, so he’s my analysis of what I screwed up.

I didn’t do the proper research into the company. They had a software product, and when asked about it, I couldn’t intelligently talk about it. That didn’t really convey that I actually wanted to work there.

My next piece of advice is: brush up on computer science concepts and definitions. When asked about a semaphore, the only thing I could think about was, it had something to do with threads. I was sitting right next to my laptop, thinking I could easily get onto Wikipedia. But the little angel on my shoulder was telling me not to do it.

I remember talking about how NHibernate was freaking awesome, or at least better than writing your own custom DAL. The person interviewing me stopped and said something like ‘We write our own DAL, what do you think about that?’ I wasn’t sure what to think about that. It felt like a step backwards, and my answer to his question reflected something along those lines. He then asked, tell me how you implement a datareader. ‘Crap’ It had been so long that I’d had to think about what NHibernate was doing for me, that I couldn’t properly describe it. I fumbled out something about an IDataReader, and a command object, but the question was pretty much going down the tubes. I could practically hear my resume flying into the trashcan.

The moral of the story; don’t go into an interview thinking you know everything. Spend a little time preparing for it, because it will go a long way.

Posted in Uncategorized | Leave a Comment »

Software that needs to be written.

Posted by kevinup on August 25, 2008

This probably already exists, but I’m adding it to my wish list of things I would love to have.

I need something that runs on my router to cache files. I need the ability to customize rules on what gets cached. Finally I need the ability to clear the whole cache, or different parts of it.

What would this do? Is probably what you’re thinking well….

My wife sends me links once in a while. Sometimes they are just some news article, but sometimes, they are videos. It would be nice if I don’t have to re-stream the entire video she just viewed. Also some sites, like http://bungie.net, seem to run really slow, if I could have the router cache all images, JS and css classes, while keeping the rest of the content fresh that would be awesome.

Posted in software ideas | Leave a Comment »

my own ‘Worse Than Failures’

Posted by kevinup on June 30, 2008

I read a lot of blogs. This post is to honor one of my favorite blogs The Daily WTF(Worse than failure).

Me(Explaining NHibernate): When you have a new DB column you just 1) add the column, 2) edit the XML file and 3) change the entity.
Developer X: Thats ridiculous. You should have your data access all in stored procedures.
Me: So when you have a new DB change you have to 1) add the column, 2)change the entity, 3) change the Update Stored Procedure, 4) change the Select Stored Procedure, 5) change the Insert Stored Procedure 6,7, 8 Change all code that calls Update/Insert/Select Stored Procedures and 8) cry (which is optional).
Developer X: Yeah, that sounds about right.
Me: *Rolling eyes.*

Developer X: You’d like working at company X. They are all theory and no practice.
Me: Really? I hate people that are all theory and no practice because if you can’t apply what you are talking about then it’s pretty worthless. Why do you think I’m all theory?
Developer X: Because you’ve been pushing NHibernate.
Me: NHibernate actually works, and I actually know and use it.
Developer X: Yeah, but NHibernate is new and unproven.
Me: *Rolling eyes*.

Developer X: So, I was looking at this page and I saw a Javascript security vulnerability.
Me: Really? What was it?
Developer X: When I hit View->Source, I could see the Javascript.
Me: And???
Developer X: Well… you shouldn’t be able to do that. You should put your Javascript in a JS file so the user can’t see your Javascript.
Me: Actually, while I think putting javascript in a JS file is good practice, it’s not a security problem. Besides the user can just browse to the JS file anyway and see it. The browser is downloading it when you hit the page. Try using something like Fiddler or YSlow, and you’ll see what I mean. After all, the whole point of Javascript is “Client Side Scripting.”
Developer X: You’re wrong. The user can’t see JS files.
Me: *Rolling my eyes.* Then I created a sample Web app to put the smack down.

Developer X: I think we should use Microsoft’s ASP.Net ajax framework.
Me: That’s cool with me. I think you should download Fiddler so that you can have a better idea of the request size. In the past while using it, I had problems with ViewState getting corrupted, and I ended up using ajaxpro.info so be careful with what you are doing and be careful with your ViewState.
Developer X(2 days later): My ViewState is getting corrupted. Can you help?
Me: Sure. You can either 1) simplify the page 2) not use ASP.Net ajax framework 3) disable ViewState validation 4) use something different like ajaxpro.info or my favorite 5) cry about it.
Developer X: Well, I guess we can disable ViewState validation. I don’t like creating a security vulnerability, but the site is going to use SSH so that shouldn’t matter.
Me: *Rolling eyes.*

Developer X: I can’t deploy this other team’s code. It’s blowing up when I try and hit their web app. I’ve requested the source code, but I’m stuck.
Me: Do you have access to the DLL’s?
Developer X: Yes
Me: Open up the DLLs with Reflector. and then use the stack trace to figure out what the code is bombing on.
Developer X: Isn’t that illegal?
Me: *Rolling eyes.*

Me: So how do you test your code?
Developer X: Well, I just implement the business requirements.
Me: Yeah, but how do you know it works?
Developer X: I just know. In four years, I’ve only had two defects, and one of them wasn’t my fault.
Me: *Rolling eyes.*

Me(Looking over a template for a code review checklist given to us by management): These look pretty good. We just need to tweak the lingo to give it a .Net flavor (The checklist was borrowed from a Java project.)
Developer X: Yeah, this is exactly what we need.
Me: I especially like the last one.
Developer X: Yeah, we need to handle Exception like that. (looking at the wrong bullet)
Me: No turn the page over. I’m talking about the one saying that the code being checked in has sufficient JUnit tests.
Developer X: Oh, I see. I don’t have time to write tests.
Me: *Rolling eyes.*

Developer X: I’m on one page, and I need to pass the information to another page. What can I do?
Me: You can 1) post, 2) redirect, passing info via querystring information, 3) store in session, 4) store in DB then redirect,  or 5) store in cookie , which is not a good idea.
Developer X: There has to be another way.
Me: Actually there isn’t. Those are the standard methods and only methods I believe of passing information between pages.
Developer X (2 hours later): I found a better way.
Me (Intrigued): Really? What did you end up doing?
Developer X: I changed the page to post to the new page.
Me: I think that was option “1.″
Developer X: Yeah… but…. its different.
Me: *Rolling eyes.*

Posted in ASP.net, C#, javascript, web development | Tagged: | 2 Comments »

New project

Posted by kevinup on May 18, 2008

I’ve been in a somewhat of a developer slump recently.

It is interesting that when I was working with fun, dynamic, intelligent people that I enjoyed blogging and talking about developer issues. Now that the great people I worked with have drifted to other companies or projects, I find myself working with people who think writing code on my own time is weird and that going to a “Day of .net” is a waste of time.

I’m still passionate about development, about Agile, and about .Net. My goal is to start writing one quality post a week, but we’ll see.

Posted in Uncategorized | 4 Comments »

warning labels

Posted by kevinup on March 1, 2008

There should be a warning label on all laptops: Do not hold between thumb and index finger while walking across slate floor.

Yeah, I dropped my laptop earlier this week… while it was on… while moving it in my kitchen… that has a slate floor… and now it can’t boot…

I took it to my IT guy and he’s informed me that the hard drive is dead. The theory is that the HD was being written to when it hit the floor, and it scratched it pretty bad. He got some stuff off it, but I’m still going to miss a lot of data. Like it takes me a month to configure my laptop exactly how I like it. I probably have 50+ apps written for various things like writting and testing regular expressions, diffing ncover files, reformatting SQL, or pulling my Halo3 stats… its all gone…

I’ve never been a ‘back-up’ person, but now I’m going to have to start. Or at least I think I’ll start keeping my files on an external USB drive.

Posted in Uncategorized | Leave a Comment »

back in town

Posted by kevinup on February 11, 2008

All has been quiet on the blogging front. I haven’t really been keeping up on my google reader either, 1039 un-read, ouch.

Whats up with me recently.

I got back from Oregon recently where I got to see my brother who just moved out there. My 11 month old, Julia, had her first plane trip and she did really well. She’s just started walking, so I was expecting her to want to walk the entire time, but she managed to be content sitting on laps most of the time and smirking at strangers the rest of the time.

I did a little skiing while I was out there with my brother and it was pretty fun. The last time I went skiing, I managed to dislocate my shoulder, so my goal was to not do that again. They had insane amount of powder out there. Apparently they’ve gotten more snow in a short amount of time than they’ve had in decades. It was more-or-less constant snow at our condo. While skiing on three occasions I sank into soft snow up to my waste.

When we got back, Julia was in the depth of having the flu. We called the doctor and asked if we should bring her in, apparently all of Cincinnati is infected right now, so they suggested riding it out. By the next day I had it, and so did my wife. The next day my Mom had it and both my in-laws.

Posted in Uncategorized | Tagged: | Leave a Comment »