<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:series="http://organizeseries.com/"
		>
<channel>
	<title>Comments on: When To Write Bad Code</title>
	<atom:link href="http://www.brandonsavage.net/when-to-write-bad-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brandonsavage.net/when-to-write-bad-code/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=when-to-write-bad-code</link>
	<description>The personal blog of Brandon Savage. Contains entries of a personal and professional nature focusing on PHP, Apple, LAMP, MySQL and Washington, DC.</description>
	<lastBuildDate>Wed, 15 May 2013 14:54:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.2-alpha</generator>
	<item>
		<title>By: Hikari</title>
		<link>http://www.brandonsavage.net/when-to-write-bad-code/#comment-8637</link>
		<dc:creator>Hikari</dc:creator>
		<pubDate>Sat, 09 Mar 2013 04:56:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=2081#comment-8637</guid>
		<description><![CDATA[I see your point. And for sure, if the alternative is getting nothing, it&#039;s better to have anything.

But let&#039;s be serious about this serious matter. Engineering software rarely is about developing it until it&#039;s finished, delovering it and forgetting it with its user. We, or another engineer, will need to change and maintain it.

It&#039;s ok to have something not following those best practices and standards and patterns. if that&#039;s the best we can do NOW. But ASAP we MUST improve its quality, and by that I mean really DO it.

And there are some things we can do, even with not enough time or knowledge, to make it easier to enhance software quality after it&#039;s already constructed, that doesn&#039;t increase its developing time.

* Use Design Patterns, always! If you&#039;re gonna access some data source, instead of messing SQL everywhere, at least create a DAO class and put all data access code in it as you gonna
* Use encapsulation! Really, keep responsibilities in their place and spend a minimum time thinking in operations interfaces. Internal code can be bad, but if interfaces are good, later you&#039;ll be able to refactor as needed without messing anything else.
* Instead of building a &quot;big&quot; software, create a separated project and try small pieces of features. As you feel how it&#039;s working, remake it into the main project. Or, create a Subversion branch, mess with the code then just see what has changed, create another branch and remake it. This way you won&#039;t mix bad code into good and stable code, but will still use repository advantages.

If you really don&#039;t know how to do it, develop a prototype instead of pretending to develop a production-quality software. Present it to user/customer as a demonstration, explain you didn&#039;t have enough time and just made it to get something to show and it is NOT good.

Developing prototype takes less effort than developing quality software, and even less than TRYING and failing to do it. Prototyping really reduce a lot of resources consumed, and help us better understand how it should be!

In my last prototype I created a very big form with hundreds of fields. It didn&#039;t have any DTO, whole HTML was static, it was really unusable. But it was enough to present to customer, to get them to see it working, feel how it could be. For me to test a form layout that would fit all those fields and feel a validation scheme.

And now I&#039;m remaking it, adding PHP, thinking in fields names, getting them from POST and setting in a DTO and getting back into input values. And the cool thing is that most HTML markup and whole CSS styles are being used, they were good enough!]]></description>
		<content:encoded><![CDATA[<p>I see your point. And for sure, if the alternative is getting nothing, it&#8217;s better to have anything.</p>
<p>But let&#8217;s be serious about this serious matter. Engineering software rarely is about developing it until it&#8217;s finished, delovering it and forgetting it with its user. We, or another engineer, will need to change and maintain it.</p>
<p>It&#8217;s ok to have something not following those best practices and standards and patterns. if that&#8217;s the best we can do NOW. But ASAP we MUST improve its quality, and by that I mean really DO it.</p>
<p>And there are some things we can do, even with not enough time or knowledge, to make it easier to enhance software quality after it&#8217;s already constructed, that doesn&#8217;t increase its developing time.</p>
<p>* Use Design Patterns, always! If you&#8217;re gonna access some data source, instead of messing SQL everywhere, at least create a DAO class and put all data access code in it as you gonna<br />
* Use encapsulation! Really, keep responsibilities in their place and spend a minimum time thinking in operations interfaces. Internal code can be bad, but if interfaces are good, later you&#8217;ll be able to refactor as needed without messing anything else.<br />
* Instead of building a &#8220;big&#8221; software, create a separated project and try small pieces of features. As you feel how it&#8217;s working, remake it into the main project. Or, create a Subversion branch, mess with the code then just see what has changed, create another branch and remake it. This way you won&#8217;t mix bad code into good and stable code, but will still use repository advantages.</p>
<p>If you really don&#8217;t know how to do it, develop a prototype instead of pretending to develop a production-quality software. Present it to user/customer as a demonstration, explain you didn&#8217;t have enough time and just made it to get something to show and it is NOT good.</p>
<p>Developing prototype takes less effort than developing quality software, and even less than TRYING and failing to do it. Prototyping really reduce a lot of resources consumed, and help us better understand how it should be!</p>
<p>In my last prototype I created a very big form with hundreds of fields. It didn&#8217;t have any DTO, whole HTML was static, it was really unusable. But it was enough to present to customer, to get them to see it working, feel how it could be. For me to test a form layout that would fit all those fields and feel a validation scheme.</p>
<p>And now I&#8217;m remaking it, adding PHP, thinking in fields names, getting them from POST and setting in a DTO and getting back into input values. And the cool thing is that most HTML markup and whole CSS styles are being used, they were good enough!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ChadF</title>
		<link>http://www.brandonsavage.net/when-to-write-bad-code/#comment-7365</link>
		<dc:creator>ChadF</dc:creator>
		<pubDate>Tue, 19 Feb 2013 02:29:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=2081#comment-7365</guid>
		<description><![CDATA[@giantism_strikes

Yes, they [should] know better, but they also know reality. If a developer is expected to get something done by (or close to) a given deadline, then they have to do what is required, including less than ideal code, if keeping their job and/or not being looked over for promotion is a concern.

At around 7 years experience, I expect I was still under the misconception (or delusion) that ideal environments are realistic [to exist or be used]. But trying to do things the &quot;right way&quot; (i.e. avoid unverified assumptions, think ahead, have a clear plan/direction) and fighting to improve the system eventually wears one out. Sure you can continue to do your own best, despite everyone/everything else, but eventually have to accept you can&#039;t [always] force the system to improve (unless you create your own startup company or something). The stress of &quot;fighting [too many of] the good fights&quot; is not worth it.

And even experienced developers must accept that they don&#039;t know everything [in their field]. That when starting something radically different from all their past experiences that some [blind] experimentation, and trial and error, is required to develop a valid understanding. One can not create a proper design [up front] if they don&#039;t understand the domain it is for. So the choice is either do a lot of reading (over a long period) and still only have &quot;classroom experience&quot; to show for it (all theory, little practically), or to dive in and experiment and learn much quicker (with a clearer understanding). In an ideal world developers would be given adequate time to experiment and learn independent of the &quot;real work&quot;, but the reality (employer&#039;s goal, budget constraints, clueless management) often makes it &quot;on the job&quot; learning instead.

In all, what I took from the original article was &quot;don&#039;t write garbage code for real products if you can avoid it (prototypes not being a real product), but also know your limitations and practicality&quot;.

And for the record.. as early as 2-3 years of [for salaried] experience, I was probably better than most of my co-workers with 5, 10, and 15 (or more) years of experience. I was terrible at a lot of things (so not too much ego there), but _very_ good at programming, as it is mostly intuition for me.

Oh, and the other reason I don&#039;t blindly put value on someone &quot;just because&quot; they have some degree is while formalized education is a great way to obtain large amount of [good] information quickly.. it also means that knowledge was spoon-fed to the student and within the mindset (or &quot;box&quot;) of the teacher/school/whatever. Where in cases of pure unbiased/untainted experimentation, one may make many more mistakes (say that 5 times fast), but in the end [can] have a better appreciation for the subtleties of what was learned and think outside that &quot;box&quot;.]]></description>
		<content:encoded><![CDATA[<p>@giantism_strikes</p>
<p>Yes, they [should] know better, but they also know reality. If a developer is expected to get something done by (or close to) a given deadline, then they have to do what is required, including less than ideal code, if keeping their job and/or not being looked over for promotion is a concern.</p>
<p>At around 7 years experience, I expect I was still under the misconception (or delusion) that ideal environments are realistic [to exist or be used]. But trying to do things the &#8220;right way&#8221; (i.e. avoid unverified assumptions, think ahead, have a clear plan/direction) and fighting to improve the system eventually wears one out. Sure you can continue to do your own best, despite everyone/everything else, but eventually have to accept you can&#8217;t [always] force the system to improve (unless you create your own startup company or something). The stress of &#8220;fighting [too many of] the good fights&#8221; is not worth it.</p>
<p>And even experienced developers must accept that they don&#8217;t know everything [in their field]. That when starting something radically different from all their past experiences that some [blind] experimentation, and trial and error, is required to develop a valid understanding. One can not create a proper design [up front] if they don&#8217;t understand the domain it is for. So the choice is either do a lot of reading (over a long period) and still only have &#8220;classroom experience&#8221; to show for it (all theory, little practically), or to dive in and experiment and learn much quicker (with a clearer understanding). In an ideal world developers would be given adequate time to experiment and learn independent of the &#8220;real work&#8221;, but the reality (employer&#8217;s goal, budget constraints, clueless management) often makes it &#8220;on the job&#8221; learning instead.</p>
<p>In all, what I took from the original article was &#8220;don&#8217;t write garbage code for real products if you can avoid it (prototypes not being a real product), but also know your limitations and practicality&#8221;.</p>
<p>And for the record.. as early as 2-3 years of [for salaried] experience, I was probably better than most of my co-workers with 5, 10, and 15 (or more) years of experience. I was terrible at a lot of things (so not too much ego there), but _very_ good at programming, as it is mostly intuition for me.</p>
<p>Oh, and the other reason I don&#8217;t blindly put value on someone &#8220;just because&#8221; they have some degree is while formalized education is a great way to obtain large amount of [good] information quickly.. it also means that knowledge was spoon-fed to the student and within the mindset (or &#8220;box&#8221;) of the teacher/school/whatever. Where in cases of pure unbiased/untainted experimentation, one may make many more mistakes (say that 5 times fast), but in the end [can] have a better appreciation for the subtleties of what was learned and think outside that &#8220;box&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: giantism_strikes</title>
		<link>http://www.brandonsavage.net/when-to-write-bad-code/#comment-7358</link>
		<dc:creator>giantism_strikes</dc:creator>
		<pubDate>Mon, 18 Feb 2013 20:54:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=2081#comment-7358</guid>
		<description><![CDATA[@ChadF

No egotism, just a jerk. The comment was that anyone with any experience knows better. The point of listing my credentials was to show that I do have experience. If you think 7 years in programming is not any real experience, then I feel sorry for how long it took for you to grow in skills. I&#039;ve been in a variety of environments, including absolute crap where we were Defect Driven Design (only way we knew the requirements were that someone threw in a defect with missing functionality). The point is that bad code is bad code. If you cannot abstract what needs to happen, then you have to re-write the same code over and over and over and over...]]></description>
		<content:encoded><![CDATA[<p>@ChadF</p>
<p>No egotism, just a jerk. The comment was that anyone with any experience knows better. The point of listing my credentials was to show that I do have experience. If you think 7 years in programming is not any real experience, then I feel sorry for how long it took for you to grow in skills. I&#8217;ve been in a variety of environments, including absolute crap where we were Defect Driven Design (only way we knew the requirements were that someone threw in a defect with missing functionality). The point is that bad code is bad code. If you cannot abstract what needs to happen, then you have to re-write the same code over and over and over and over&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ChadF</title>
		<link>http://www.brandonsavage.net/when-to-write-bad-code/#comment-7311</link>
		<dc:creator>ChadF</dc:creator>
		<pubDate>Sun, 17 Feb 2013 07:09:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=2081#comment-7311</guid>
		<description><![CDATA[If something is written as a prototype (hence &quot;prototype&quot;, not &quot;version 1.0&quot;), then by definition it should be considered throw away code before it is even started. If some or most of it happens to be well designed from the start (perhaps it was a variation of something specific the programmer had past experience with), then that&#039;s great (but don&#039;t assume that from the beginning). And if management is even close to worth the [probably overpaid] salary they get, then they will account for this and allocate time and resources accordingly. It would be illogical even from managements/the company&#039;s point of view to waste valuable time having the developers exhaustively plan out a project in the proof of concept stage for something that may not even be accepted. After the contact is awarded, project approved, or whatever the prototype was meant to justify, THEN all those extra steps should be taken (and with luck, the lessons learned building the &quot;quick and dirty&quot; prototype can go toward creating a well designed framework for the real thing).

@giantism_strikes:

Wow.. I detect a hint of egotism from your comments, including the one where you rattle off all those fancy (yet ultimately meaningless) degrees. I&#039;ve seen plenty of programmers, fresh out of college, but weren&#039;t of any significant programming value until they had some experience in the real world (and not that contrived classroom stuff). I don&#039;t care if someone has three PhD&#039;s.. all that truly proves is they are good at school, and whether they are any good beyond that depends on each individual.

I too have worked as a developer for the government.. and in that time I have seen the existence of monolithic &quot;projects to replace them all&quot; (too Lord of the Rings-ee?) in an attempt to get rid of all the [working] legacy systems. But all they really did was spend _years_ trying to &quot;design the universal framework&quot;, while taking money from the budgets of projects actually used, until eventually its budget was cut too, and nothing really came out of it (except maybe a few prototypes that only worked in a limited scope). And I heard they had some damn smart people working on that project.. if their whole project implementation hadn&#039;t been doomed from the start. I&#039;ve also seen the same unrealistic &quot;one pass&quot; coding expectations when dealing with contracting companies.. where the contractors are only allowed to work on things that have been approved by the contract managers (due to legal requirements) and were expected to get their tasks done by certain deadlines with no allocation for going back to fix/refactor all the &quot;just make it work&quot; code. Since the government was paying for work to be done, the company didn&#039;t want to eat the costs of having to pay their employees to do code cleaned up, only that the next cycle of tasks were assigned for the next deadline (so the company could get their next batch of billable hours paid by the government). This basically continues until portions of the project become so unmaintainable, due to all the patchwork on patchwork, over the years that a major rewrite HAS to be done just to be able to [realistically] incorporate any new requirements. Luckily, I wasn&#039;t one of the contractors and could my code without one hand [always] tied behind my back.

7 years of experience huh? Let me know when you&#039;ve had 20+ years, and you&#039;d have to deal with the futility of some of these work environments (and as Dilbert would put it, &quot;the numbing effect&quot;).]]></description>
		<content:encoded><![CDATA[<p>If something is written as a prototype (hence &#8220;prototype&#8221;, not &#8220;version 1.0&#8243;), then by definition it should be considered throw away code before it is even started. If some or most of it happens to be well designed from the start (perhaps it was a variation of something specific the programmer had past experience with), then that&#8217;s great (but don&#8217;t assume that from the beginning). And if management is even close to worth the [probably overpaid] salary they get, then they will account for this and allocate time and resources accordingly. It would be illogical even from managements/the company&#8217;s point of view to waste valuable time having the developers exhaustively plan out a project in the proof of concept stage for something that may not even be accepted. After the contact is awarded, project approved, or whatever the prototype was meant to justify, THEN all those extra steps should be taken (and with luck, the lessons learned building the &#8220;quick and dirty&#8221; prototype can go toward creating a well designed framework for the real thing).</p>
<p>@giantism_strikes:</p>
<p>Wow.. I detect a hint of egotism from your comments, including the one where you rattle off all those fancy (yet ultimately meaningless) degrees. I&#8217;ve seen plenty of programmers, fresh out of college, but weren&#8217;t of any significant programming value until they had some experience in the real world (and not that contrived classroom stuff). I don&#8217;t care if someone has three PhD&#8217;s.. all that truly proves is they are good at school, and whether they are any good beyond that depends on each individual.</p>
<p>I too have worked as a developer for the government.. and in that time I have seen the existence of monolithic &#8220;projects to replace them all&#8221; (too Lord of the Rings-ee?) in an attempt to get rid of all the [working] legacy systems. But all they really did was spend _years_ trying to &#8220;design the universal framework&#8221;, while taking money from the budgets of projects actually used, until eventually its budget was cut too, and nothing really came out of it (except maybe a few prototypes that only worked in a limited scope). And I heard they had some damn smart people working on that project.. if their whole project implementation hadn&#8217;t been doomed from the start. I&#8217;ve also seen the same unrealistic &#8220;one pass&#8221; coding expectations when dealing with contracting companies.. where the contractors are only allowed to work on things that have been approved by the contract managers (due to legal requirements) and were expected to get their tasks done by certain deadlines with no allocation for going back to fix/refactor all the &#8220;just make it work&#8221; code. Since the government was paying for work to be done, the company didn&#8217;t want to eat the costs of having to pay their employees to do code cleaned up, only that the next cycle of tasks were assigned for the next deadline (so the company could get their next batch of billable hours paid by the government). This basically continues until portions of the project become so unmaintainable, due to all the patchwork on patchwork, over the years that a major rewrite HAS to be done just to be able to [realistically] incorporate any new requirements. Luckily, I wasn&#8217;t one of the contractors and could my code without one hand [always] tied behind my back.</p>
<p>7 years of experience huh? Let me know when you&#8217;ve had 20+ years, and you&#8217;d have to deal with the futility of some of these work environments (and as Dilbert would put it, &#8220;the numbing effect&#8221;).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fenn</title>
		<link>http://www.brandonsavage.net/when-to-write-bad-code/#comment-7195</link>
		<dc:creator>Fenn</dc:creator>
		<pubDate>Fri, 08 Feb 2013 20:52:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=2081#comment-7195</guid>
		<description><![CDATA[Ps: Forgot tp provide the Mark Seemann’s blog url: http://blog.ploeh.dk/
And sorry for the typos in the previous comment, (brrr, like &quot;your&quot; instead of &quot;you&#039;re&quot;, I made my own eyes bleed) it&#039;s late and I had a tough week, I have two software deliveries to prepare for next tuesday ^^&quot;]]></description>
		<content:encoded><![CDATA[<p>Ps: Forgot tp provide the Mark Seemann’s blog url: <a href="http://blog.ploeh.dk/" rel="nofollow">http://blog.ploeh.dk/</a><br />
And sorry for the typos in the previous comment, (brrr, like &#8220;your&#8221; instead of &#8220;you&#8217;re&#8221;, I made my own eyes bleed) it&#8217;s late and I had a tough week, I have two software deliveries to prepare for next tuesday ^^&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fenn</title>
		<link>http://www.brandonsavage.net/when-to-write-bad-code/#comment-7194</link>
		<dc:creator>Fenn</dc:creator>
		<pubDate>Fri, 08 Feb 2013 20:45:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=2081#comment-7194</guid>
		<description><![CDATA[@Scott A. Tovey:

No offense intented, but with your comment you&#039;re the one who wants to look smart... and isn&#039;t doing very well.
TDD is well-defined methodology which is mostly but not only associated with agile methodologies. Though agile is a lot about management, TDD is all about writing software, in a very practical way. It&#039;s been around in software engineering for years. If someone claims that he&#039;s a software engineer (you didn&#039;t, I know) without having at least heard about TDD and without having had the curiosity to check by himself, that&#039;s very sad. It&#039;s like pretenting to be a computer enthousiast and never have heard about Linux...
That has nothing to do with insecure programmers: like design patterns, it&#039;s a tool which solves some kind of problems and has to be adapted to one&#039;s situation. And nobody&#039;s forced to use it. 
Of course, it&#039;s not a magical thing that will ensure that everything will be perfect the first time ! We all know there is no silver bullet. 
The base concept is quite simple: write a unit test, make it pass, repeat.
That looks easy and unproductive at first glance, I know, but there is more. First benefit is that you need to think your tests, and be always aware of what you want to achieve, and what are the edge cases. When you code something, you start by stating what you want to do exactly, you constrain it, then you do it. It helps not getting lost, especially for beginners who tend to write code which almost make coffee, but it in the end fails to meet the initial requirements and business rules.
While doing so, you must stay aware of mostly three things: DRY (don&#039;t reppeat yourself), SRP (single responsibility principle), and dependencies. TDD is all about constant refactoring and abstrating. If one of your method or objects grows to much, you stop, you break it, and then you make all your tests green again. If you&#039;re repeating yourself (and you will spot that easily), do the same. And if you encounter a dependency, abstract away (e.g. thanks to an interface), mock it up, and ensure that you inject the dependency in a way that makes your test itself independant from the real implementation. That is one of the biggest benefit from TDD, it leads to a design with a minimal coupling as you code. Your almost coding and designing at the same time. ;)
To understand it better around practical exemples, I&#039;d recommend some reading, e.g. Erik Dietrich&#039;s blog (examples are C# but should be understandable for any decnt developer), especially the 3-posts mini series &quot;TDD for breaking problems apart&quot; ( 
http://www.daedtech.com/tdd-for-breaking-problems-apart 
http://www.daedtech.com/tdd-for-breaking-problems-apart-2-magic-boxes
http://www.daedtech.com/tdd-for-breaking-problems-apart-3-finishing-up ), or Mark Seemann&#039;s blog (yeah, still .Net, it&#039;s currently my working environment. But with a bit of search you&#039;ll find examples in your favorite language easily I think. TDD is well implanted in open source communities and amongst technical writers).
And for anybody who doesn&#039;t think that would suit him or can&#039;t find the benefits, I&#039;m fine with that, I&#039;m not an integrist, so no need troll me.]]></description>
		<content:encoded><![CDATA[<p>@Scott A. Tovey:</p>
<p>No offense intented, but with your comment you&#8217;re the one who wants to look smart&#8230; and isn&#8217;t doing very well.<br />
TDD is well-defined methodology which is mostly but not only associated with agile methodologies. Though agile is a lot about management, TDD is all about writing software, in a very practical way. It&#8217;s been around in software engineering for years. If someone claims that he&#8217;s a software engineer (you didn&#8217;t, I know) without having at least heard about TDD and without having had the curiosity to check by himself, that&#8217;s very sad. It&#8217;s like pretenting to be a computer enthousiast and never have heard about Linux&#8230;<br />
That has nothing to do with insecure programmers: like design patterns, it&#8217;s a tool which solves some kind of problems and has to be adapted to one&#8217;s situation. And nobody&#8217;s forced to use it.<br />
Of course, it&#8217;s not a magical thing that will ensure that everything will be perfect the first time ! We all know there is no silver bullet.<br />
The base concept is quite simple: write a unit test, make it pass, repeat.<br />
That looks easy and unproductive at first glance, I know, but there is more. First benefit is that you need to think your tests, and be always aware of what you want to achieve, and what are the edge cases. When you code something, you start by stating what you want to do exactly, you constrain it, then you do it. It helps not getting lost, especially for beginners who tend to write code which almost make coffee, but it in the end fails to meet the initial requirements and business rules.<br />
While doing so, you must stay aware of mostly three things: DRY (don&#8217;t reppeat yourself), SRP (single responsibility principle), and dependencies. TDD is all about constant refactoring and abstrating. If one of your method or objects grows to much, you stop, you break it, and then you make all your tests green again. If you&#8217;re repeating yourself (and you will spot that easily), do the same. And if you encounter a dependency, abstract away (e.g. thanks to an interface), mock it up, and ensure that you inject the dependency in a way that makes your test itself independant from the real implementation. That is one of the biggest benefit from TDD, it leads to a design with a minimal coupling as you code. Your almost coding and designing at the same time. ;)<br />
To understand it better around practical exemples, I&#8217;d recommend some reading, e.g. Erik Dietrich&#8217;s blog (examples are C# but should be understandable for any decnt developer), especially the 3-posts mini series &#8220;TDD for breaking problems apart&#8221; (<br />
<a href="http://www.daedtech.com/tdd-for-breaking-problems-apart" rel="nofollow">http://www.daedtech.com/tdd-for-breaking-problems-apart</a><br />
<a href="http://www.daedtech.com/tdd-for-breaking-problems-apart-2-magic-boxes" rel="nofollow">http://www.daedtech.com/tdd-for-breaking-problems-apart-2-magic-boxes</a><br />
<a href="http://www.daedtech.com/tdd-for-breaking-problems-apart-3-finishing-up" rel="nofollow">http://www.daedtech.com/tdd-for-breaking-problems-apart-3-finishing-up</a> ), or Mark Seemann&#8217;s blog (yeah, still .Net, it&#8217;s currently my working environment. But with a bit of search you&#8217;ll find examples in your favorite language easily I think. TDD is well implanted in open source communities and amongst technical writers).<br />
And for anybody who doesn&#8217;t think that would suit him or can&#8217;t find the benefits, I&#8217;m fine with that, I&#8217;m not an integrist, so no need troll me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott A. Tovey</title>
		<link>http://www.brandonsavage.net/when-to-write-bad-code/#comment-7183</link>
		<dc:creator>Scott A. Tovey</dc:creator>
		<pubDate>Fri, 08 Feb 2013 05:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=2081#comment-7183</guid>
		<description><![CDATA[@Gates VP

Ahhh. So my natural tendency to run like a pack of wild dogs are chasing me when I hear new fangled, ambiguous and non descript terms that didn&#039;t exist 10 years ago and is put forth as the the greatest programming secret ever discovered is a good thing?

It seems to me that Test Driven Development, a term I just recently started reading about, like in the last couple months or so, should be a natural occurrence when one is debugging code and wondering why al gore won&#039;t get his rhythm out of the way so the thing will work.

Sorry, that just popped into my head and shot out my fingers.
I couldn&#039;t help it, the humor made me do it.

At any rate, several years of crewel hardship has taught me that those who speak of mysteries that they cannot explain plainly;  are either lying through their teeth or, or... No no, that&#039;s it; they&#039;re lying through their teeth.

So, until I get a good break down of what Test Driven Development is all about, a term by the way that was not spoken in any of the programming classes I took over the past few years, I will dismiss it as egotistical stupidity put forth by insecure programmers who have an uncontrollable urge to be seen as far more intelligent than they actually are.

Note: I don&#039;t mind new terms if they clarify a theory or come with clarifying explanations. But it seems like every time I turn around there is this new term or phrase that is describing something that is already defined, and put forth as being better than the predecessor when it almost invariably turns out to not be any better than the predecessor, and brings into the mix more complications that tend to break good clean working code. 

It&#039;s one of the reasons I stopped pursuing programming. After several years of health issues, and getting chest pains whenever I&#039;m stressed out, I just don&#039;t need that kind of frustration.]]></description>
		<content:encoded><![CDATA[<p>@Gates VP</p>
<p>Ahhh. So my natural tendency to run like a pack of wild dogs are chasing me when I hear new fangled, ambiguous and non descript terms that didn&#8217;t exist 10 years ago and is put forth as the the greatest programming secret ever discovered is a good thing?</p>
<p>It seems to me that Test Driven Development, a term I just recently started reading about, like in the last couple months or so, should be a natural occurrence when one is debugging code and wondering why al gore won&#8217;t get his rhythm out of the way so the thing will work.</p>
<p>Sorry, that just popped into my head and shot out my fingers.<br />
I couldn&#8217;t help it, the humor made me do it.</p>
<p>At any rate, several years of crewel hardship has taught me that those who speak of mysteries that they cannot explain plainly;  are either lying through their teeth or, or&#8230; No no, that&#8217;s it; they&#8217;re lying through their teeth.</p>
<p>So, until I get a good break down of what Test Driven Development is all about, a term by the way that was not spoken in any of the programming classes I took over the past few years, I will dismiss it as egotistical stupidity put forth by insecure programmers who have an uncontrollable urge to be seen as far more intelligent than they actually are.</p>
<p>Note: I don&#8217;t mind new terms if they clarify a theory or come with clarifying explanations. But it seems like every time I turn around there is this new term or phrase that is describing something that is already defined, and put forth as being better than the predecessor when it almost invariably turns out to not be any better than the predecessor, and brings into the mix more complications that tend to break good clean working code. </p>
<p>It&#8217;s one of the reasons I stopped pursuing programming. After several years of health issues, and getting chest pains whenever I&#8217;m stressed out, I just don&#8217;t need that kind of frustration.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gates VP</title>
		<link>http://www.brandonsavage.net/when-to-write-bad-code/#comment-7093</link>
		<dc:creator>Gates VP</dc:creator>
		<pubDate>Mon, 04 Feb 2013 20:03:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=2081#comment-7093</guid>
		<description><![CDATA[&lt;b&gt;@Scott Tovey&lt;/b&gt;

&lt;i&gt;One almost always knows what the desired output is...&lt;/i&gt;

You nailed. The OP talked about starting without a plan and without tests.

But if you know the outputs and (&lt;i&gt;ostensibly&lt;/i&gt;) the inputs. Then you &lt;i&gt;do&lt;/i&gt; have a test. If you know how the inputs are coming and you know where the outputs are going, then that &lt;i&gt;is&lt;/i&gt; a plan.

So clearly, the whole premise here is flawed. The OP knew what he wanted out of this system. Sure, the underlying structures may have been crummy, but this is almost universally true. This is why UML is often just &quot;crap&quot;. The most you get out of UML is a reasonable tracking of the data that needs to exist at some point in time.

The first run of code is always about making that code &quot;work&quot; and pass all of the basic tests. Future runs of the code center around handling exceptions, improving performance or cleaning up the basic API to access that component.

I think the OP has some warped image of &quot;the right way&quot;. The premise that there is some &quot;right way&quot; involving tremendous amounts of planning and no code has been disproven for years.

We are always going to build software in these little increments of inputs and outputs. And those inputs/outputs &lt;i&gt;are&lt;/i&gt; tests and they &lt;i&gt;are&lt;/i&gt; plans. The code you write &lt;i&gt;is&lt;/i&gt; a design and it &lt;i&gt;is&lt;/i&gt; an architecture.]]></description>
		<content:encoded><![CDATA[<p><b>@Scott Tovey</b></p>
<p><i>One almost always knows what the desired output is&#8230;</i></p>
<p>You nailed. The OP talked about starting without a plan and without tests.</p>
<p>But if you know the outputs and (<i>ostensibly</i>) the inputs. Then you <i>do</i> have a test. If you know how the inputs are coming and you know where the outputs are going, then that <i>is</i> a plan.</p>
<p>So clearly, the whole premise here is flawed. The OP knew what he wanted out of this system. Sure, the underlying structures may have been crummy, but this is almost universally true. This is why UML is often just &#8220;crap&#8221;. The most you get out of UML is a reasonable tracking of the data that needs to exist at some point in time.</p>
<p>The first run of code is always about making that code &#8220;work&#8221; and pass all of the basic tests. Future runs of the code center around handling exceptions, improving performance or cleaning up the basic API to access that component.</p>
<p>I think the OP has some warped image of &#8220;the right way&#8221;. The premise that there is some &#8220;right way&#8221; involving tremendous amounts of planning and no code has been disproven for years.</p>
<p>We are always going to build software in these little increments of inputs and outputs. And those inputs/outputs <i>are</i> tests and they <i>are</i> plans. The code you write <i>is</i> a design and it <i>is</i> an architecture.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott A. Tovey</title>
		<link>http://www.brandonsavage.net/when-to-write-bad-code/#comment-7082</link>
		<dc:creator>Scott A. Tovey</dc:creator>
		<pubDate>Sat, 02 Feb 2013 21:11:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=2081#comment-7082</guid>
		<description><![CDATA[@Gates VP

&gt;&gt;&gt;
If you had no tests, how did you know it worked?
&gt;&gt;&gt;

That&#039;s the difference between those who are book smart,
and those of us who can look at a problem, and think 
our way through to a solution.

Not everything that is written on paper works. Not
everything that is written on paper is accurate.

You can start working on a procedure that in your mind
should work but it doesn&#039;t. How do you know that, because
you do have an idea of what the output should be. One 
almost always knows what the desired output is, one just
does not always know exactly how to get there. That is
what this article is about. A situation where a problem
that was not previously encountered and therefore none
of the previously written code applied.

That&#039;s when you just start writing code. One function 
at a time. It&#039;s a step by step process to determine
the solution to the problem. Planning can&#039;t help you
because you just don&#039;t know where to start. And since
your the only one on the project, you have no one to 
do a back and forth discussion to get the ideas out.

I find it more difficult to try and plan out every nuance 
regarding a program. But, if I sit down and just start
coding, the process of doing it turns into a step by 
step, inspiration after inspiration resolution to the
problem.

I had a class where I was supposed to do a UML and all that 
nifty planning you talk about. After trying to figure it out
for way to long that way, I just sat down and did the work
and then fished out the UML from there.

The mindset that I hear from so called professional coders 
is no different from the mindset of those who criticized
and mocked Henry Ford because of his ignorance of history.
The man thought the Revolution happened in 1812.

OK, so the guy only had an 8 grade education from the 
establishment&#039;s point of view. As if that is more important 
than the progress he made with the Automobile, creating 
the middle class by turning his employees into potential 
customers and the many other things he accomplished.

Certainly the man had a lot of negatives like the 
insistence on taking credit for other peoples work
and ideas and the unfair and cruel way he treated 
his only son Edsel Ford. But the things the establishment 
criticized him for were not; in the grand scheme of 
things; all that important. 

So the revolution happened in 1776. But seriously,
are you going to keep a man in the poor house because
he mistakenly thinks it occurred in 1812? Do you hire
a programmer for his knowledge of history or his ability
to code?]]></description>
		<content:encoded><![CDATA[<p>@Gates VP</p>
<p>&gt;&gt;&gt;<br />
If you had no tests, how did you know it worked?<br />
&gt;&gt;&gt;</p>
<p>That&#8217;s the difference between those who are book smart,<br />
and those of us who can look at a problem, and think<br />
our way through to a solution.</p>
<p>Not everything that is written on paper works. Not<br />
everything that is written on paper is accurate.</p>
<p>You can start working on a procedure that in your mind<br />
should work but it doesn&#8217;t. How do you know that, because<br />
you do have an idea of what the output should be. One<br />
almost always knows what the desired output is, one just<br />
does not always know exactly how to get there. That is<br />
what this article is about. A situation where a problem<br />
that was not previously encountered and therefore none<br />
of the previously written code applied.</p>
<p>That&#8217;s when you just start writing code. One function<br />
at a time. It&#8217;s a step by step process to determine<br />
the solution to the problem. Planning can&#8217;t help you<br />
because you just don&#8217;t know where to start. And since<br />
your the only one on the project, you have no one to<br />
do a back and forth discussion to get the ideas out.</p>
<p>I find it more difficult to try and plan out every nuance<br />
regarding a program. But, if I sit down and just start<br />
coding, the process of doing it turns into a step by<br />
step, inspiration after inspiration resolution to the<br />
problem.</p>
<p>I had a class where I was supposed to do a UML and all that<br />
nifty planning you talk about. After trying to figure it out<br />
for way to long that way, I just sat down and did the work<br />
and then fished out the UML from there.</p>
<p>The mindset that I hear from so called professional coders<br />
is no different from the mindset of those who criticized<br />
and mocked Henry Ford because of his ignorance of history.<br />
The man thought the Revolution happened in 1812.</p>
<p>OK, so the guy only had an 8 grade education from the<br />
establishment&#8217;s point of view. As if that is more important<br />
than the progress he made with the Automobile, creating<br />
the middle class by turning his employees into potential<br />
customers and the many other things he accomplished.</p>
<p>Certainly the man had a lot of negatives like the<br />
insistence on taking credit for other peoples work<br />
and ideas and the unfair and cruel way he treated<br />
his only son Edsel Ford. But the things the establishment<br />
criticized him for were not; in the grand scheme of<br />
things; all that important. </p>
<p>So the revolution happened in 1776. But seriously,<br />
are you going to keep a man in the poor house because<br />
he mistakenly thinks it occurred in 1812? Do you hire<br />
a programmer for his knowledge of history or his ability<br />
to code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mario Gleichmann</title>
		<link>http://www.brandonsavage.net/when-to-write-bad-code/#comment-7046</link>
		<dc:creator>Mario Gleichmann</dc:creator>
		<pubDate>Fri, 01 Feb 2013 15:56:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=2081#comment-7046</guid>
		<description><![CDATA[There&#039;s an &#039;old&#039; saying - it goes something like this:

1st - make it work
2nd - make it right
3rd - make it fast]]></description>
		<content:encoded><![CDATA[<p>There&#8217;s an &#8216;old&#8217; saying &#8211; it goes something like this:</p>
<p>1st &#8211; make it work<br />
2nd &#8211; make it right<br />
3rd &#8211; make it fast</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gates VP</title>
		<link>http://www.brandonsavage.net/when-to-write-bad-code/#comment-7036</link>
		<dc:creator>Gates VP</dc:creator>
		<pubDate>Fri, 01 Feb 2013 08:29:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=2081#comment-7036</guid>
		<description><![CDATA[You say the following:&lt;i&gt;... I started working – without a plan, without writing tests, without designing an architecture, and without really knowing how the component was going to end up...&lt;/i&gt;

And then the following sentence you say that you &quot;got it working&quot;.

&lt;b&gt;If you had no tests, how did you know it worked?&lt;/b&gt;]]></description>
		<content:encoded><![CDATA[<p>You say the following:<i>&#8230; I started working – without a plan, without writing tests, without designing an architecture, and without really knowing how the component was going to end up&#8230;</i></p>
<p>And then the following sentence you say that you &#8220;got it working&#8221;.</p>
<p><b>If you had no tests, how did you know it worked?</b></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: giantism_strikes</title>
		<link>http://www.brandonsavage.net/when-to-write-bad-code/#comment-7009</link>
		<dc:creator>giantism_strikes</dc:creator>
		<pubDate>Thu, 31 Jan 2013 13:33:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=2081#comment-7009</guid>
		<description><![CDATA[@Jasmine - Your argument is bad and you should feel bad.

My background is this: BS in CS, MS in CS, and 7 years of programming being my only source of income. During this time I have written government tax software, written medical research software, worked with the FDA on creating digital models for medical research, and worked in the DoD. In a few weeks, I am switching to R&amp;D of surgical equipment. The point is that I have had plenty of real world experience across a wide range of businesses.

A good programmer can look at a problem and see how design patterns can be used. &quot;Just getting it done&quot; leads to horrible code libraries, non-reusable code, and difficult maintenance.]]></description>
		<content:encoded><![CDATA[<p>@Jasmine &#8211; Your argument is bad and you should feel bad.</p>
<p>My background is this: BS in CS, MS in CS, and 7 years of programming being my only source of income. During this time I have written government tax software, written medical research software, worked with the FDA on creating digital models for medical research, and worked in the DoD. In a few weeks, I am switching to R&amp;D of surgical equipment. The point is that I have had plenty of real world experience across a wide range of businesses.</p>
<p>A good programmer can look at a problem and see how design patterns can be used. &#8220;Just getting it done&#8221; leads to horrible code libraries, non-reusable code, and difficult maintenance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ahwan Radi</title>
		<link>http://www.brandonsavage.net/when-to-write-bad-code/#comment-6988</link>
		<dc:creator>Ahwan Radi</dc:creator>
		<pubDate>Thu, 31 Jan 2013 07:24:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=2081#comment-6988</guid>
		<description><![CDATA[Thank you. I have been there too, a lot. And I always chose &quot;my application should work&quot; over &quot;my application should have a beautiful coding&quot;.]]></description>
		<content:encoded><![CDATA[<p>Thank you. I have been there too, a lot. And I always chose &#8220;my application should work&#8221; over &#8220;my application should have a beautiful coding&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Sutton</title>
		<link>http://www.brandonsavage.net/when-to-write-bad-code/#comment-6967</link>
		<dc:creator>Dan Sutton</dc:creator>
		<pubDate>Wed, 30 Jan 2013 21:55:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=2081#comment-6967</guid>
		<description><![CDATA[No - I don&#039;t care about that. As long as the code is logical and constructed properly - and uses a decent algorithm - then I&#039;m fine with it...]]></description>
		<content:encoded><![CDATA[<p>No &#8211; I don&#8217;t care about that. As long as the code is logical and constructed properly &#8211; and uses a decent algorithm &#8211; then I&#8217;m fine with it&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ANonymous Coward</title>
		<link>http://www.brandonsavage.net/when-to-write-bad-code/#comment-6963</link>
		<dc:creator>ANonymous Coward</dc:creator>
		<pubDate>Wed, 30 Jan 2013 21:29:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=2081#comment-6963</guid>
		<description><![CDATA[When to write bad code ... like never?

IMO/IME it&#039;s programmers for which writing good code doesn&#039;t come natural who use various excuses to write bad code. Once you get used to writing your code properly from the first version, it&#039;s faster and more reliable to just always write good code.

I never could understand the justification that under time/deadline pressure you have to write bad code, or give up unit testing. That&#039;s precisely the right recipe for being late.]]></description>
		<content:encoded><![CDATA[<p>When to write bad code &#8230; like never?</p>
<p>IMO/IME it&#8217;s programmers for which writing good code doesn&#8217;t come natural who use various excuses to write bad code. Once you get used to writing your code properly from the first version, it&#8217;s faster and more reliable to just always write good code.</p>
<p>I never could understand the justification that under time/deadline pressure you have to write bad code, or give up unit testing. That&#8217;s precisely the right recipe for being late.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced (User agent is rejected)
Object Caching 635/646 objects using apc
Content Delivery Network via Amazon Web Services: S3: brandonsavage-net-files.s3.amazonaws.com

 Served from: www.brandonsavage.net @ 2013-05-22 09:37:29 by W3 Total Cache -->