<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>SKORKS &#187; Developers</title> <atom:link href="http://www.skorks.com/category/software/developers-software/feed/" rel="self" type="application/rss+xml" /><link>http://www.skorks.com</link> <description>For the betterment of the software craft...</description> <lastBuildDate>Wed, 23 Nov 2011 00:18:05 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.1.2</generator> <item><title>The Greatest Developer Fallacy Or The Wisest Words You&#8217;ll Ever Hear?</title><link>http://www.skorks.com/2011/02/the-greatest-developer-fallacy-or-the-wisest-words-youll-ever-hear/</link> <comments>http://www.skorks.com/2011/02/the-greatest-developer-fallacy-or-the-wisest-words-youll-ever-hear/#comments</comments> <pubDate>Mon, 07 Feb 2011 11:42:37 +0000</pubDate> <dc:creator>Alan Skorkin</dc:creator> <category><![CDATA[Developers]]></category> <category><![CDATA[developer wisdom]]></category> <category><![CDATA[expertise]]></category> <guid
isPermaLink="false">http://www.skorks.com/?p=1931</guid> <description><![CDATA[&#34;I will learn it when I need it&#34;! I&#39;ve heard that phrase a lot over the years; it seems like a highly pragmatic attitude to foster when you&#39;re in an industry as fast-paced as software development. On some level it actually IS quite pragmatic, but on another level I am annoyed by the phrase. It [...]
<strong>Related posts:</strong><ol><li><a
href='http://www.skorks.com/2010/03/the-difference-between-a-developer-a-programmer-and-a-computer-scientist/' rel='bookmark' title='The Difference Between A Developer, A Programmer And A Computer Scientist'>The Difference Between A Developer, A Programmer And A Computer Scientist</a></li><li><a
href='http://www.skorks.com/2008/10/here-are-some-words-that-rhyme-with-orange/' rel='bookmark' title='Here Are Some Words That Rhyme With Orange!'>Here Are Some Words That Rhyme With Orange!</a></li><li><a
href='http://www.skorks.com/2009/08/building-software-development-expertise-using-the-dreyfus-model/' rel='bookmark' title='Building Software Development Expertise &#8211; Using The Dreyfus Model'>Building Software Development Expertise &#8211; Using The Dreyfus Model</a></li></ol>]]></description> <content:encoded><![CDATA[<p></p><p><img
align="left" alt="Wisdom" class="alignleft size-medium wp-image-1936" height="349" hspace="20" src="http://www.skorks.com/wp-content/uploads/2011/02/wisdom-225x300.jpg" style="width: 262px; height: 349px;" title="Wisdom" vspace="5" width="262" />&quot;<em>I will learn it when I need it</em>&quot;! I&#39;ve heard that phrase a lot over the years; it seems like a highly pragmatic attitude to foster when you&#39;re in an industry as fast-paced as software development. On some level it actually IS quite pragmatic, but on another level I am annoyed by the phrase. It has become a mantra for our whole industry which hasn&#39;t changed said industry for the better. The problem is this, <strong>in the guise of sounding like a wise and practical developer, people use it as an excuse to coast</strong>. There is too much stuff to know, it is necessary to be able to pick certain things up as you go along &#8211; part of the job. But, there is a difference between having to &quot;pick up&quot; some knowledge as you go along and doing absolutely everything just-in-time.</p><p>The whole industry has become a bunch of generalists, maybe it has always been this way, I just wasn&#39;t around to see it, either way I don&#39;t like it. Noone wants to invest the time to learn anything really deeply, not <a
href="http://www.skorks.com/2010/04/on-the-value-of-fundamentals-in-software-development/" target="_blank">computer science fundamentals</a>, not the latest tech you&#39;re working with, not even the <a
href="http://blog.tmorris.net/java-is-pass-by-value/" target="_blank">language you&#39;ve been coding in every day, for the last few years</a>. Why bother, it will be replaced, superseded, marginalised and out of fashion before you&#39;re half way done. I&#39;ve discussed this with various people many times, but noone seems to really see it as a problem. &quot;<em>Just being pragmatic dude</em>&quot;. In the meantime we&#39;ve all become clones of each other. You want a Java developer, I am a Java developer, you&#39;re a Java developer, my neighbour is a Java developer. What differentiates us from each other &#8211; not much! Well, I&#39;ve got some jQuery experience. That&#39;s great, so you know how to build accordion menu then? Sure, I Google it and steal the best code I find :). In the meantime, if you need to hire a REAL expert (<em>in anything, maybe you&#39;re writing a fancy parser or need to visualise some big data</em>), I hope you&#39;ve stocked up on beer and sandwiches cause you&#39;re gonna be here a while.</p><p>Ok, there are ways to differentiate yourself, I have better communication skills, which is why I do better. That&#39;s important too, but, <strong>developers differentiating themselves based on soft skills rather than developer skills &#8211; seems a bit twisted</strong>. We all communicate really well but the code is a mess :). Hell, I shouldn&#39;t really talk, I am a bit of a generalist too. Of course I&#39;d like to think of myself as a <a
href="http://darrennegraeff.com/the-importance-of-t-shaped-individuals/" target="_blank">T-shaped individual</a>, but if we&#39;re completely honest, it&#39;s more of a dash-shaped or underscore-shaped with maybe a few bumps :). To the uninitiated those bumps might look like big giant stalactites &#8211; T-shaped indeed. <strong>You seem like an expert without ever being an expert</strong>, just one advantage of being in a sea of generalists.</p><h2>Investing In Your Future</h2><p>I don&#39;t want to preach about how we should all be investing in our professional future, everybody knows we should be. Most people probably think they are infact investing, they rock up to work, write a lot of code maybe even do some reading on the side, surely that must make them an <a
href="http://norvig.com/21-days.html" target="_blank">expert in about 10 years</a>, and a senior expert in 20 (<em>I keep meaning to write more about this, one day <a
href="http://feeds.feedburner.com/softwaretechandmore">I&#39;ll get around to it</a> :)</em>)? But, if that was the way, every old person would be an expert in a whole bunch of stuff and that is emphatically not the case. Maybe it is just that people don&#39;t know how to build expertise (<em>there is an element of truth to this</em>), but I have a sneaking suspicion that <strong>it&#39;s more about lack of desire rather than lack of knowledge</strong>. What was that saying about the will and the way &#8211; totally applicable in this case?</p><p>I&#39;ve gone completely off-track. &quot;<em>Investing in professional future</em>&quot; is just one of those buzzword things, the mantra is &quot;<em>I will learn it when I need it</em>&quot;. It was good enough for my daddy and it has served me well so far. Let&#39;s apply this thinking to finance, &quot;<em>I will invest my money when I think I need the money</em>&quot;. Somehow it doesn&#39;t quite have the same kind of pragmatic ring to it.</p><h2>You Don&#39;t Know What You Don&#39;t Know</h2><p>We&#39;ve all had those moments where you&#39;re going through major pain trying to solve a problem until someone comes along and tells you about algorithm X or technology Y and it makes everything fast and simple. It was lucky that person just happened to be there to show you the &quot;<em>easy</em>&quot; way, otherwise you would have spent days/weeks trying to figure it out and it would have been a mess. You can&#39;t be blamed for this though, you don&#39;t know what you don&#39;t know. For me, this is where the &quot;<em>I will learn it when I need it</em>&quot; mentality falls over. <strong>You can&#39;t learn something if you don&#39;t know it exists</strong>. Google goes a long way towards mitigating this problem, but not all the way. There are plenty of problems you will encounter in the wild where you can beat your head against the wall ad infinitum unless you know what class of problem you&#39;re looking at (<em>e.g. if you know a bit about searching and constraint propagation, <a
href="http://norvig.com/sudoku.html" target="_blank">solving sudoku is easy</a>, otherwise <a
href="http://xprogramming.com/xpmag/OkSudoku" target="_blank">it&#39;s</a> <a
href="http://xprogramming.com/xpmag/Sudoku2" target="_blank">really</a> <a
href="http://xprogramming.com/xpmag/SudokuMusings" target="_blank">quite</a> <a
href="http://xprogramming.com/xpmag/Sudoku4" target="_blank">hard</a></em>). You can&#39;t learn about an algorithm if you&#39;re not aware of it or its applicability. You can&#39;t utilise a technology to solve a problem if you don&#39;t even realise it has that capability. You&#39;re not going to always have someone there to point you in the right direction. I am willing to bet <strong>there is a billion lines of code out there right now which can be replaced with a million lines of faster, cleaner, better code simply because whoever wrote it didn&#39;t know what they didn&#39;t know</strong>.</p><p>I seem to be making a case for the opposite side here, if knowing what you don&#39;t know is the ticket then surely we should be focusing on breadth of knowledge. Superficial awareness of as much stuff as possible should see us through, we&#39;ll be able to recognise the problems when we see them and then learn what we need more deeply. Except it doesn&#39;t work like that, <strong>skimming subjects doesn&#39;t allow you to retain anything</strong>, our brain doesn&#39;t work that way. If we don&#39;t reinforce and dig deeper into the concepts we quickly <a
href="http://www.skorks.com/2009/09/become-a-better-developer-by-indexing-your-brain/" target="_blank">page that information out as unimportant</a>, it is a waste of time (<em>think back to cramming for exams, how much do you remember the next day?</em>). However if you focus on building deeper understanding of a subject &#8211; in an interesting twist &#8211; you will gain broad knowledge as well (<em>which you will actually be able to retain</em>). My grandad is a nuclear physicist, several decades of working to gain deeper knowledge of the subject has made him an expert, but it has also made him an excellent mathematician, a decent chemist, a pretty good geologist, a fair biologist etc. Just some <a
href="http://en.wikipedia.org/wiki/Empirical" target="_blank">empirical evidence</a> that seeking depth leads to breadth as a side-effect.</p><h2>Can You Learn It Fast Enough</h2><p
style="text-align: center;"><img
align="middle" alt="Learn fast" class="aligncenter size-medium wp-image-1938" height="217" src="http://www.skorks.com/wp-content/uploads/2011/02/learn-fast-300x199.jpg" style="width: 328px; height: 217px;" title="Learn fast" vspace="5" width="328" /></p><p>Some stuff just takes a long time to learn. I am confident I can pick up an ORM framework I haven&#39;t seen before without even breaking stride, I&#39;ve used them before, the concepts are the same. But what if you need to do some speech to text conversion, not quite as simple, not enough background. Hopefully Google will have something for us to copy/paste. That was a bad example, only research boffins at universities need to do that crap. How about building a website then, we all know how to do that, but what if you need to do it for 10 million users a day. We just need to learn everything about scaling, <strong>I am sure the users will wait a month or two for us to get up to speed :)</strong>. Yeah, I am just being stupid, all we need to do is hire an expert and &#8230; errr &#8230; oh wait, we&#39;re all out of beer and sandwiches.</p><h2>Why Should I Care</h2><p><strong>Working with experts is freaking awesome</strong>. You may have experienced it before, everything they say is something new and interesting, you learn new tricks with every line of code, you can almost feel your brain expanding :). You want to learn from the experts, so it&#39;s really sad when you can&#39;t find any. Since everyone is only learning when they &quot;<em>need it</em>&quot;, noone can teach anything to anyone. The chunk of wisdom here is this, you want to work with experts, but the experts also want to work with experts, so <strong>what are you doing to make sure the experts want to work with you</strong>? Being able to learn something when you need it is a good skill to have, but you can not let it be your philosophy as a developer. Yes it is a big industry you can&#39;t learn everything, so pick something and make sure you know it backwards, if you&#39;re curious enough to follow up on the interesting bits, you&#39;ll find you have a decent grasp of a lot of other stuff at the end. And if you do a good enough job, other super-awesome-smart people are going to want to come and hang around you cause they&#39;ll be able to learn something from you and you&#39;ll be able to learn much from them. Everybody will be a winner.</p><p><span
style="font-size: 10px; font-family: trebuchet ms;">Image by <a
href="http://www.flickr.com/photos/samueleghilardi/2971657900/" target="_blank">SamueleGhilardi</a> and <a
href="http://www.flickr.com/photos/specialkrb/3250756763/">SpecialKRB</a></span></p><p><strong>Related posts:</strong><ol><li><a
href='http://www.skorks.com/2010/03/the-difference-between-a-developer-a-programmer-and-a-computer-scientist/' rel='bookmark' title='The Difference Between A Developer, A Programmer And A Computer Scientist'>The Difference Between A Developer, A Programmer And A Computer Scientist</a></li><li><a
href='http://www.skorks.com/2008/10/here-are-some-words-that-rhyme-with-orange/' rel='bookmark' title='Here Are Some Words That Rhyme With Orange!'>Here Are Some Words That Rhyme With Orange!</a></li><li><a
href='http://www.skorks.com/2009/08/building-software-development-expertise-using-the-dreyfus-model/' rel='bookmark' title='Building Software Development Expertise &#8211; Using The Dreyfus Model'>Building Software Development Expertise &#8211; Using The Dreyfus Model</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.skorks.com/2011/02/the-greatest-developer-fallacy-or-the-wisest-words-youll-ever-hear/feed/</wfw:commentRss> <slash:comments>48</slash:comments> </item> <item><title>99 Out Of 100 Programmers Can&#8217;t Program &#8211; I Call Bullshit!</title><link>http://www.skorks.com/2010/10/99-out-of-100-programmers-cant-program-i-call-bullshit/</link> <comments>http://www.skorks.com/2010/10/99-out-of-100-programmers-cant-program-i-call-bullshit/#comments</comments> <pubDate>Sat, 16 Oct 2010 13:27:55 +0000</pubDate> <dc:creator>Alan Skorkin</dc:creator> <category><![CDATA[Developers]]></category> <category><![CDATA[developers]]></category> <category><![CDATA[fizzbuzz]]></category> <category><![CDATA[interview]]></category> <category><![CDATA[programmers]]></category> <category><![CDATA[skills]]></category> <guid
isPermaLink="false">http://www.skorks.com/?p=1871</guid> <description><![CDATA[Something has always struck me as a little bit off, about that &#34;statistic&#34; (or its equally unlikely brothers, 199 out of 200, 19 out of 20 etc.). I remember reading Joel&#39;s post alluding to this back in the day, then Jeff&#39;s a couple of years ago, there were a few others, most recently this one. [...]
<strong>Related posts:</strong><ol><li><a
href='http://www.skorks.com/2009/09/the-best-way-to-interview-a-developer/' rel='bookmark' title='The Best Way To Interview A Developer'>The Best Way To Interview A Developer</a></li><li><a
href='http://www.skorks.com/2010/02/high-academic-results-make-better-programmers/' rel='bookmark' title='High Academic Results Make Better Programmers'>High Academic Results Make Better Programmers</a></li><li><a
href='http://www.skorks.com/2010/05/how-to-be-a-real-elite-programmer-and-make-sure-everybody-knows-it/' rel='bookmark' title='How To Be A Real Elite Programmer And Make Sure Everybody Knows It'>How To Be A Real Elite Programmer And Make Sure Everybody Knows It</a></li></ol>]]></description> <content:encoded><![CDATA[<p></p><p><img
align="left" alt="Bullshit" class="alignleft size-full wp-image-1878" height="240" hspace="20" src="http://www.skorks.com/wp-content/uploads/2010/10/bullshit.jpg" title="Bullshit" vspace="5" width="240" />Something has always struck me as a little bit off, about that &quot;statistic&quot; (<em>or its equally unlikely brothers, 199 out of 200, 19 out of 20 etc.</em>). I remember reading <a
href="http://www.joelonsoftware.com/items/2005/01/27.html" target="_blank">Joel&#39;s post</a> alluding to this back in the day, then <a
href="http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html" target="_blank">Jeff&#39;s</a> a couple of years ago, there were a few others, most recently <a
href="http://www.rethinkdb.com/blog/2010/06/will-the-real-programmers-please-stand-up/" target="_blank">this one</a>. And as much as I want to just accept it (<em>for reasons of self-aggrandisement</em>), I can&#39;t. I&#39;ve been in this industry for a few years now, in that time, I&#39;ve met some really good developers, a bunch of average ones, even the odd crappy one, but<strong> I am yet to meet the veritable army of totally useless non-programming programmers</strong> that must surely exist if those numbers are accurate (<em>the &quot;architects&quot; don&#39;t count :P</em>).</p><h2>Why Should Top Developers Seek You Out?</h2><p>Whenever I see the latest post about how hard it is to hire good people, because x out of y developers are useless, one question immediately springs to mind<span
style="font-weight: bold;">. </span><strong>Is that x out of y applicants, or x out of y working developers?</strong> There is a massive distinction. Unless you&#39;re a company trying to compile stats by doing an industry-wide study, you can&#39;t really comment on the skill levels of all working programmers in any authoritative fashion. So, we must be talking about x out of y applicants. But once again, it&#39;s not applicants in general it&#39;s applicants to YOUR company. All of a sudden the headline is:</p><blockquote><p><strong>X out of Y Applicants for Positions Advertised By My Company Can&#39;t Program</strong></p></blockquote><p>That&#39;s a whole lot less impressive/sensational and whole lot closer to reality. But, let us dig a little deeper. It&#39;s not just the one company, too many other people/companies have had the same pain. Which is perhaps why these posts receive so much attention. It&#39;s cathartic to have a bit of a whinge along with a bunch of other people who feel your pain :). My question for everyone is this, what makes your company so special? How much time did you spend making sure your ad was sufficiently attractive to the star developers and a sufficient deterrent to the crappy ones? I can tell you right now the fact that you&#39;re the &quot;<em>world&#39;s leading enterprise wodget provider</em>&quot;, the latest &quot;<em>well-funded social startup</em>&quot; or pay &quot;<em>above industry rates</em>&quot;, is not going to bring the coding elite knocking on your door. I guess it comes down to this, <strong>if you try to attract talent in a generic fashion you will attract a generic response</strong>, meaning that there is a decent chance your 200 applicants were ALL a bunch of discards.</p><h2>Blame Your Interview Process First</h2><p>Go back to <a
href="http://www.joelonsoftware.com/items/2005/01/27.html" target="_blank">that article of Joel&#39;s</a> that I mentioned above where he talks about the 199 useless programmers who apply for every job thereby inflating the applicant numbers. I don&#39;t think those 199 wannabe programmers exist, I think the pool is much larger. There is a whole bunch of, let&#39;s call them &quot;<em>aspiring programmers</em>&quot; who are totally crap and either can&#39;t get a job or can&#39;t keep one, which doesn&#39;t stop the from trying. A significant percentage of your applicants are those guys and yeah they can&#39;t program, but then again I wouldn&#39;t really call them &quot;<em>programmers</em>&quot; either. It wouldn&#39;t take long to get discouraged and cynical about the whole industry when dealing with those guys for days on end. But let&#39;s say you can screen all those out via resumes or whatever and only end up with seemingly legitimate applicants, how come so many of those can&#39;t code their way out of a paper bag?</p><p>Firstly, you didn&#39;t really screen all the discards out via the resumes, that&#39;s not possible, <strong>I&#39;ve seen some highly impressive resumes from some highly unimpressive people</strong>. All our stats are already suspect at this point, but let&#39;s plow on anyway. Likely the next course of action is to screen further via phone or face-to-face or both. We ask simple <a
href="http://www.skorks.com/2010/03/how-to-answer-a-programming-interview-question-and-look-good-doing-it/" target="_blank">coding questions</a> like the <a
href="http://www.skorks.com/2010/04/a-fizzbuzz-faux-pas/" target="_blank">fizzbuzz</a>, but our applicants still fail &#8211; even ones that shouldn&#39;t:</p><blockquote><p>&quot;Here is the question that the vast majority of candidates are unable to successfully solve, even in half an hour, even with a lot of nudging in the right direction:</p><p><em>Write a C function that reverses a singly-linked list. <br
/> </em></p><p>That&rsquo;s it. We&rsquo;ve turned away people with incredibly impressive resumes (including kernel developers, compiler designers, and many a Ph.D. candidate)&#8230;&quot;</p></blockquote><p>That&#39;s from <a
href="http://www.rethinkdb.com/blog/2010/06/will-the-real-programmers-please-stand-up/" target="_blank">the RethinkDB post</a> that I also mentioned above (I<em> am not picking on the RethinkDB guys, it is just conveniently the latest post on the subject that I have read :)</em>). Kernel developers, and Ph.Ds can&#39;t reverse a list? That seems entirely unlikely. Perhaps it is not the people who are to blame but the process. We have learned, especially over the last few years that it is often the process that prevents a software team from being productive. These days most teams would cast a critical eye towards their process when looking for causes of dysfunction, before they start pointing fingers at each other. So, why not cast the same critical eye towards the interview process? Perhaps the objectives of the interview are unclear, or you&#39;re not communicating well enough, or you&#39;re using the wrong medium for what you&#39;re trying to achieve (<em>e.g. coding over the phone</em>), or you didn&#39;t prepare thoroughly enough as an interviewer added to the probable unpreparedness of the interviewee (<em>this chronic unpreparedness is endemic in our industry and <a
href="http://feeds.feedburner.com/softwaretechandmore">deserves a post of it&#39;s own</a></em>). Sounds like the same kind of issues that cause software projects to go off the rails :). My point is, <strong>it is not necessarily the fact that the candidate is crappy it could be that you&#39;re just doing it wrong</strong>.</p><h2>Just Because It Makes Us Feel Good Doesn&#39;t Make It True</h2><p>As I was thinking about all this stuff I found myself referring to the X out of Y &quot;<em>statistics</em>&quot; as &quot;<em>feel-good numbers</em>&quot; because they make us all feel good about ourselves. I mean, it&#39;s pretty sad for the 99 out of 100 poor schlubs, but not you and me &#8211; we are coding ninjas. How does it feel to be special :)? Somehow though I don&#39;t reckon there are 99 working programmers sitting there reading those posts thinking &quot;<em>&#8230;yeah I am a bit of a failure, I wish I was one of those 1 in a 100 dudes</em>&quot;. As a decent programmer, look around yourself. <strong>Can you really honestly say the vast majority of the developers you&#39;re working with have trouble with loops or basic arithmetic</strong>? If you can, I fail to see how your company can produce any kind of working software and why are you hanging around that place anyway, it surely is not healthy for your career not to mention your sanity.</p><p>If you&#39;ve read anything I&#39;ve written before, you know that I am not one to shy away from a generalisation, but in this case I believe it gives a skewed picture that needlessly makes the whole industry look bad. There is no denying that lack of skill can be a problem in software, but then again this is one of the few professional disciplines where you can read a book and &quot;<em>wham bam thank you ma&#39;am</em>&quot;, you&#39;re a programmer, or at least think that you are (<em>and might even be able to find work if someone is desperate/stupid enough and you&#39;re smooth enough</em>). Try doing the same thing in the medical profession or law, or accounting. This is one of the problems that is unique to IT (<em>other industries have their own</em>), we deal with it to the best of our ability. This issue will always make the hiring process difficult, which makes it doubly as important to think long and hard about how to attract decent people and tweak your interview process to make sure you&#39;re getting what you need out of it. And yes it will be time consuming and difficult and will make you feel like you&#39;re wasting time instead of doing &quot;<em>real work</em>&quot;, but then again you know what the other side of the coin is.</p><p><span
style="font-size: 10px; font-family: trebuchet ms;">Image by <a
href="http://www.flickr.com/photos/nitot/3640230349/" target="_blank">nitot</a></span></p><p><strong>Related posts:</strong><ol><li><a
href='http://www.skorks.com/2009/09/the-best-way-to-interview-a-developer/' rel='bookmark' title='The Best Way To Interview A Developer'>The Best Way To Interview A Developer</a></li><li><a
href='http://www.skorks.com/2010/02/high-academic-results-make-better-programmers/' rel='bookmark' title='High Academic Results Make Better Programmers'>High Academic Results Make Better Programmers</a></li><li><a
href='http://www.skorks.com/2010/05/how-to-be-a-real-elite-programmer-and-make-sure-everybody-knows-it/' rel='bookmark' title='How To Be A Real Elite Programmer And Make Sure Everybody Knows It'>How To Be A Real Elite Programmer And Make Sure Everybody Knows It</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.skorks.com/2010/10/99-out-of-100-programmers-cant-program-i-call-bullshit/feed/</wfw:commentRss> <slash:comments>58</slash:comments> </item> <item><title>You Don&#8217;t Need Math Skills To Be A Good Developer But You Do Need Them To Be A Great One</title><link>http://www.skorks.com/2010/03/you-dont-need-math-skills-to-be-a-good-developer-but-you-do-need-them-to-be-a-great-one/</link> <comments>http://www.skorks.com/2010/03/you-dont-need-math-skills-to-be-a-good-developer-but-you-do-need-them-to-be-a-great-one/#comments</comments> <pubDate>Tue, 23 Mar 2010 13:41:48 +0000</pubDate> <dc:creator>Alan Skorkin</dc:creator> <category><![CDATA[Developers]]></category> <category><![CDATA[math]]></category> <category><![CDATA[opinion]]></category> <guid
isPermaLink="false">http://www.skorks.com/?p=1549</guid> <description><![CDATA[A little while ago I started thinking about math. You see, I&#39;ve been writing software for quite a few years now and to be totally honest, I haven&#39;t yet found a need for math in my work. There has been plenty of new stuff I&#39;ve had to learn/master, languages, frameworks, tools, processes, communication skills and [...]
<strong>Related posts:</strong><ol><li><a
href='http://www.skorks.com/2010/03/the-difference-between-a-developer-a-programmer-and-a-computer-scientist/' rel='bookmark' title='The Difference Between A Developer, A Programmer And A Computer Scientist'>The Difference Between A Developer, A Programmer And A Computer Scientist</a></li><li><a
href='http://www.skorks.com/2011/02/the-greatest-developer-fallacy-or-the-wisest-words-youll-ever-hear/' rel='bookmark' title='The Greatest Developer Fallacy Or The Wisest Words You&#8217;ll Ever Hear?'>The Greatest Developer Fallacy Or The Wisest Words You&#8217;ll Ever Hear?</a></li><li><a
href='http://www.skorks.com/2009/09/the-best-way-to-interview-a-developer/' rel='bookmark' title='The Best Way To Interview A Developer'>The Best Way To Interview A Developer</a></li></ol>]]></description> <content:encoded><![CDATA[<p></p><p><img
align="left" alt="Math" class="alignleft size-full wp-image-1555" height="283" hspace="20" src="http://www.skorks.com/wp-content/uploads/2010/03/math.jpg" style="width: 274px; height: 283px;" title="Math" vspace="5" width="274" />A little while ago I started thinking about math. You see, I&#39;ve been writing software for quite a few years now and to be totally honest, I <a
href="http://www.robbyonrails.com/articles/2008/01/01/advanced-mathematics-and-programming" target="_blank">haven&#39;t yet found a need for math</a> in my work. There has been plenty of new stuff I&#39;ve had to learn/master, languages, frameworks, tools, processes, communication skills and library upon library of stuff to do just about anything you can think of; math hasn&#39;t been useful for any of it. Of course this is not surprising, the vast majority of the work I&#39;ve been doing has been <a
href="http://en.wikipedia.org/wiki/Create,_read,_update_and_delete" target="_blank">CRUD</a> in one form or another, that&#39;s the vast majority of the work most developers do in these interweb times of ours. You do consulting &#8211; <strong>you mostly build websites</strong>, you work for a large corporates &#8211; mostly build websites, you freelance &#8211; you mostly build websites. I am well aware that I am generalising quite a bit, but do bear with me, I am going somewhere.</p><p>Eventually you get a little tired of it, as I did. Don&#39;t get me wrong it can be fun and challenging work, providing opportunities to solve problems and interact with interesting people &#8211; I am happy to do it during work hours. But the thought of building yet more websites in my personal time has somewhat lost its luster &#8211; you begin to look for something more interesting/cool/fun, as &#8211; once again &#8211; I did. Some people gravitate to front-end technologies and graphical things &#8211; visual feedback is seductive &#8211; I was not one of them (<em>I love a nice front-end as much as the next guy, but it doesn&#39;t really excite me</em>), which is why, when I was confronted with some search-related problems I decided to dig a little further. And this brings me back to the start of this story because as soon as I grabbed the first metaphorical shovel-full of search, I ran smack-bang into some math and realized exactly just how far my skills have deteriorated. Unlike riding a bike &#8211; you certainly do forget (<em>although I haven&#39;t ridden a bike in years so maybe you forget that too :)</em>).</p><h2>Broadening Horizons</h2><p>Learning a little bit about search exposed me to all sorts of interesting software-y and computer science-y related things/problems (<em>machine learning, natural language processing, algorithm analysis etc.</em>) and now everywhere I turn I see math and so feel my lack of skills all the more keenly. I&#39;ve come to the realization that you need a decent level of math skill if you want to do cool and interesting things with computers. Here are some more in addition to the ones I already mentioned &#8211; cryptography, games AI, compression, genetic algorithms, 3d graphics etc. You need math to understand the theory behind these fields which you can then apply if you want to write those libraries and tools that I was talking about &#8211; rather than<a
href="http://agnosticcoder.com/2010/03/is-your-job-title-relevant-mine-is-im-a-software-mechanic/" target="_blank"> just use them</a> (<em>be a <a
href="http://en.wikipedia.org/wiki/Producer-consumer_problem" target="_blank">producer rather than just a consumer</a> &#8211; to borrow an OS metaphor :)</em>). And even if you don&#39;t want to write any libraries, <strong>it makes for a much more satisfying time building software, when you really understand what makes things tick</strong>, rather than just plugging them in and hoping they do whatever the hell they&#39;re supposed to.</p><p>The majority of developers will tell you that they&#39;ve <a
href="http://4.flowsnake.org/archives/108" target="_blank">never needed math for their work</a> (<em>like I did a couple of paragraphs above :)</em>), but after musing on it for a while, I had a though. What we might have here is a <strong>reverse <a
href="http://en.wikipedia.org/wiki/Law_of_the_instrument" target="_blank">Maslow&#39;s hammer</a></strong> problem. You know the one &#8211; when you have a hammer, everything looks like a nail. It is a metaphor for using a favourite tool even when it may not be best for the job at hand. Math is our hammer in reverse. We know the hammer exists but don&#39;t quite know how to use it, so even when we meet a problem where our hammer would be the perfect tool, we never give it serious consideration. The screwdriver was good enough for my granddaddy, it was good enough for my daddy and it is good enough for me, who needs a hammer anyway? The trick with math is &#8211; people are afraid of it &#8211; even most programmers, you&#39;d think we wouldn&#39;t be, but we are. So, we turn our words into a self-fulfilling prophecy. It&#39;s not that I don&#39;t need math for my work it&#39;s just that I don&#39;t really know it and even if I do, I don&#39;t know how to apply it. So I get by without it and when you make-do without something for long enough, after a while you don&#39;t even notice it&#39;s missing and so need it even less &#8211; self-fulfilling prophecy.</p><p>Here is some food for thought about something close to all our hearts &#8211; learning new skills. As a developer in the corporate world, you strive to be a generalizing specialist (<em><a
href="http://www.amazon.com/Passionate-Programmer-Remarkable-Development-Pragmatic/dp/1934356344/ref=pd_sim_b_3" target="_blank">read this book</a> if you don&#39;t know what I am talking about</em>). You try to be decent at most things and really good at some. But what do you specialize in? Normally people choose a framework or two and a programming language and go with that, which is fine and worthwhile. But consider the fact that frameworks and to a lesser extent languages have a limited shelf life. If you&#39;re building a career on being a Hibernate, <a
href="http://rubyonrails.org/" target="_blank">Rails</a> or Struts expert (<em>the struts guys should really be getting worried now :)</em>), <strong>you will have to rinse and repeat all over again in a few years when new frameworks come along to supersede the current flavour of the month</strong>. So is it really the best investment of your time &#8211; maybe, but then again maybe not. Math, on the other hand is not going away any time soon. Everything we do in our field is built upon solid mathematical principles at its root (<em>algorithms and data structures being a case in point</em>), so time spent keeping up your math skills is arguably never wasted. And it, once again, comes down to really understanding something rather than just using it by rote &#8211; math can help you understand everything you do more deeply, when it comes to computers. Infact, as <a
href="http://steve-yegge.blogspot.com/2006/03/math-for-programmers.html" target="_blank">Steve Yegge said</a>, what we do as programmers is so much like math we don&#39;t even realise it.</p><h2>What/Who Makes A Difference</h2><p
style="text-align: center;"><img
align="middle" alt="Knuth" class="aligncenter size-full wp-image-1556" height="256" src="http://www.skorks.com/wp-content/uploads/2010/03/knuth.jpg" style="width: 170px; height: 256px;" title="Knuth" vspace="5" width="170" /></p><p>You don&#39;t believe me, then consider this. Most of the<strong> people who are almost universally respected&nbsp; in our field as great programmers are also great mathematicians</strong>. I am talking people like <a
href="http://en.wikipedia.org/wiki/Donald_Knuth" target="_blank">Donald Knuth</a>, <a
href="http://en.wikipedia.org/wiki/Edsger_W._Dijkstra" target="_blank">Edsger W. Dijkstra</a>, <a
href="http://en.wikipedia.org/wiki/Noam_Chomsky" target="_blank">Noam Chomsky</a>, <a
href="http://norvig.com/" target="_blank">Peter Norvig</a>. But then again these guys weren&rsquo;t really developers, they were <a
href="http://www.skorks.com/2010/03/the-difference-between-a-developer-a-programmer-and-a-computer-scientist/" target="_blank">computer scientists</a>, so it doesn&#39;t really count right? I guess, but then again, maybe we shouldn&#39;t really talk until our output in pure lines of code even begins to approach 10% of what these people have produced. Of course, you can be successful and famous without being a <a
href="http://en.wikipedia.org/wiki/Boffin" target="_blank">boffin</a>, everyone has heard of <a
href="http://en.wikipedia.org/wiki/Hibernate_%28Java%29" target="_blank">Gavin King</a> or <a
href="http://www.loudthinking.com/" target="_blank">DHH</a>. That&#39;s kinda true (<em>although it&#39;s an arguable point whether or not many people have heard of Gavin or DHH outside their respective niches</em>), but &quot;heard of&quot; and universally respected are different things, about as different as creating a framework and significantly advancing the sum-total of human knowledge in your field (<em>don&#39;t get me wrong, I respect Gavin And David, they&#39;ve done a hell of a lot more than I have, but that doesn&#39;t make what I said any less of a fact</em>). How is all of this relevant? I dunno, it probably isn&#39;t, but I thought I&#39;d throw it in there anyway since we&#39;re being introspective and all.</p><p>The world is getting filled up with data, there is more and more of it every day and whereas before we had the luxury of working with relatively small sets of it, these days the software we write must operate efficiently with enormous data sets. This is increasingly true even in the corporate world. What this means is that you will be less and less likely to be able to just &quot;<em>kick things off</em>&quot; to see how they run, because with the amount of data you&#39;ll be dealing with it will just grind to a halt unless you&#39;re smart about it. My prediction is that algorithm analysis will become increasingly important for the lay-programmer, not that it wasn&#39;t before, but it will become more so. And what do you need to be a decent <a
href="http://en.wikipedia.org/wiki/Algorist" target="_blank">algorist</a> &#8211; you guessed it, some math skills.</p><p>So, what about me? Well, <strong>I&#39;ve decided to build up/revive my math skills a little bit at a time</strong>, there are still plenty of books to read and code to write, but I will try to devote a little bit of my time to math at least once in a while, because like exercise, a little bit once in a while, is better than nothing (<em>to quote <a
href="http://steve-yegge.blogspot.com/2006/03/math-for-programmers.html" target="_blank">Steve Yegge</a> yet again</em>). Of course I have a bit of an ace up my sleeve when it comes to math, which is good for me, but luckily with this blog, we might all benefit (<em>I know you&#39;re curious, I&#39;ll <a
href="http://feeds.feedburner.com/softwaretechandmore">tell you about it soon</a> :)</em>).</p><h2>Where Do You See Yourself In 5 Years</h2><p
style="text-align: center;"><img
align="middle" alt="Wakeboarding" class="aligncenter size-full wp-image-1557" height="207" src="http://www.skorks.com/wp-content/uploads/2010/03/wakeboarding.jpg" style="width: 311px; height: 207px;" title="Wakeboarding" vspace="5" width="311" /></p><p>So, is all this math gonna be good for anything? It&#39;s hard to say in advance, I am pretty happy with where I am at right now and so might you be, but it&#39;s all about potential. End of the day, <strong>if you&#39;re a developer in the corporate world you don&#39;t really need any math</strong>. If you&#39;re happy to go your entire career doing enterprise CRUD apps during work hours and paragliding or wakeboarding (<em>or whatever trendy &#39;sport&#39; the geeky in-crowd is into these days</em>) during your off time then by all means, invest some more time into <a
href="http://www.springsource.org/documentation" target="_blank">Spring</a> or <a
href="http://www.hibernate.org/" target="_blank">Hibernate</a> or Visual Studio or whatever. It will not really limit your potential in that particular niche; you can become extremely valuable &#8211; even sought after. But if you strive for diversity in your career and want to have the ability to try your hand at almost any activity that involves code, from <a
href="http://en.wikipedia.org/wiki/Information_retrieval" target="_blank">information retrieval</a> to Linux kernel hacking. In short if you want to be a perfect mix of <a
href="http://www.skorks.com/2010/03/the-difference-between-a-developer-a-programmer-and-a-computer-scientist/" target="_blank">developer, programmer and computer scientist</a>, you have to make sure you math skills are up to scratch (<em>and hell, you can still go wakeboarding if you really want :)</em>). Long story short, if you grok math, there are no doors that are closed to you in the software development field, if you don&#39;t &#8211; it&#39;s going to be all CRUD (<em>pun intended</em>)!</p><p><span
style="font-size: 10px; font-family: trebuchet ms;">Images by <a
href="http://www.flickr.com/photos/b3ni/3447971905/" target="_blank">Beni Ishaque Luthor</a>, <a
href="http://www.flickr.com/photos/scottlaird/85124165/" target="_blank">Scott Laird</a> and <a
href="http://www.flickr.com/photos/arturodonate/2343027570/" target="_blank">arturodonate</a></span></p><p><strong>Related posts:</strong><ol><li><a
href='http://www.skorks.com/2010/03/the-difference-between-a-developer-a-programmer-and-a-computer-scientist/' rel='bookmark' title='The Difference Between A Developer, A Programmer And A Computer Scientist'>The Difference Between A Developer, A Programmer And A Computer Scientist</a></li><li><a
href='http://www.skorks.com/2011/02/the-greatest-developer-fallacy-or-the-wisest-words-youll-ever-hear/' rel='bookmark' title='The Greatest Developer Fallacy Or The Wisest Words You&#8217;ll Ever Hear?'>The Greatest Developer Fallacy Or The Wisest Words You&#8217;ll Ever Hear?</a></li><li><a
href='http://www.skorks.com/2009/09/the-best-way-to-interview-a-developer/' rel='bookmark' title='The Best Way To Interview A Developer'>The Best Way To Interview A Developer</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.skorks.com/2010/03/you-dont-need-math-skills-to-be-a-good-developer-but-you-do-need-them-to-be-a-great-one/feed/</wfw:commentRss> <slash:comments>108</slash:comments> </item> <item><title>Downgrading A Ubuntu Package</title><link>http://www.skorks.com/2009/07/downgrading-a-ubuntu-package/</link> <comments>http://www.skorks.com/2009/07/downgrading-a-ubuntu-package/#comments</comments> <pubDate>Tue, 14 Jul 2009 08:19:54 +0000</pubDate> <dc:creator>Alan Skorkin</dc:creator> <category><![CDATA[Developers]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[java]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[ubuntu]]></category> <guid
isPermaLink="false">http://www.skorks.com/?p=784</guid> <description><![CDATA[Here is the summarized version of how to downgrade a Ubuntu package
<strong>Related posts:</strong><ol><li><a
href='http://www.skorks.com/2009/08/installing-and-using-java-on-ubuntu/' rel='bookmark' title='What Everybody Should Know About Installing And Using Java On Ubuntu'>What Everybody Should Know About Installing And Using Java On Ubuntu</a></li><li><a
href='http://www.skorks.com/2009/08/partitioning-your-hard-drive-during-a-linux-install/' rel='bookmark' title='Partitioning Your Hard Drive During A Linux Install'>Partitioning Your Hard Drive During A Linux Install</a></li><li><a
href='http://www.skorks.com/2008/08/java-and-net-taking-on-contenders-and-winning/' rel='bookmark' title='Java and .Net Taking On Contenders And Winning'>Java and .Net Taking On Contenders And Winning</a></li></ol>]]></description> <content:encoded><![CDATA[<p></p><p>I was recently upgrading a couple of Ubuntu machines to the latest and greatest everything. It&#8217;s good to be up-to-date makes me feel like a no-nonsense, can-do developer :). Anyways one of the latest and greatest things that Ubuntu pulled in for me was the latest java 6 (JDK 1.6.0_14). All of a sudden my build started failing with strange coverage errors &#8211; I hate it when that happens. After looking around for a bit I found that there was a Cobertura issue with java 1.6.0_14, <a
href="http://jira.codehaus.org/browse/MCOBERTURA-101" target="_blank">this one</a>. So I though I&#8217;d try and downgrade Java 6 to the previous version (who needs to be fully up-to-date anyway, that stuff is for the birds, the real hardcore developers use the penultimate version, yeah!).</p><p>This of course was easier said than done, Ubuntu doesn&#8217;t really like it when you try to downgrade stuff. I thought that if I could obtain, or create, a debian package with the version of java that I was after I might just be able to manually install that one (yeah that might work). I was wrong, I did get my hands on the debian package that I needed, but Ubuntu spewed out some gaff about dependencies and &#8230; long story short, it didn&#8217;t work. Of course I could always forgo the use of the package manager and just manually install java and set up the PATH and JAVA_HOME and so forth but that would make me feel a little unclean so I thought I&#8217;d persist and do things the <span
style="text-decoration: line-through;">easy </span>hard way.</p><p>Eventually (after searching around for ages and eating 2 pieces of candy &#8211; Vicks VapoDrops &#8211; good for the throat) I found a nice Ubuntu forum thread about how to downgrade a package (<a
href="http://ubuntuforums.org/showthread.php?t=321156" target="_blank">this one</a>), so here is the summarised version of how to downgrade a Ubuntu package &#8211; more specifically my java 6.</p><p>Firstly, we need to find what lower versions of our package are available to us, we use the following command:</p><p
style="background-color:#F2F2F2; border-style:inset;border-width:2px;"><strong><code>apt-cache showpkg sun-java6-jdk</code></strong></p><p>This will produce output similar to the following:</p><p
style="background-color:#F2F2F2; border-style:inset;border-width:2px;"><code><br
/> Package: sun-java6-jdk<br
/> Versions:<br
/> 6-14-0ubuntu1.9.04 (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_jaunty-proposed_multiverse_binary-amd64_Packages) (/var/lib/dpkg/status)<br
/> Description Language:<br
/> File: /var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_jaunty-proposed_multiverse_binary-amd64_Packages<br
/> MD5: cb47d4c49fa7317c472613b7010ef9d8<br
/> 6-13-1 (/var/lib/apt/lists/au.archive.ubuntu.com_ubuntu_dists_jaunty_multiverse_binary-amd64_Packages)<br
/> Description Language:<br
/> File: /var/lib/apt/lists/au.archive.ubuntu.com_ubuntu_dists_jaunty_multiverse_binary-amd64_Packages<br
/> MD5: cb47d4c49fa7317c472613b7010ef9d8<br
/> Reverse Depends:<br
/> sun-java6-source,sun-java6-jdk 6-14-0ubuntu1.9.04<br
/> sun-java6-javadb,sun-java6-jdk 6-14-0ubuntu1.9.04<br
/> sun-java6-demo,sun-java6-jdk<br
/> sun-java6-demo,sun-java6-jdk 6-14-0ubuntu1.9.04<br
/> libnb-java2-java,sun-java6-jdk<br
/> libnb-java2-java,sun-java6-jdk<br
/> sun-java6-source,sun-java6-jdk 6-13-1<br
/> sun-java6-javadb,sun-java6-jdk 6-13-1<br
/> sun-java6-demo,sun-java6-jdk<br
/> sun-java6-demo,sun-java6-jdk 6-13-1<br
/> glassfishv2-bin,sun-java6-jdk<br
/> glassfishv2,sun-java6-jdk<br
/> Dependencies:<br
/> 6-14-0ubuntu1.9.04 - sun-java6-bin (5 6-14-0ubuntu1.9.04) libc6 (0 (null)) libx11-6 (0 (null)) debconf (18 0.5) debconf-2.0 (0 (null)) sun-java6-demo (0 (null)) sun-java6-doc (0 (null)) sun-java6-source (0 (null))<br
/> 6-13-1 - sun-java6-bin (5 6-13-1) libc6 (0 (null)) libx11-6 (0 (null)) debconf (18 0.5) debconf-2.0 (0 (null)) sun-java6-demo (0 (null)) sun-java6-doc (0 (null)) sun-java6-source (0 (null))<br
/> Provides:<br
/> 6-14-0ubuntu1.9.04 - java6-sdk java5-sdk java2-sdk java2-compiler java-sdk java-compiler<br
/> 6-13-1 - java6-sdk java5-sdk java2-sdk java2-compiler java-sdk java-compiler<br
/> Reverse Provides:<br
/> </code></p><p>There are two versions available in the repository. As we can see the java version we are looking for (6-13-1) is here. However it is worth noting that had we wanted to downgrade several versions back, we would be out of luck as older versions are no longer in the repository.</p><p>Now that we see the version that we want we need to do the following to downgrade:</p><p
style="background-color:#F2F2F2; border-style:inset;border-width:2px;"><strong><code>sudo aptitude install sun-java6-jdk=6-13-1</code></strong></p><p>This will produce something along the lines of:</p><p
style="background-color:#F2F2F2; border-style:inset;border-width:2px;"><code><br
/> Reading package lists... Done<br
/> Building dependency tree<br
/> Reading state information... Done<br
/> Reading extended state information<br
/> Initializing package states... Done<br
/> The following packages are BROKEN:<br
/> sun-java6-jdk<br
/> 0 packages upgraded, 0 newly installed, 1 downgraded, 0 to remove and 2 not upgraded.<br
/> Need to get 17.7MB of archives. After unpacking 1925kB will be freed.<br
/> The following packages have unmet dependencies:<br
/> sun-java6-jdk: Depends: sun-java6-bin (= 6-13-1) but 6-14-0ubuntu1.9.04 is installed.<br
/> The following actions will resolve these dependencies:<br
/> Remove the following packages:<br
/> sun-java6-fonts<br
/> sun-java6-plugin<br
/> Downgrade the following packages:<br
/> sun-java6-bin [6-14-0ubuntu1.9.04 (jaunty-proposed, now) -&gt; 6-13-1 (jaunty)]<br
/> sun-java6-jre [6-14-0ubuntu1.9.04 (jaunty-proposed, now) -&gt; 6-13-1 (jaunty)]<br
/> Score is 188<br
/> Accept this solution? [Y/n/q/?]  Y<br
/> The following packages will be DOWNGRADED:<br
/> sun-java6-bin sun-java6-jdk sun-java6-jre<br
/> The following packages will be REMOVED:<br
/> sun-java6-fonts{a} sun-java6-plugin{a}<br
/> 0 packages upgraded, 0 newly installed, 3 downgraded, 2 to remove and 2 not upgraded.<br
/> Need to get 50.7MB of archives. After unpacking 4096kB will be freed.<br
/> Do you want to continue? [Y/n/?] Y<br
/> </code></p><p>If we now run:</p><p
style="background-color:#F2F2F2; border-style:inset;border-width:2px;"><code>java -version</code></p><p>We get:</p><p
style="background-color:#F2F2F2; border-style:inset;border-width:2px;"><code>java version "1.6.0_13"<br
/> Java(TM) SE Runtime Environment (build 1.6.0_13-b03)<br
/> Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02, mixed mode)</code></p><p>Which is the downgraded java that we were after, sweet!</p><p><strong>Related posts:</strong><ol><li><a
href='http://www.skorks.com/2009/08/installing-and-using-java-on-ubuntu/' rel='bookmark' title='What Everybody Should Know About Installing And Using Java On Ubuntu'>What Everybody Should Know About Installing And Using Java On Ubuntu</a></li><li><a
href='http://www.skorks.com/2009/08/partitioning-your-hard-drive-during-a-linux-install/' rel='bookmark' title='Partitioning Your Hard Drive During A Linux Install'>Partitioning Your Hard Drive During A Linux Install</a></li><li><a
href='http://www.skorks.com/2008/08/java-and-net-taking-on-contenders-and-winning/' rel='bookmark' title='Java and .Net Taking On Contenders And Winning'>Java and .Net Taking On Contenders And Winning</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.skorks.com/2009/07/downgrading-a-ubuntu-package/feed/</wfw:commentRss> <slash:comments>12</slash:comments> </item> <item><title>Are You Actually A Post-Agilist?</title><link>http://www.skorks.com/2008/10/are-you-actually-a-post-agilist/</link> <comments>http://www.skorks.com/2008/10/are-you-actually-a-post-agilist/#comments</comments> <pubDate>Tue, 14 Oct 2008 11:31:25 +0000</pubDate> <dc:creator>Alan Skorkin</dc:creator> <category><![CDATA[Agile]]></category> <category><![CDATA[Developers]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[developers]]></category> <category><![CDATA[process]]></category> <category><![CDATA[programming]]></category> <guid
isPermaLink="false">http://www.skorks.com/?p=738</guid> <description><![CDATA[Have you heard the term post-Agile. Post-Agilism is basically a movement in the software development community of people who see themselves as moving beyond Agile methods. To me it means avoiding process and practice purism and trying to get back to the core agile spirit. What does it mean to you, do you see yourself as a post-Agilist?
<strong>Related posts:</strong><ol><li><a
href='http://www.skorks.com/2009/03/the-current-state-of-the-agile-nation-agile-process-adoption/' rel='bookmark' title='The Current State Of The Agile Nation &#8211; Agile Process Adoption'>The Current State Of The Agile Nation &#8211; Agile Process Adoption</a></li><li><a
href='http://www.skorks.com/2009/09/rules-of-standup-you-dont-need-to-justify-your-own-existence/' rel='bookmark' title='Rules Of Standup &#8211; You Don&#8217;t Need To Justify Your Own Existence'>Rules Of Standup &#8211; You Don&#8217;t Need To Justify Your Own Existence</a></li><li><a
href='http://www.skorks.com/2008/09/the-real-measure-of-code-quality/' rel='bookmark' title='The Real Measure Of Code Quality'>The Real Measure Of Code Quality</a></li></ol>]]></description> <content:encoded><![CDATA[<p></p><p>Have you heard that term? I happened upon it purely by accident about a year ago and after reading and learning a bit about it I found that I could identify with it quite a bit. You can read Jason Gorman’s post <a
title="Post-Agilism Explained" href="http://parlezuml.com/blog/?postid=407" target="_blank">Post-Agilism Explained (Pretentiously)</a> as well as Jonathan Kohl&#8217;s massive post &#8211; <a
title="Post-Agilism Frequently Asked Questions" href="http://www.kohl.ca/blog/archives/000184.html" target="_blank">Post-Agilism Frequently Asked Questions</a> for a great discussion of what the post-Agile movement is all about. Jonathan and Jason independently coined the term at about the same time so they are an authority on the term if anyone is. I am going to attempt to give my humble views on the topic and hopefully you will identify with some of what I say.</p><p>For those of you who’ve decided to learn about post-Agilism after they finish reading this post (thanks!), post-Agilism is basically a movement in the software development community of people who see themselves as moving beyond Agile methods. They have used Agile and not-so-agile methodologies and have moved beyond both to using an amalgamation of tools and methods that best facilitate them doing their job. Post-Agilism is not about evangelizing a particular process or a set of practices or even the Agile Manifesto, it is about getting to the core of the issues that process in general tries to address and solving them in the best ways possible. At least, this is the way I see it.</p><p>Post-Agilism is not about rejecting the Agile practices, it is about not limit yourself by Agile practices. I think the original spirit of the Agile movement has now become the spirit of the post-Agile movement as Agile is becoming less about the spirit and more about pushing a particular Agile process as the best one (there are so many to choose from now). At first it was Agile vs heavyweight; now it is still that, but it is also Agile vs Agile (we are an XP team we are the best, no we are clearly superior for we are a Scrum team!).</p><p>I for one get extremely annoyed sometimes at process vs process discussion (be they Agile or not), I see them as completely pointless. One of the core ideas behind Agile which most often seems to be forgotten is the fact that you’re meant to adapt, to ‘bastardise’ the process and practices until you get something that works for you. This makes any kind of process/practice purist argument meaningless. This very agile idea of being adaptable, of chopping and changing to fit your needs is now also at the core of the post-Agile movement.</p><p>To me, the most important thing about a process is the ‘spirit’ of it, not the practices. Quite often these days Agile teams seem to loose sight of the agile spirit and I think the post-Agile movement is more about the spirit. When I say spirit I mean things like:</p><ul><li>respecting the individual</li><li>communicating effectively</li><li>doing work (writing code) that you could be proud of</li><li>not getting bogged down in minutiae</li><li>having some backbone when dealing with those around your team (i.e. stakeholders etc.)</li><li>etc.</li></ul><p>And all of these at the same time, not one by one.</p><p>If these sound suspiciously like the Agile Manifesto, they are meant to, the spirit of the Manifesto is very sound. If some of these sound strangely unlike the Agile Manifesto they are also meant to, the Manifesto is not the be-all, end-all of commandments that we live by.</p><p>This I think is also at the heart of the post-Agile movement, it is not about the process, it is not about the practices, it is about the spirit of agile, it is about the ideal. Use your knowledge to select the most appropriate tools, processes and practices, whatever they happen to be. There is no best length for an iteration, there is no best retro format, pick whatever works and discard it if it doesn’t, as long as you stay true to the ideal, you won’t go too far wrong.</p><p>Here is an example that might help make my meaning a little bit clearer. I’ve been interested in distributed Agile for a while now. So, what do you do if you ever find yourself working in a distributed environment with multiple teams that are not co-located? Trying to make the best of a bad situation while all the while moaning about how much better things would have been had the teams been located in the same place. That is NOT staying true to the agile spirit (alright, you can moan a little bit, good for the soul and all). Trying to find ways to effectively collaborate, to make things work better, to innovate solutions, to get to know the people on the other teams (rather than complaining about their ‘crappy’ code). That would be living up to the ideal, staying true to the spirit of agile, or post-Agile as the case may be.</p><p>I found myself in very strange territory of not being able to find the words to adequately get my point across with this post (I can usually express myself pretty well, and loudly, just ask anyone who knows me). Parts of this post seem overly existential to me while others just seem to tread over the same ground. I guess it comes from trying to express ideas that are almost subconscious for me. Hopefully this will have resonated with people on some level or at the very least given people some food for thought.</p><p>Perhaps some comments might help clarify matters for everyone. I’ve tried to explain my thoughts, so what does post-Agilism mean to you? Would you consider yourself a post-Agilist or are you still firmly in the Agile camp (or god-forbid, heavyweight)? Any relevant thoughts would be appreciated.</p><p><strong>Related posts:</strong><ol><li><a
href='http://www.skorks.com/2009/03/the-current-state-of-the-agile-nation-agile-process-adoption/' rel='bookmark' title='The Current State Of The Agile Nation &#8211; Agile Process Adoption'>The Current State Of The Agile Nation &#8211; Agile Process Adoption</a></li><li><a
href='http://www.skorks.com/2009/09/rules-of-standup-you-dont-need-to-justify-your-own-existence/' rel='bookmark' title='Rules Of Standup &#8211; You Don&#8217;t Need To Justify Your Own Existence'>Rules Of Standup &#8211; You Don&#8217;t Need To Justify Your Own Existence</a></li><li><a
href='http://www.skorks.com/2008/09/the-real-measure-of-code-quality/' rel='bookmark' title='The Real Measure Of Code Quality'>The Real Measure Of Code Quality</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.skorks.com/2008/10/are-you-actually-a-post-agilist/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Are You Using The Full Power Of Spring When Injecting Your Dependencies?</title><link>http://www.skorks.com/2008/10/are-you-using-the-full-power-of-spring-when-injecting-your-dependencies/</link> <comments>http://www.skorks.com/2008/10/are-you-using-the-full-power-of-spring-when-injecting-your-dependencies/#comments</comments> <pubDate>Tue, 07 Oct 2008 12:46:16 +0000</pubDate> <dc:creator>Alan Skorkin</dc:creator> <category><![CDATA[Developers]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[code]]></category> <category><![CDATA[dependency injection]]></category> <category><![CDATA[spring]]></category> <category><![CDATA[spring framework]]></category> <category><![CDATA[tutorial]]></category> <guid
isPermaLink="false">http://www.skorks.com/?p=715</guid> <description><![CDATA[Spring has some extremely powerful capabilities that allow you to do a lot more than just call constructors and setters when creating Spring beans and injecting dependencies. I am going to attempt to show you some ways that will allow you to create spring beans and inject dependencies in all sorts of different ways, which should let you get a lot more out of using Spring.
<strong>Related posts:</strong><ol><li><a
href='http://www.skorks.com/2010/04/ruby-access-control-are-private-and-protected-methods-only-a-guideline/' rel='bookmark' title='Ruby Access Control &#8211; Are Private And Protected Methods Only A Guideline?'>Ruby Access Control &#8211; Are Private And Protected Methods Only A Guideline?</a></li><li><a
href='http://www.skorks.com/2010/10/write-a-function-to-determine-if-a-number-is-a-power-of-2/' rel='bookmark' title='Write A Function To Determine If A Number Is A Power Of 2'>Write A Function To Determine If A Number Is A Power Of 2</a></li><li><a
href='http://www.skorks.com/2009/09/true-false-and-nil-objects-in-ruby/' rel='bookmark' title='True, False And Nil Objects In Ruby'>True, False And Nil Objects In Ruby</a></li></ol>]]></description> <content:encoded><![CDATA[<p></p><p>If you’re a serious Java (or possibly even .NET) developer you’ve most likely used the Spring Framework before for all you dependency injection needs. You therefore probably know that there are 2 common ways to inject dependencies into your spring beans:</p><ul><li>setter injection</li><li>constructor injection</li></ul><p>But, did you know that there is a lot more to it than that? Spring has some extremely powerful capabilities that allow you to do a lot more than just call constructors and setters when creating Spring beans and injecting dependencies.</p><p>I am going to attempt to show you some ways that will allow you to create spring beans and inject dependencies in all sorts of different ways, which should let you get a lot more out of using Spring. If you’re a Spring guru then you probably won’t get anything new out of this, however everyone else should hopefully learn something new and become a much more versatile Spring developer.</p><p><strong>Different Ways To Instantiate Beans And Inject Dependencies</strong></p><p>&#160;</p><p><u><em>The Standard Way</em></u></p><p>The simplest way is to create a bean with no dependencies using a default constructor:</p><div
class="wp_syntax"><div
class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;my.crazy.example.SampleBean&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;sampleBean&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div><p>To inject some dependencies we can use setter injection, constructor injection or a mix of both. If our <em>SampleBean</em> is:</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SampleBean
<span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">int</span> intValue<span style="color: #339933;">;</span>
   <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">float</span> floatValue<span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> SampleBean<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> value<span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      intValue <span style="color: #339933;">=</span> value<span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setIntValue<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> value<span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      intValue <span style="color: #339933;">=</span> value<span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setFloatValue<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">float</span> floatValue<span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">floatValue</span> <span style="color: #339933;">=</span> floatValue<span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>The Spring configuration could be something like:</p><div
class="wp_syntax"><div
class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;my.crazy.example.SampleBean&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;sampleBean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;constructor-arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;25&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;0.57&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;floatValue&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div><p>All pretty standard stuff, on to more interesting things we go.</p><p>&#160;</p><p><u><em>Using A Static Factory Method</em></u></p><p>We can use the &#8216;factory-method&#8217; attribute to tell spring to call a static factory method to instantiate our bean. So, if we have a <em>SampleBean</em>:</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SampleBean
<span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">public</span> SampleBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>and a <em>SampleBeanFactory</em> with a static method:</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SampleBeanFactory
<span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> SampleBean createEmptySampleBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> SampleBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>we can do the following:</p><div
class="wp_syntax"><div
class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;sampleBean&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;my.crazy.example.SampleBeanFactory&quot;</span> </span>
<span style="color: #009900;">                            <span style="color: #000066;">factory-method</span>=<span style="color: #ff0000;">&quot;createEmptySampleBean&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div><p>This will only create a simple bean with no dependencies and what if we want to pass parameters to our factory method? Simple, if our <em>SampleBean</em> is now:</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SampleBean
<span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">int</span> intValue<span style="color: #339933;">;</span>
   <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">float</span> floatValue<span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> SampleBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setIntValue<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> value<span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      intValue <span style="color: #339933;">=</span> value<span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setFloatValue<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">float</span> floatValue<span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">floatValue</span> <span style="color: #339933;">=</span> floatValue<span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>and our <em>SampleBeanFactory</em> is:</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SampleBeanFactory
<span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> SampleBean createSampleBeanWithIntValue<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> value<span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      SampleBean sampleBean <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SampleBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      sampleBean.<span style="color: #006633;">setIntValue</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">return</span> sampleBean<span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>We can create a bean in the following way:</p><div
class="wp_syntax"><div
class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;sampleBean&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;my.crazy.example.SampleBeanFactory&quot;</span> </span>
<span style="color: #009900;">                          <span style="color: #000066;">factory-method</span>=<span style="color: #ff0000;">&quot;createSampleBeanWithIntValue&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;constructor-arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;25&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;floatValue&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;0.57&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div><p>The constructor arguments will be passed as parameters to our static factory method and the property elements will be set on the <em>SampleBean</em>. Obviously you can&#8217;t use setter injection to inject parameters into the factory method and you can&#8217;t use constructor injection to inject dependencies into the <em>SampleBean</em>.</p><p>You can see how this would come in useful, especially if you&#8217;re working with existing code that you can&#8217;t change that uses static factory methods to create objects. You can now wire in objects created by static factory methods as spring dependencies. But what if the factory methods are not static, but still create objects that you want to wire in?</p><p>&#160;</p><p><u><em>Using An Instance Factory Method</em></u></p><p>We can use the &#8216;factory-bean&#8217; attribute along with the &#8216;factory-method&#8217; attribute to call instance factory methods to create our beans. Let&#8217;s say our SampleBean is still:</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SampleBean
<span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">int</span> intValue<span style="color: #339933;">;</span>
   <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">float</span> floatValue<span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> SampleBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setIntValue<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> value<span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      intValue <span style="color: #339933;">=</span> value<span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setFloatValue<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">float</span> floatValue<span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">floatValue</span> <span style="color: #339933;">=</span> floatValue<span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>Our factory on the other hand is now a <em>SampleBeanInstanceMethodFactory</em>:</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SampleBeanInstanceMethodFactory
<span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">int</span> uselessParameter<span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> SampleBean createSampleBean<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> value<span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      SampleBean sampleBean <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SampleBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      sampleBean.<span style="color: #006633;">setIntValue</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">return</span> sampleBean<span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setUselessParameter<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> uselessParameter<span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">uselessParameter</span> <span style="color: #339933;">=</span> uselessParameter<span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>So, we can create our <em>SampleBean</em> by defining our <em>SampleBeanInstanceMethodFactory</em> as a bean and then using it as a value to the &#8216;factory-bean&#8217; attribute:</p><div
class="wp_syntax"><div
class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;instanceMethodFactory&quot;</span> </span>
<span style="color: #009900;">    <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;my.crazy.example.SampleBeanInstanceMethodFactory&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;sampleBean&quot;</span> <span style="color: #000066;">factory-bean</span>=<span style="color: #ff0000;">&quot;instanceMethodFactory&quot;</span> </span>
<span style="color: #009900;">                              <span style="color: #000066;">factory-method</span>=<span style="color: #ff0000;">&quot;createSampleBean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;constructor-arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;25&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div><p>We can also now pass parameters to our factory when we create it and still pass parameters to our factory method and the <em>SampleBean</em> as well:</p><div
class="wp_syntax"><div
class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;instanceMethodFactory&quot;</span> </span>
<span style="color: #009900;">    <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;my.crazy.example.SampleBeanInstanceMethodFactory&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;uselessParameter&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;123&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;sampleBean&quot;</span> <span style="color: #000066;">factory-bean</span>=<span style="color: #ff0000;">&quot;instanceMethodFactory&quot;</span> </span>
<span style="color: #009900;">                               <span style="color: #000066;">factory-method</span>=<span style="color: #ff0000;">&quot;createSampleBean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;constructor-arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;25&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;floatValue&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;0.57&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div><p>This is all similar to what we did with the static factory method, but it gives you the extra level of flexibility to be able to work with instance methods that create objects. But what if I don&#8217;t like any of this factory method nonsense and still want to be really advanced?</p><p>&#160;</p><p><em><u>Using A FactoryBean</u></em></p><p>You can instantiate objects by creating a factory class that implements Spring&#8217;s own FactoryBean interface. This means that you can treat your <em>FactoryBean</em> as if it were itself the object that you&#8217;re trying to create, so you would wire in the <em>FactoryBean</em> anywhere you want to use the actual object you&#8217;re trying to create and Spring will automatically call the right method on the FactoryBean and use the return of that method as the object. This is best demonstrated with an example. The <em>FactoryBean</em> interface has the following methods on it:</p><ul><li>Object getObject()</li><li>Class getObjectType()</li><li>boolean isSingleton()</li></ul><p>You have to implement all three. So, our <em>SampleBean</em> is now:</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SampleBean
<span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">public</span> SampleBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>Our <em>FactoryBean</em> to create the <em>SampleBean</em> will look like this:</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SampleBeanFactoryBean <span style="color: #000000; font-weight: bold;">implements</span> FactoryBean
<span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Object</span> getObject<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span>
   <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> SampleBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">Class</span> getObjectType<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">return</span> SampleBean.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> isSingleton<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>When we want to wire in a SampleBean as a dependency of a <em>FunkyBean</em> that looks like this:</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> FunkyBean
<span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">private</span> SampleBean sampleBean<span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> FunkyBean<span style="color: #009900;">&#40;</span>SampleBean sampleBean<span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">sampleBean</span> <span style="color: #339933;">=</span> sampleBean<span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>we would do the following:</p><div
class="wp_syntax"><div
class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;sampleBean&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;my.crazy.example.SampleBeanFactoryBean&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;funkyBean&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;my.crazy.example.FunkyBean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;constructor-arg</span> <span style="color: #000066;">ref</span>=<span style="color: #ff0000;">&quot;sampleBean&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div><p>As you can see we just wire in the <em>SampleBeanFactoryBean</em> in place of a <em>SampleBean</em> and let Spring do its magic by calling <em>getObject</em>() and returning the output of that as the bean to wire into the <em>FunkyBean</em>, pretty sweet.</p><p> Why is this useful, you ask? Well in our contrived example above it doesn&#8217;t really add much value, but let&#8217;s say you needed to create an object in some really complex fashion. For example, let&#8217;s say you obtain your object, by establishing some kind of network connection and getting some xml sent over-the-wire which you then de-serialize into your object. You then want to treat you new object as spring singleton (yeah I know, not contrived at all :)). Well, <em>FactoryBean</em> is a perfect way to do this. It provides you with a factory method type of approach to creating your object and then lets you easily manage your new object as a Spring singleton. So, if our <em>SampleBean</em> still looks like:</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SampleBean
<span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">public</span> SampleBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>Our <em>SampleBeanFactoryBean</em> would look like this:</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SampleBeanFactoryBean <span style="color: #000000; font-weight: bold;">implements</span> FactoryBean
<span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">private</span> SampleBean sampleBean<span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Object</span> getObject<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span>
   <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">//ignore the fact that all of this is basically pseudocode</span>
      <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>sampleBean <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
         NetworkConnection connection <span style="color: #339933;">=</span>
            NetworkConnectionFactory.<span style="color: #006633;">getFunkyNetworkConnection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #003399;">String</span> beanAsXml <span style="color: #339933;">=</span> connection.<span style="color: #006633;">getSampleBeanAsXml</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         sampleBean <span style="color: #339933;">=</span> DeSerializer.<span style="color: #006633;">deserialize</span><span style="color: #009900;">&#40;</span>beanAsXml<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000000; font-weight: bold;">return</span> sampleBean<span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">Class</span> getObjectType<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">return</span> SampleBean.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> isSingleton<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>We would be able to wire in our <em>SampleBean</em> in exactly the same way as before. Ultra useful, but you have to implement a Spring interface which couples your code to Spring somewhat, that&#8217;s the price of power. So, consider carefully, if you don&#8217;t mind being tied to Spring, then there is no problem, but if you want your code to remain unaware of the container you&#8217;re using, you may need to consider a different solution.</p><p>&#160;</p><p><em><u>Using Lookup-Method Injection</u></em></p><p>I thought I would include this one because it is pretty cool and a good feature to be aware of. Essentially, Spring can dynamically override methods on container managed beans. This is actually explained pretty well in the Spring documentation, but here is the quick and dirty version. If you have a singleton bean (<em>SingletonBean</em>) that needs to work with an instance of another bean (which is not a singleton &#8211; <em>PrototypeBean</em>) every time a method on the singleton is invoked, you can do one of 2 things. You can either make your SingletonBean <em>BeanFactoryAware</em> so that you can fetch a different instance of your <em>PrototypeBean</em> every time your singleton needs it or you can use lookup-method injection.</p><p>The first solution is fine but is not ideal if you don&#8217;t want to tie your code to Spring, so this is where the second solution comes in. If your <em>SingletonBean</em> looks like this:</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">abstract</span> <span style="color: #000000; font-weight: bold;">class</span> SingletonBean
<span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Object</span> process<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> someState<span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      PrototypeBean prototypeBean <span style="color: #339933;">=</span> grabPrototypeBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      prototypeBean.<span style="color: #006633;">setState</span><span style="color: #009900;">&#40;</span>someState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">return</span> prototypeBean.<span style="color: #006633;">doPrototypeBeanStuff</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">abstract</span> PrototypeBean grabPrototypeBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>and your <em>PrototypeBean</em> is as follows:</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> PrototypeBean
<span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> state<span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Object</span> doPrototypeBeanStuff<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">// do whatever here</span>
      <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setState<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> someState<span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
      state <span style="color: #339933;">=</span> someState<span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>Spring can actually override the <em>createPrototypeBean</em>() using lookup-method injection to provide a new instance of a <em>PrototypeBean</em> every time that method is called. Spring does this by using bytecode instrumentation with CGLIB to dynamically subclass the <em>SingletonBean</em> and provide it with an implementation for the <em>createPrototypeBean</em>() method (obviously you will need the CGLIB library in your classpath somewhere). The Spring configuration would be as follows:</p><div
class="wp_syntax"><div
class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;prototypeBean&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;my.crazy.example.PrototypeBean&quot;</span> </span>
<span style="color: #009900;">                                        <span style="color: #000066;">scope</span>=<span style="color: #ff0000;">&quot;prototype&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;singletonBean&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;my.crazy.example.SingletonBean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;lookup-method</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;grabPrototypeBean&quot;</span> <span style="color: #000066;">bean</span>=<span style="color: #ff0000;">&quot;prototypeBean&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div><p>You can see how this one could come in handy in some situations if you want to keep managing your beans through dependency injection but don&#8217;t want to tie your code to Spring. Plus, it sounds really impressive when you tell people how you were &quot;using bytecode instrumentation to facilitate dynamic lookup-method injection&quot; :).</p><p>Well, that’s it, hopefully you got something new out of this and have more of an understanding of the powerful features that you have at your disposal when you use Spring even for basic things like dependency injection.</p><p> If you would like me to expand on anything that I covered here then please let me know by leaving a comment and I will create a new post or extend this one. Also let me know if you feel like this post should have covered some more ground, perhaps more relevant examples, or possibly there is another cool way to instantiate beans in Spring?</p><p><strong>Related posts:</strong><ol><li><a
href='http://www.skorks.com/2010/04/ruby-access-control-are-private-and-protected-methods-only-a-guideline/' rel='bookmark' title='Ruby Access Control &#8211; Are Private And Protected Methods Only A Guideline?'>Ruby Access Control &#8211; Are Private And Protected Methods Only A Guideline?</a></li><li><a
href='http://www.skorks.com/2010/10/write-a-function-to-determine-if-a-number-is-a-power-of-2/' rel='bookmark' title='Write A Function To Determine If A Number Is A Power Of 2'>Write A Function To Determine If A Number Is A Power Of 2</a></li><li><a
href='http://www.skorks.com/2009/09/true-false-and-nil-objects-in-ruby/' rel='bookmark' title='True, False And Nil Objects In Ruby'>True, False And Nil Objects In Ruby</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.skorks.com/2008/10/are-you-using-the-full-power-of-spring-when-injecting-your-dependencies/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>The Real Measure Of Code Quality</title><link>http://www.skorks.com/2008/09/the-real-measure-of-code-quality/</link> <comments>http://www.skorks.com/2008/09/the-real-measure-of-code-quality/#comments</comments> <pubDate>Sun, 28 Sep 2008 11:17:39 +0000</pubDate> <dc:creator>Alan Skorkin</dc:creator> <category><![CDATA[Agile]]></category> <category><![CDATA[Developers]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[developers]]></category> <category><![CDATA[quality]]></category> <guid
isPermaLink="false">http://www.skorks.com/?p=407</guid> <description><![CDATA[Code quality is very subjective, numbers and tools often don't give you enough of an idea about just how quality your code actually is. So what IS a good measure of code quality?
<strong>Related posts:</strong><ol><li><a
href='http://www.skorks.com/2008/10/are-you-actually-a-post-agilist/' rel='bookmark' title='Are You Actually A Post-Agilist?'>Are You Actually A Post-Agilist?</a></li><li><a
href='http://www.skorks.com/2010/05/how-to-be-a-real-elite-programmer-and-make-sure-everybody-knows-it/' rel='bookmark' title='How To Be A Real Elite Programmer And Make Sure Everybody Knows It'>How To Be A Real Elite Programmer And Make Sure Everybody Knows It</a></li><li><a
href='http://www.skorks.com/2009/07/effective-vs-ineffective-pair-programming/' rel='bookmark' title='Effective vs Ineffective Pair Programming'>Effective vs Ineffective Pair Programming</a></li></ol>]]></description> <content:encoded><![CDATA[<p></p><p>There was a comic going around a few weeks ago about code quality, you remember the one:</p><p><a
title="Only Valid Measure Of Code Quality" href="http://www.osnews.com/story/19266/WTFs_m" target="_blank"><img
style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" title="image" src="http://www.skorks.com/wp-content/uploads/2008/09/image25.png" border="0" alt="image" width="437" height="453" /></a>Pretty amusing, but it got me thinking, what IS a good measure of code quality? Quality after all is very subjective, what I might perceive as being great, you might perceive as crappy for a host of reasons. A pet pattern wasn’t used quite right, the unit tests aren’t “real” unit tests, you know of a library that would have made the whole thing 10 times easier, etc.</p><p>There are all sorts of different measures that might relate to code quality, the level of coupling, the testability of the code, the test coverage, adherence to standards and many others and yet all of these are still subjective to a degree. There are times when not adhering to standards is best, just as there are times when a low level of coverage is good enough, it is all different from system to system, situation to situation. So is there no one good measure of code quality?</p><p>I contend that there is only one measure of code quality that is worth anything. We can argue all we want about numbers and patterns but in the end, one thing will always be true for every good developer:</p><p><strong>Every good developer intrinsically knows if his/her code is good enough!</strong></p><p>That&#8217;s right, you already know if your code is good enough, if you think that you don’t then you’re deceiving yourself and need to ask yourself the following questions.</p><p>If you were to think of a developer you admire, would you be proud to show your code to that person or would you cringe in shame if they were to see it? By extension, if that person were to criticise your code for whatever reason, would you vigorously defend it with all your heart or would you put in a token defensive effort for appearance sakes?</p><p>Due to the nature of our work, developers are part artist, part craftsman and part scientist and the one thing that all those people share is the ability to know if what they’ve produced is worth anything. Therefore, before we go and try to find an external way to validate our code for quality (and that includes getting it reviewed by other people) we need to be completely unequivocal about our answer to the question:</p><p><strong>Do I think the code is good enough?</strong></p><p>If the answer is not unequivocally yes, then there is no point going any further and you have some work ahead of you. If the answer IS yes, it doesn’t mean the code is perfect and can’t improve, it means that only more knowledge and/or experience can make it better. This is when involving someone else is a good idea, sharing knowledge and experience is (partly) why we work in teams after all.</p><p>The above works even better for pair programming, but the question becomes:</p><p><strong>Do we as a pair think the code is good enough?</strong></p><p>This works better because as a pair your internal threshold for quality will most likely be higher than it would be for each of you individually and you’re already sharing knowledge and experience. The threshold becomes higher still if you regularly rotate pairs. Although I do believe there will be diminishing returns if too many people have a stake in the code, but if the story size is small enough, this should not be an issue.</p><p>Well, those are my thoughts on measuring code quality I wonder what everyone else thinks. Do you agree with me or do you perhaps think that I am way off base? Do you know of a better way of measuring code quality (no, WTF per minute doesn’t count)?</p><p><strong>Related posts:</strong><ol><li><a
href='http://www.skorks.com/2008/10/are-you-actually-a-post-agilist/' rel='bookmark' title='Are You Actually A Post-Agilist?'>Are You Actually A Post-Agilist?</a></li><li><a
href='http://www.skorks.com/2010/05/how-to-be-a-real-elite-programmer-and-make-sure-everybody-knows-it/' rel='bookmark' title='How To Be A Real Elite Programmer And Make Sure Everybody Knows It'>How To Be A Real Elite Programmer And Make Sure Everybody Knows It</a></li><li><a
href='http://www.skorks.com/2009/07/effective-vs-ineffective-pair-programming/' rel='bookmark' title='Effective vs Ineffective Pair Programming'>Effective vs Ineffective Pair Programming</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.skorks.com/2008/09/the-real-measure-of-code-quality/feed/</wfw:commentRss> <slash:comments>9</slash:comments> </item> <item><title>The 4 Unlikely Traits of Good Developers</title><link>http://www.skorks.com/2008/09/the-4-unlikely-traits-of-good-developers/</link> <comments>http://www.skorks.com/2008/09/the-4-unlikely-traits-of-good-developers/#comments</comments> <pubDate>Tue, 16 Sep 2008 12:07:11 +0000</pubDate> <dc:creator>Alan Skorkin</dc:creator> <category><![CDATA[Developers]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[developers]]></category> <category><![CDATA[development]]></category> <category><![CDATA[personality]]></category> <category><![CDATA[traits]]></category> <category><![CDATA[unlikely]]></category> <guid
isPermaLink="false">http://www.skorks.com/?p=296</guid> <description><![CDATA[Have you ever wondered what the traits are that set good software developers apart. This article attempts to answer that question.
<strong>Related posts:</strong><ol><li><a
href='http://www.skorks.com/2008/08/fitness-for-software-developers-and-other-it-professionals/' rel='bookmark' title='Fitness for Software Developers (and Other IT Professionals)'>Fitness for Software Developers (and Other IT Professionals)</a></li><li><a
href='http://www.skorks.com/2008/08/3-things-they-should-have-taught-in-my-computer-science-degree/' rel='bookmark' title='3 Things They Should Have Taught In My Computer Science Degree'>3 Things They Should Have Taught In My Computer Science Degree</a></li><li><a
href='http://www.skorks.com/2008/09/the-real-measure-of-code-quality/' rel='bookmark' title='The Real Measure Of Code Quality'>The Real Measure Of Code Quality</a></li></ol>]]></description> <content:encoded><![CDATA[<p></p><p><img
class="alignleft size-medium wp-image-300" style="margin-right: 5px; margin-bottom: 5px; float:left" title="curiosity" src="http://www.skorks.com/wp-content/uploads/2008/09/curiosity-300x240.png" alt="" width="300" height="240" />Lately, I’ve been thinking about what makes a software developer a good software developer. All the generic things that you would expect came to mind, knowledge, skills with tools/frameworks, memory, teamwork skills, caffeine etc. But all of those are boring and predictable, noone wants to be boring, so I thought harder, I thought and thought “till I couldn’t think no more”.  Then I had some tea, then I watched “The Simpsons”, now I am writing this article, but I digress, which actually illustrates my first point fairly well (in a roundabout sort of way, so bear with me).</p><p><strong>1. Creativity</strong></p><p>While drinking my tea and munching on my crumpets (that’s a figure of speech I wasn’t actually eating crumpets, I was having a croissant … I think I just made it worse). Where was I, oh yeah, while doing something completely unrelated I was able to come up with some interesting points about what makes developers, developers. Unlike what TV and certain other elements would have you believe, most good developers are not just single-minded calculatory automatons obsessed with algorithms, but are rather very creative people. Notice how I made up a word in a very sentence preceding this one, I bet most of you didn’t even realise “calculatory” wasn’t a real word.</p><p>The point I am trying to make is that the ideas for this article came to me not through rigorous calculation and formulaic thinking but through inspiration. I stopped focusing on what I wanted to do and let the universe fill me with its goodness (in a completely figurative way) and then all of a sudden KABLAMO! Inspiration strikes and I am able to go and paint a painting (if I could paint), or create a little application to help me manage all my passwords (which I certainly can do), or write an article about developers (which I am doing right now). I bet you missed how I made up another word, kablamo, yeah I know, I am plagiarising it from someone, but plagiarism is the reality TV generation’s brand of creativity so it still counts.</p><p><strong>2. Insane Curiosity</strong></p><p>Many people are curious, but I find that many good developers are overly curious even when compared to your average Joe Curious. I would certainly fit that description. You’ve probably guessed that I am writing all this while operating under the assumption that I am a fairly good developer, since I use myself as an example so much. So, if you could all just suspend your disbelief for a few minutes and share that assumption with me we’ll be able to proceed with the rest of this article.</p><p>This trait of curiosity doesn’t just begin and end with software but extends to all facets of the life of a software developer. This is why most good software developers that you meet have one, two or sometimes even more alternative “things” that they really like doing and could probably make a living in if they weren’t doing software. It is also a really helpful trait in the IT industry with it ever-changing landscape. If finding out new things and learning new skills was a chore, one would find it very hard to keep up with the pace of the industry. But when you take insatiable curiosity into account, keeping up with the industry becomes a natural thing, a result of the personality of a good developer.</p><p>Finally it certainly doesn’t hurt to be a curious individual when your job involves constantly trying to get to the root of complex problems. You have to have the “need to know” rather than just treating it as a job.</p><p><strong>3. Finding Fault With Absolutely Everything</strong></p><p>Good software developers are ornery and opinionated, it is a fact, accept it. And the special power that the lot of them share is the ability to always find something to complain about. When it comes to code this trait presents itself as the perception that nobody else’s code is ever good enough, not even your own.</p><p>No matter how well the code is written, when good developers get their hands on it, they will always find a reason why the code is crappy and should be re-written/refactored to be “better” and of course they are just the person to do it. In this light this may not seem like such a desirable attribute, but consider that this trait is synonymous with a constant desire to improve. Notice that I never said that good developers like to find faults for the sake of finding faults, but rather they are able to find areas where they can use their expertise to improve the situation and create a better/cleaner/faster/etc system overall.</p><p>You could only hope and dream that the person who is building your house has this kind of attitude, if they did we might be able get some damn decent construction once in a while. For the moment though we’ll just thank the all powerful spaghetti monster in the sky that construction workers don’t build software, and hope that this trait of good software developers gets the recognition it deserves.</p><p><strong>4. Working Hard To Facilitate Laziness</strong></p><p>Developers are the hardest working lazy people you’ll ever meet or possibly the laziest hard working people. Developers love to write little tools and find little ways to make everything more automated which would of course make our lives much easier. Our goal is to get to the point where we just sit there and our little automated tools do all the work, from writing code to calling home and telling our wife/girlfriend/robo-doggie that we’ll be late for dinner.</p><p>At least that’s the myth that we all perpetuate amongst ourselves. We are all well aware that the more we streamline and automate and find ways to make our life easier in general, the more work appears to fill that five minutes that we’ve saved. Applications become more and more ambitious and the good developers have to once try to flex their ingenuity to shave off some time in all the right places. And then the application will become more ambitious still and the cycle begins again.</p><p>This trait is the reason that the software industry has come as far as it has in such a relatively short time-frame. The good developers find ways to do stuff more efficiently, to automate and streamline, all in the name of supporting their laziness habit which allows more room for grander scope and vision. If it weren’t for this trait that all good developers share we’d still be writing the next greatest calculator application using LogoWriter and punch cards (Go LogoWriter!!! You shall live on in our hearts forever! Amen!).</p><p>Well that’s it, I had all this other stuff to say, it was all really awesome, but I can’t be bothered. Hmmm, an application that figures out what I can’t be bothered saying and notes it down anyway. That’s gold! I’ll make billions! Where is my drawing board…?</p><p>Would you like to share your thoughts on the unlikely traits that good developers have, or maybe you’d like to critique my thoughts? Leaving a comment is your opportunity, you could even try to automate the process and then I’ll have to put capchas in (*sigh* it’s a never-ending dance). Oh yeah, the RSS feed button is at the top of the page, this blog needs more RSS love.<br
/> <img
class="aligncenter size-medium wp-image-301" style="margin-right: auto; margin-left: auto; display: block;" title="pussinboots" src="http://www.skorks.com/wp-content/uploads/2008/09/pussinboots-300x225.jpg" alt="" width="300" height="225" /></p><p><strong>Related posts:</strong><ol><li><a
href='http://www.skorks.com/2008/08/fitness-for-software-developers-and-other-it-professionals/' rel='bookmark' title='Fitness for Software Developers (and Other IT Professionals)'>Fitness for Software Developers (and Other IT Professionals)</a></li><li><a
href='http://www.skorks.com/2008/08/3-things-they-should-have-taught-in-my-computer-science-degree/' rel='bookmark' title='3 Things They Should Have Taught In My Computer Science Degree'>3 Things They Should Have Taught In My Computer Science Degree</a></li><li><a
href='http://www.skorks.com/2008/09/the-real-measure-of-code-quality/' rel='bookmark' title='The Real Measure Of Code Quality'>The Real Measure Of Code Quality</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.skorks.com/2008/09/the-4-unlikely-traits-of-good-developers/feed/</wfw:commentRss> <slash:comments>15</slash:comments> </item> </channel> </rss>
