Highway to hell? @mariannerd and @aahoogendoorn reviewing code of the boys

DevTweet - Software Development with a wink

DevTweet’s zijn de conversaties tussen Marianne van Wanrooij en Sander Hoogendoorn over de (on)zin die IT-ers bezig houdt: Software-ontwikkeling met een knipoog. Regelmatig zullen ook gasten worden uitgenodigd. Volg ze ook op Twitter via @mariannerd en @aahoogendoorn!

Sander_small_normal

Listening to Black Sabbath's Master of Reality.

On_a_balcony_in_milan_normal

@aahoogendoorn Look at you... new avatar! Is that an AC/DC shirt?

Sander_small_normal

@mariannerd Howdy partner! It is AC/DC all right. Your avatar new too? Something wrong with the old one?

On_a_balcony_in_milan_normal

@aahoogendoorn Nope, just a change in scenery! Like the project I'm doing. I'm asked to do a code review.

Sander_small_normal

@mariannerd Cool! Whenever I'm asked to do a code review, the client always knows, or at least suspects, something's terribly wrong.

On_a_balcony_in_milan_normal

@aahoogendoorn Oh yes... We have the suspect... Now it's a case of getting the evidence ... I feel like Columbo..

On_a_balcony_in_milan_normal

@aahoogendoorn You know the suspects from the beginning, but you still have to look for the evidence for conviction!

On_a_balcony_in_milan_normal

@aahoogendoorn So when you are asked to do a code review, what is the first thing you do?

Sander_small_normal

@mariannerd The first thing I do? Ask the client what they're hoping to achieve: do they actually want to know how deep the rabbit hole goes?

Sander_small_normal

@mariannerd Next, I make a list of all things I should look at during the review. Architecture, domain, data access, layers, extensibility..

Sander_small_normal

@mariannerd Security, authorization, reuse, code copying (especially in VB), way of working, documentation, design, quality of coding.

On_a_balcony_in_milan_normal

@aahoogendoorn So far so good!

Sander_small_normal

@mariannerd Rule #1 in code reviews: more time means more detail.

On_a_balcony_in_milan_normal

@aahoogendoorn Code Reviews are fun! No deadlines. just looking at somebody else’s code.

On_a_balcony_in_milan_normal

@aahoogendoorn ... Oh and telling what's wrong with it... I must say this is the first time I get such an assignment.

Sander_small_normal

@mariannerd. You know, there's so much horrible code out there, we could do code reviews for the rest of our lives.

On_a_balcony_in_milan_normal

@aahoogendoorn Well, a lot of this stuff is subject to opinion... 100 developers, 100x different code for the same functionality...

Sander_small_normal

@mariannerd Yes true, but some code is definitely worse than other code. And believe me, I've seen some bad coding in my time.

On_a_balcony_in_milan_normal

@aahoogendoorn Any examples?

Sander_small_normal

@mariannerd Examples of bad code? How many do you need. Check out this old blog post of mine (in Dutch). http://htxt.it/reVB

Sander_small_normal

@mariannerd. Think of SQL statement in web pages, or of a single class that handles 50% of all functionality.

Sander_small_normal

@mariannerd. Or think of the same business rule implemented multiple times on different locations, in different ways.

On_a_balcony_in_milan_normal

@aahoogendoorn One of the things I came across: internal web application: authentication by doing a LDAP query to see if the user exists.

On_a_balcony_in_milan_normal

@aahoogendoorn Haven't they heard of Windows Authentication in IIS? They didn't even check if the user was enabled or disabled... :-S

Sander_small_normal

@mariannerd Haha, nice one. I once audited the enterprise web portal for a very large international company where ALL communication ...

Sander_small_normal

@mariannerd between front end and back end went through one single class. Imagine the effect of a single change..

Sander_small_normal

@mariannerd Sometimes, it gets really bad. Code a whole company depends on, which is so bad, that productivity will definitely be below zero soon.

Sander_small_normal

@mariannerd Anyway, I love being asked for code reviews. It gives the opportunity to help improve the quality of applications.

Sander_small_normal

@mariannerd. That is, if they follow up on your advice from your code review. Unfortunately, that is not always the case.

On_a_balcony_in_milan_normal

@aahoogendoorn Well maybe it's not needed... Or they just want to know the risks and are happy to take them!

On_a_balcony_in_milan_normal

@aahoogendoorn Which could be the outcome of a code review. It's not good, but far from worse… And it may be fixed with a couple of quick wins.

Sander_small_normal

@mariannerd. Well yes, that could be the outcome. Maybe I'm to idealistic about writing good code. If it ain't broken, don't fix it.

Sander_small_normal

@mariannerd. But I just love clean code...

On_a_balcony_in_milan_normal

@aahoogendoorn .... But even bad code can function.

Sander_small_normal

@mariannerd My favorite example: an ASP.NET web site that was never compiled by the developers. They just ran it from the browser. Great stuff!

Sander_small_normal

@mariannerd. As a consequence, of the over 40 pages in the application, only 6 compiled (the ones they visited running it in the browser)...

On_a_balcony_in_milan_normal

@aahoogendoorn LOL "we got a live one here!". This business application compiled at runtime? No test cases, just put it in production!

Sander_small_normal

@mariannerd. And then things can get pretty messy. Especially when your poor company lives of this software.

On_a_balcony_in_milan_normal

@aahoogendoorn That is the whole point isn't it… Developers just start coding without a plan, or knowing best practices.

Sander_small_normal

@mariannerd Yes, a lot of developers code without having a decent architecture, without patterns, without layers - but with best intentions.

On_a_balcony_in_milan_normal

@aahoogendoorn Oh yes, best intentions... The road to hell is paved with good intentions...

Sander_small_normal

@mariannerd. No stop signs, speed limits. Nobody's gonna slow me down. Highway to hell. AC/DC# ?

On_a_balcony_in_milan_normal

@aahoogendoorn Nope... 4 minutes by Madonna LOL.

Sander_small_normal

@mariannerd. Madonna? Girl you need a music review instead of a code review!

On_a_balcony_in_milan_normal

@aahoogendoorn ....I guess even bad music can function. ;-)

Commentaar van anderen:
ChristianLouboutin op 17-8-2010 om 5:11
Christian Louboutin Shoes, Christian Louboutin, Christian Louboutin Shoes, Wedding Shoes, Wedding Shoes, Louboutin Shoes, Christian Louboutin Discount copies of the mirror, so the angel of the practical activities of customers who activities. Christian Louboutin Evening, Manolo Blahnik Shoes, Christian, Louboutin, Christian Louboutin Sale, Louboutin Sale, Cheap Christian Louboutin Can you from your shoes, you give yourself into chargeless travel and bear your lifetime. Christian Louboutin Boots, Christian Louboutin Pumps, Christian Louboutin Sandals, Christian Louboutin Flats, Christian Louboutin Wedges, Christian Louboutin Sandals Do you agree to accept and hear the cases angled heel shoes forward or abstract, tear, buttons, and destruction, and the ability to reduce greenhouse gas emissions, it is exactly like daydreaming and shoes. Yves Saint Laurent Shoes, Christian Louboutin Boots, Manolo Blahnik Shoes, Yves Saint Laurent Boots, Miu Miu Shoes, Christian Dior Shoes this is an extra brand and shoes. However, you will never accept the amorous Louboutin christians through brand. Christian Louboutin Flats, Christian, Herve Leger V Neck Dress, Herve Leger Bandage Dress, Herve Leger Dress, Herve Leger V Neck Dress You can visit in your configuration of the life of their shoes were forgiven a brace, air brief you accept defeat them later anniversary, they are careful bag dust, shoe box that you have to go.
Geef feedback:

CAPTCHA image
Vul de bovenstaande code hieronder in
Verzend Commentaar