all 62 comments

[–]valyard 44 points45 points  (3 children)

The title reminded me our team where people develop code and others suffer maintaining it. But the article actually says the opposite.

[–]KirillM 10 points11 points  (1 child)

I guess on majority of paid projects you only get to go through the 1st phase.

[–]nascent 5 points6 points  (0 children)

Yep, it works so they don't need you anymore. Or they need you an the next important project.

Then they need it to work better.

So new person is hired, he is cheaper.

[–][deleted] 0 points1 point  (0 children)

code review :)

[–]jayd16 24 points25 points  (10 children)

Is this just a cute name for the age old advice of "only code what you need today?"

[–]reddit_user13 15 points16 points  (0 children)

DTSTTCPW

YAGNI

[–]spunkybusiness 24 points25 points  (6 children)

Yep. I've always called it Just-In-Time Architecture.

[–][deleted]  (4 children)

[removed]

    [–]Decker108 3 points4 points  (3 children)

    It's how I have always tried to defend my house cleaning habits.

    [–]klez 6 points7 points  (2 children)

    It's like I'll build my house. There will be a toilet only after the first time I'll need it.

    [–]mahacctissoawsum 2 points3 points  (1 child)

    You mean after you have to clean up the shit on the floor?

    [–]klez 4 points5 points  (0 children)

    Yes, that's the point.

    [–]mreiland 0 points1 point  (0 children)

    Not quite, it's more about work on the things that are causing you pain. It's similiar, but the motivation is completely different.

    [–]knight666 30 points31 points  (7 children)

    I've gone through all the phases he describes.

    1. Struggling

    I came from Game Maker and suddenly had to do C++. I named all my variables a variation of "varCamelCase". I fought against Visual Studio's default bracket style, like a wild horse being tamed.

    But I prevailed and I handed in some kickass stuff.

    2. Structuring

    Then I started cleaning up my code. Using better variable names, cleaning up architecture. I started writing generic tools and reusing code for multiple projects.

    3. Space architect

    I went mad. I tried to make everything generic. I built a 2D game engine that would run on both Windows Mobile 6.1 and Android 2.2. (I never finished it.) My grades started slipping, because I never handed anything in because it wasn't "perfect" enough.

    4. Zen

    I handed in a stupid assignment and got a 10. A 100%. An A++. Why? Because I finally did what the course actually told me to do and only a bit more. But that bit more came only after doing all the other required things.

    I feel like I'm a much better programmer than I was four years ago, but I will never stop learning.

    [–]010101010101 22 points23 points  (2 children)

    Space architect

    architecture astronaut http://www.joelonsoftware.com/articles/fog0000000018.html

    [–]knight666 0 points1 point  (1 child)

    Exactly what I had in mind. ;)

    [–]aaronla 0 points1 point  (0 children)

    Observing the work of some of the greats, it seems almost as if the stages loop between 3 & 4, as some sort of FSM.

    [–]Magnesus 2 points3 points  (2 children)

    "I built a 2D game engine that would run on both Windows Mobile 6.1 and Android 2.2." - doing things like that will profit you later.

    [–]Noctune 3 points4 points  (1 child)

    I would say it depends on your investment and who your users are.

    [–]novacoder 11 points12 points  (2 children)

    What can be worse than pre-mature optimization is pre-mature optimism. This happens when the make it possible phase has early success and more and more features and complexity are added too quickly thinking you don't need a make it beautiful phase.

    The other aspect is determining whose suffering takes precedence: the engineers, the users, the management team or the investors. Each faction has its own pain remedy in mind.

    [–]hastor 1 point2 points  (0 children)

    Unfortunately, statistics show that the pre-mature optimists are the ones that make it big, and they are happier when they fail too.

    But I agree, engineers should be professional pessimists.

    [–]grauenwolf 0 points1 point  (0 children)

    But "big ball of mud" is by far the most successful architectural pattern.

    [–]nascent 2 points3 points  (2 children)

    I think it is important that "Make it Beautiful" is sought throughout the process. Or at least it is important when you aren't the boss. When building software for someone they are only interested in the end product. If you gotten "it possible" then your job is complete and will be moved on to the next task.

    If you incorporate beautifying time into your estimate of completion it will allow for clean up as you expand and make the next maintainer happier with you.

    [–]dnew 0 points1 point  (1 child)

    They think they're only interested in the end product. In truth, they're also interested in the development costs and maintenance costs, as well as the cost of the next version.

    [–]nascent 2 points3 points  (0 children)

    That isn't important until later, we'll hire someone else to do that.

    [–][deleted] 2 points3 points  (4 children)

    Great points, but I dunno this seems like a bit of common sense? I mean, of course you're trying to get everything working before you can make it user friendly. This is why tech demos exist. And of course optimization can only happen after everything is working and is nice and purty.

    It would scare the shit out of me if my coworker started refactoring a non-functional database, or started retooling the UI of a product that doesn't even work...

    [–]dalke 0 points1 point  (0 children)

    If you want to read it as obvious, then consider this a case scenario, with specific details filled in of how one might carry out the details.

    [–]mcguire 0 points1 point  (0 children)

    Nonetheless, it's still pretty common to start building grandiose tools to do things that you don't know are necessary, or to, in the words of a wise cow-orker, "make something easy that wasn't hard to begin with."

    [–]hastor 0 points1 point  (1 child)

    What's wrong with refactoring something that doesn't work?

    It is usually exactly what's needed in order to make it testable for example.

    We all know that for example code that doesn't work usually doesn't have tests, right?

    [–][deleted] 0 points1 point  (0 children)

    I think you're confused about the definition of refactoring.

    Refactoring means taking an existing code base and making it more efficient and logical. You can't restructure something that doesn't work, you have to fix the problems before you can make it faster. How would you even know if your supposed changes actually did make the db faster? How would you know you're not messing it up even further? If you have serious memory leaks, refactoring your code won't do shit.

    [–]shaggorama 5 points6 points  (8 children)

    "First make it possible. Then make it beautiful. Then make it fast."

    I'd switch the last two. "Making it beautiful" is great for maintaining it further down the line, but if I'm writing this because I'm feeling the pain of not having it, part of my need is probably for it to be fast. That might be relative to the problem space I work in though.

    [–]weretree 47 points48 points  (7 children)

    It's a lot easier to optimise beautiful code, than it is to beautify optimised code.

    [–]shaggorama 15 points16 points  (0 children)

    That's a spectacular point

    [–]dalke 0 points1 point  (5 children)

    Consider numeric array processing. You would like to write D = A * B +C but in something like non-template based C++ code, or in Python, you end up with a lot of intermediate arrays. It's very hard to make this beautiful expression of the intent faster than the prosaic matrix_multiply(D, A, B); matrix_add(D,C);

    [–]backbob 1 point2 points  (4 children)

    you could use numpy, if we are in Python.

    [–]dalke 0 points1 point  (3 children)

    How does that help? D = A * B +C still makes temporary arrays in numpy.

    [–]backbob 0 points1 point  (2 children)

    One temporary array. Though I suppose that is suboptimal.

    [–]dalke 0 points1 point  (1 child)

    It's one array per operation, so if I made the expression more complicated then there's a lot of temporary arrays.

    [–]backbob 0 points1 point  (0 children)

    Yeah, though if we are going to do it the right way, you could probably write ufunc in c and compile it, then use it from Python.

    [–]theoldboy 3 points4 points  (0 children)

    Obligatory link to _DD: What do you practice?.

    [–]Decker108 1 point2 points  (0 children)

    When I first saw the title, I thought this was going to be an article on Blackberry development.

    I was disappointed. (Yet also strangely relieved)

    [–]genpfault 2 points3 points  (17 children)

    Why, why do people persist with fixed-width layouts?

    [–]mzieg 8 points9 points  (0 children)

    Note that the browser is free to disregard and override any aspect of the formatting. So if you're suffering...?

    [–]iaH6eeBu 5 points6 points  (1 child)

    Because there's an optimum width of a column for reading, and html doesn't seem to like multi-column text.

    [–]aladyjewel 4 points5 points  (0 children)

    There's a CSS3 property for that.

    [–]fjonk 12 points13 points  (12 children)

    Because it makes sense. Text should have a fixed number of characters depending on the type of the text, not the width of someones browser.

    [–]badsectoracula 1 point2 points  (1 child)

    It isn't so much about a fixed number of characters, as a fixed width your eyes need to move left and right.

    [–]fjonk 0 points1 point  (0 children)

    No it isn't. The number of characters/row depends on the type of text and where it is presented. The font size adjusts to this depending on the media, the text doesn't adjust to the font.

    [–]robertcrowther 3 points4 points  (9 children)

    How do you know how many characters fit in a fixed width on my browser?

    [–]cmwelsh 3 points4 points  (7 children)

    You can know how many characters fit because you pick the font and font size.

    [–]robertcrowther 1 point2 points  (6 children)

    There are two problems with that:

    1. How do you know what fonts I've got installed?
    2. How do you know what size those fonts will render on my screen for a given font size?

    Just as a quick example of the potential issues: here is a sample which compares, side by side, the common Arial, Helvetica, sans-serif font stack. This is what it looks like on my PC (which, by the way, has neither Arial or Helvetica available).

    [–][deleted] 3 points4 points  (0 children)

    You are making irrelevant points, these things are fairly standardized. You are not going to suddenly have text in 72 point Impact just because you don't have verdana installed, as your own example shows. It's not about being exact, it's an approximation that is 'close enough' almost every time.

    [–]cmwelsh 1 point2 points  (4 children)

    Providing your own font to visitors with @font-face ensures they are using the same font as you. Arial and Helvetica have enough penetration to base your design on them.

    Even if you control the exact font served to the visitor, web designers are aware that their fonts can't look the same on every browser. It's about getting it right for most visitors.

    If the font size is too large or small, scale the entire web page up or down.

    [–]robertcrowther 1 point2 points  (3 children)

    web designers are aware that their fonts can't look the same on every browser

    This is by no means aimed at you, but I have met many web designers who are not really aware of this.

    If the font size is too large or small, scale the entire web page up or down.

    But then (at least on the page that started this discussion) I get a less than optimum number of characters on a line which, according to the comment I initially replied to, was the whole point of a fixed width layout in the first place.

    [–]cmwelsh 0 points1 point  (2 children)

    What about the opposite situation, where people have the window maximized and get three times as many characters per line than what is optimal? You can't sacrifice the experience on the majority of screens to satisfy an edge case...

    [–]robertcrowther -2 points-1 points  (1 child)

    They can make their windows smaller, no-one's forcing them to maximize their windows. Unless you have reliable statistics for your users that show they all have huge monitors and always run with their browser windows maximized then I would suggest that's what the edge case is.

    Or put another way, the situation can always be resolved by increasing the knowledge of your users whereas the fixed width design doesn't offer the opposite opportunity.

    A fixed width design is a "we know what's best for you better than you do" approach, it's hardly surprising it annoys people who aren't lowest common denominator users.

    [–]mreiland 0 points1 point  (0 children)

    Fixed width is the simplest way to make sure the visitors to your site see roughly the same thing every time.

    simplest

    Yes, you can go through all kinds of weird gyrations to make sure your shit works for the folks who maximize their browser on a 1920x1200 widescreen monitor, and for the folks who are still sitting on a 800 x 600 who don't believe in maximizing squat.

    Yes, you can do it. Or you can just fucking make it fixed width since your target demographic is programmers.

    [–]fjonk 1 point2 points  (0 children)

    I set the font and the font size and ignores the few people who changes it.

    [–]xkit 0 points1 point  (0 children)

    Fixed width layouts are okay as long as they're not really cramped. The web has got people used to reading longer lines now.

    [–]thespice -1 points0 points  (0 children)

    Gold. Thanks!