Tech Blog

Jay's Technical blog

I think I get XP..

30 June 2005
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

[Update... be sure to read the comments where Raymond Lewallen corrects me]

Ok, after about a year of hearing people write about the glories of Extreme Programming, I think I get it.   More importantly, I think I might want to do it (at least part of it).  Let me explain what I think I know and then someone else can come behind and correct me.

My understanding of XP is that it starts with this premise: the customer knows what they want, but they can't articulate it, so you get the user to give you the big picture and ask what parts of the big picture are absolutely essential. 

Once you have the concept for the essential pieces the development team goes off and builds just these pieces using patterns (if they apply, but don't force yourself into patterns), test driven development, refactoring, and pair programming (did I miss anything?).  Spec documents are created if it seems that they will be helpful (XP seems to be light on documentation...although I could be wrong on this).  The goal in the actual development is to do 3 thing: produce quality work, produce the simplest app that satisfies the requirements,and produce an app that is easy to change (because your app will change).

Next the app is shown to the client again (and you want this to happen ASAP).  The client then either says that you have it right or the client explains what needs changed (editing is always easier than starting with a blank slate).  If the client has changes you go through another short development cycle; if the app is correct then you find out what the next most important feature is and you go through another short dev cycle to produce this new requirement (once again spec doc are updated if it makes sense to have docs).  Repeat, rinse, recycle.

Estimates are the hard part, but I think what gets said is that I estimate 2 months will be all that it will take (or we will work for 2 months and see where we are at).  At the end of 2 months you may not have the complete app,but you may also have something that includes features not dreamed of in the original spec; you will also have the most important features built. 

The only other thing is that the customer has to be committed to solving any problems and providing info that the developers need.

So what did I miss?  Do I get it?

Coding Forensics

28 June 2005
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

[I decided to go a little light hearted today... When I get done writing for How To Select, I'll take some time and post an entry with Code... until then..]

I was thinking today about one of my skills (at least I think its a skill).  Recently I have had to touch a couple projects that the developer was no long since gone.  In one case I needed to fix the
remaining bugs on a project done by a consultant whose contract was over and whose project still had a few bugs.  I used a method that I have heard mentioned here on CodeBetter... refactoring to patterns.  At first I had no clue how the app worked.  The app was originally all in a single module with a couple rudementary classes (no properties and mostly no methods).  I started by creating a few different classes with nothing but static methods so that I could organize the code.  Once I had done this I began to look at the various modules and found things that were common (so they could be refactored and simplified).  After this round of mostly reorganization I started to understand the application.  I was now able to really refactor the app (by moving even more things into separate classes/methods).  Finally I was able to understand the app enough that I could find the bugs by following the process flow.  The consultant missed a few things in his logic.  Actually an important item, so I had to create some new code to better handle his flow.  I was not overly intrusive in this; I decided not to waste a lot of time rewriting everything, just the portion that was problematic.  I guess in some respects I'm embracing XP.

I've also had times in the past where I was called upon to figure out why.  Why does this person's -- who is no longer with us -- code crash all our web servers.  Why does it corrupt the database?  Etc.  Like the TV show, CSI,  how many of you are Coding Forensic experts? 

ICUI - the reverse of FUD (AKA Offending everyone)

24 June 2005
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

Yesterday, Raymond pointed me to a post where someone was less than happy with me (no, I'm not going to link and I'm not going to explain any more than this).  Also, Darrell also told us all on the CodeBetter Blogger's mailing list that someone argued with him about a post he made (I'm also not gonna link).  Truth told the person arguing with Darrell didn't really understand Darrell's post; the commenter thought he understood something and decided that he should correct Darrell (it was a similar situation in my case as well). 

I couldn't believe it.  Darrell doesn't write like I do... I really try to put things into a perspective and ask people to think about the implications before totally "jumping into bed" with a particular technology (such as my recent AJAX post or my experts post from a while back); my goal is always not to say such and such is bad (sometimes I end up saying that though due to the arguing), but really to call us programmers to really think about our architecture choices and choose the right technology for the right job (this is my father's adage "use the right tool for the right job").  I know that I often choose a title that is a bit inflammatory, because I want you devotees to read the post (I want your attention... oftentimes so that you can answer a critical question, and gain more adoptees).  Darrell usually speaks as one who has done research and is just reporting his findings with a bit of an opinion... it's usually mostly knowledge acquisition/retention (at least that's my opinion), so that's what made me realize that maybe this needed discussing.

When I wrote the experts post I was trying to attack a particular attitude that I see in commenters, and on some blogs.  There are a lot of people out there who subscribe to what I now call "ICUI" which stands for "It's cool! Use it!"  Whenever they see a particular technology -- that they are devoted to -- attacked (or that someone points out a valid question about when to use it), they immediately attack telling the writer what a freaking idiot he is and that he has no idea what he is talking about, and that his/her post represents FUD; they then begin to state the writer should adopt their technology and use it because it will make the writer's programming faster, easier, simpler, or less buggy. 

Let me list a few technologies that have devotees who have classically done this (and I have done my share of ICUI):
OO (hey, I'm in this category... 00 Ru73z!  And you should use it... no apologies on this one, but posts do fit in the ICUI)
C# (this typically states VB and all other languages that aren't C#/C++ are toy languages)
VB (yep, we VBers react so strongly that we sometimes misconstrue a criticism of VB as an attack on ourselves... we usually ask how does the IL look different from C#'s as if anyone can truly answer this question in all cases)
XP (Test-Driven, refactoring, etc.... not saying it's bad... just that sometimes there is an air of ICUI)
ORM vs. Templating vs. I build it all by hand (I've had my battles here... I'll leave it alone... I have too many bruises already)
AJAX vs postback (I've had some minor scrapes here too)
WebForm Vs. WinForms (pick a side and fight the other to the death! BTW, the alternative would be to logically look at both technologies and decide on a case by case basis)
Remoting vs. Web Services vs. Enterprise Services (once again pick a side and fight everyone else)

The truth is there is a place for all these technologies (well, except OO... you are using it right? ICUI! <grin />), and we need to try to establish times to use them (yep, I do believe there is a time and place for ORM and AJAX, BTW... Someday, I might actually tell you all what I think)

I think back to how I did an ICUI in the VB vs. C# arena... now that I know more about C#, I truly understand what the person I was attacking was saying... I honestly wouldn't build any .Net components in VB that I planned to give to the masses... there are too many compatibility issues... but then again I'm probably just spreading FUD.

I guess lately I have been getting a taste of my own medicine...

[PS. comments are on feel free to comment away]

Learn SQL... It's good for your career...

22 June 2005
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

[Comments have been turned off on this post because I know that it has the potential to create a flurry of comments (read "flames")... if you want to comment on/flame this post then do it on your own blog...]

Ok, after a couple weeks I've decided to indirectly go after some things that were said in the infamous O/R Mapper war (I'm not going to link to it... if you want to search, go look for "Frans Bouma" and you should find it).  I hinted at a few things in my "The Database War" post.  [Warning: I'm not so indirect when I get to the end]

I have had the opportunity to mentor a number of developers who all turned out pretty good.  I've also mentored a couple developers that weren't meant for this profession and they have since moved on (or away from me and my ideas). 

"What am afraid of is what I need to master"
One of the things I learned along the way is that the things that have the ability to really bite me in the butt are the things I don't know.  I had a "student" ask me what they needed to do to truly master the art of programming; s/he was hoping to have arrived in 6-12 months and felt they s/he would be depressed in a year if s/he wasn't writing... s/he and I joke about this often now that s/he has truly arrived (or is near enough that the landing gear is down and the lights of the airplane are on).  S/he was thinking about diving into the depths of the .Net framework so that s/he could truly understand thread programming or some other advanced topic (pick one).  In a stroke of genius beyond myself (it was spiritual for me), I asked her/him "what scares you?  what really scares you, because that my friend is what will really be the thing that hurts you..."  The answer I got was something like "well, uhmm, I do need to learn SQL... but we have DBAs!"  My response was that a developer who can truly do both database programming and the front end programming (ASP.Net, WinForms, etc.) -- and do both parts well -- is a person that most companies value highly.

I also told her/him of my experiences where I was transformed into a Sr. Developer when I was handed some source code that I have never seen before and was told that I would rewrite it and become the certified expert in the code; the last thing the person told me will stick in my mind forever... "I was never here; I have never heard of this project; I disavow all knowledge."  This was followed by a sick sounding laughter... Despite the pains, I grew so much as developer during this time.  I learned to take junk and create something that looks a little less like garbage (although I'm sure someone cursed my name over it at least once).  The point was that after this experience I was unafraid of anything.  I strengthened my AccessSQL skills as well as learned T-SQL and SQL Server 6.5 (I already knew VB quite well).  The next job which happened about 1 year later I learned Oracle P/L SQL (8i) and learned ColdFusion (a skill that I will deny having today) and starting doing some ASP/VBScript coding.  A year later I went to work for Hydrogen Media Inc (BTW, out of business) where I used both my SQL skill sets and added even more skills.  Database servers do not scare me nor does SQL in any flavor... and neither does anything else new as it relates to syntax.

So when I hear of people asking (whining, actually) "Why do I need to learn SQL?" or JavaScript or HTML or any number of other things... I have to say because it's good for your career; multi-lingual/multi-DB people are good for our industry.

If you can do anything how valuable are you? <grin />

Since it's not truly possible to know everything; if you can learn how to do anything, isn't that the same thing?

And that, Virginia (she's the girl who wondered about Santa Claus), Frans, and Thomas T, is why O/R Mappers concern me: people are deciding to forego learning certain skills that I think are actually critical to them and to the industry... Besides, I really don't want to have to deal with any more "Sr. Developers" who don't do databases.

Why AJAX is dangerous... My Daily WTH (What the heck?!!?)

22 June 2005
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

I made an interesting discovery at work today.  I finally had to work on a piece of code that I have always found ways to hand off to someone else.  It was written by a former colleague who absolutely loved JavaScript and Remote Scripting (aka AJAX... don't argue with me they are the same thing more or less).  Every programmer who has ever had to do something with this code has hated it (except the originator).  BTW, this is ASP code.

So before I continue on, I would like to ask everyone a question.  How many lines of Javascript is too many in a page?  When do you start thinking about moving that functionality out of the page and back on the server?  In other words, when is it OK, to go ahead and post back to the server.  How many lines?

Ok, pencils down... what do you have?  A couple hundred?  One thousand?  Fifteen hundred?  So you would say that 5000+ lines of JavaScript is too many (I hope so).... the entire application is written in JavaScript with remote calls to retieve data.  BTW, data is returned from these routines as delimitted strings (with one delimitter for a record and a different delimitter for each field in the record).  This data is then pulled apart using that high-tech JavaScript method split... Can you say sssssslllllooooooowwwwwwww?    It also creates new HTMLelements on the fly which is also not the fastest method of doing things.

Oh yeah, and where was this code?  Not in a separate file incuded via a script tags src attribute... No... this code is dropped into the top of the ASP page, so that the ASP <%=%> could customize the page and keep the page from being cached by the browser...  BTW, when I removed the non-customized JavaScript and put the 5000+ lines into a separate file the resulting .JS file was 266kb!

Am I allowed to rewrite?  Of course not!  <sigh />

Those of you who love AJAX, please be responsible when you are evangelizing the technology and remind people that doing everything with JavaScript/AJAX may not result in a speedier solution.  It may result in something less maintainable and/or less speedy...