Live data from Hacker News

Too scared to write a line of code

medium.com

81–90 of 130 posts

Re: Too scared to write a line of code

#81
post #46

I don't know--my impression is that most people go to far in the other direction. They write code with no thought at all for the future, and then shortly have nightmarish debugging sessions in spaghetti code that's impossible to extend or reuse. All in the name of a rather extreme "worse is better" philosophy. I've certainly experienced this with some of the people I worked with recently. Anything you win in the shor…

If you write code too slowly, go faster. If you write code too quickly, go slower. You can tell if you're too slow when you've spent two weeks thinking about the program and have neither working code nor a detailed design, or if you've created a detailed design only to realize upon implementation you'd gone about it entirely the wrong way. You can tell if you're too fast if you find yourself spending more time cleani…

The problem that comes up is by the time you hit the tipping point of more cleaning then feature additions you end up having to do the fast solutions to fit deadlines.

I think when you take on the debt of poor code you have to remember that what it will take to fix that problem will continue to increase the longer you are away from that code.

Now I don't think you should consider fixing things for scale poor code that is it's own beast which makes the most sense to handle once you have the problem as you can't really tell what the problem will be until you have it.

Re: Too scared to write a line of code

#82

The Bad Guys want you to feel insecure about your work, your position, your relative standing, and everything else because their worst nightmare is that software engineers and scientists and thinkers wake up and realize how much leverage they would actually have if they were organized and capable of looking out for their own interests. We'd reshape the entire business landscape, and the power relationships between us…

I've been staring at your comment and I really can't figure out how to parse it. You're rambling like a crazy person and I can't tell why. Are these supposed to be real people? Some fake force you should use as motivation? Are you honestly saying people have 'nightmares about thinkers waking up'? And come on mailing lists to encourage flame wars?

Re: Too scared to write a line of code

#83
post #14

Earlier quoted context omitted.

Sometimes I'm surprised at the lack of parallels between writing long-form articles and writing code. How many people draw a general outline of their program, what they want each part to do, and how the whole thing should be layed out? Who plans before they start coding it?

Code is a planning language, so rather than boxes and noodles or pseudocode, I tend to sketch out my plans in code itself. In SICP this is called "design by wishful thinking": you pretend that you already have a library of primitives that do the nitty-gritty work and write the high-level bits of your program using those primitives. Then, you go back and implement the primitives. It's surprisingly effective.

This is also known as top-down design.

Re: Too scared to write a line of code

#84
post #27
post #10

Earlier quoted context omitted.

I think these types used to be derogatorily referred to as "cowboy coders" in the 90's by overly process oriented developers who came from an era of mainframes and punchcards. I think a big shift in modern software development came about when people finally realized that developing software is by nature a "messy" process. Loose text files, REPL sessions filled with red lines on the console, randomly scribbled boxes w…

Sadly that does not work in enterprise multi-site projects with outsourcing across several companies.

Yup; which is why the people getting hired for those projects would flounder if asked to make a large individual contribution without much handholding; and also why those types of project team structures yield such incomprehensibly shitty software (at ridiculous cost to the client.)

Re: Too scared to write a line of code

#85
post #69

Earlier quoted context omitted.

Really? From my experience the "Bad Guys" don't give a shit about code quality and will shower you with praise if you give them the crappiest code possible, as long as you make the changes they want 5 minutes ago. This article is really talking about the insecurity that other programmers inculcate, because we're all very smart and all very competitive.

The Bad Guys don't care about code quality, but they want programmers to be insecure. They do, however, play divide-and-conquer games against programmers and encourage our own cannibalism (e.g. long email flamewars about tabs vs. spaces) as well as that rockstar/ninja bullshit.

Wait, flamewars about spaces vs tabs are part of a conspiracy to keep programmers insecure and frightened? You'd better explain that remark.

Re: Too scared to write a line of code

#86

Earlier quoted context omitted.

Also kind of related - programming by "wishful thinking". You first lay out the flow of the program as calls to high level functions which don't yet exist, and then go back and fill in the functions as you can. The first few SICP video lectures are all about this style, and I found the idea simple but very useful to avoid trying to hold too much of a problem in your head at once.

TIL my programming modus operandi has a name. I also love writing high level function calls to functions that don't exist. It makes laying out the program much simpler and gives me a birds eye view of how easy it's going to be to maintain.

I've always heard it as top down development, as opposed to bottom up development. I always say that's what I'm going to do, and then end up not doing it.

Re: Too scared to write a line of code

#87
post #46

I don't know--my impression is that most people go to far in the other direction. They write code with no thought at all for the future, and then shortly have nightmarish debugging sessions in spaghetti code that's impossible to extend or reuse. All in the name of a rather extreme "worse is better" philosophy. I've certainly experienced this with some of the people I worked with recently. Anything you win in the shor…

How long have you been programming, and how many jobs have you had writing code in an actual business? Your profile says you're a student, so I'm curious how you can feel justified in writing such a thesis.

Personally, after 16 years in the industry, I do stress about my code as described in the article... Not about making it work, because that will happen regardless, but about how. It affects my ability to code, because "make it work" is far drowned out by "make it work the way your peers will accept it." Many times, that "acceptable" approach is something I find far less intuitive, and far less maintainable... Also, that approach has changed so many times over the years and with each different team, it's hard to keep track. I can build far more in a weekend, on my own terms, than I can build in a week by someone else's. I am not complaining... I actually like to learn those terms, and I enjoy it as long as people are constructive about it rather than condescending. It's trying to pre-determine those terms that is the block, for me.

Re: Too scared to write a line of code

#88
I write news articles in addition to code, and a fellow writer gave me a simple piece of advice that I think applies to both disciplines. It has to do with planning -- but not over-thinking -- your work.

Before you start writing, sit down with a friend in a bar and explain to him exactly what you're trying to say and do. If you can't communicate your idea in a concise, conversational way, then you're not ready to start writing.

Applied to code, I suppose this is similar to the concept of Rubber Ducky Debugging: http://en.wikipedia.org/wiki/Rubber_duck_debugging

Re: Too scared to write a line of code

#89

Earlier quoted context omitted.

The Bad Guys don't care about code quality, but they want programmers to be insecure. They do, however, play divide-and-conquer games against programmers and encourage our own cannibalism (e.g. long email flamewars about tabs vs. spaces) as well as that rockstar/ninja bullshit.

Wait, flamewars about spaces vs tabs are part of a conspiracy to keep programmers insecure and frightened? You'd better explain that remark.

Executives don't care about that specific flamewar (or even know that it exists) but they like creating environments where we slug each other over minor, superficial differences in coding style because (a) it makes us look stupid and petty, and (b) it tires us out and makes us even easier to steal from.

Programmers are often oblivious, when they find themselves in work environments that are designed to play divide-and-conquer games against them, to what is going on. Executives often enable/encourage the worst traits of programmers in order to weaken the group.

Re: Too scared to write a line of code

#90

Earlier quoted context omitted.

If you write code too slowly, go faster. If you write code too quickly, go slower. You can tell if you're too slow when you've spent two weeks thinking about the program and have neither working code nor a detailed design, or if you've created a detailed design only to realize upon implementation you'd gone about it entirely the wrong way. You can tell if you're too fast if you find yourself spending more time cleani…

This is like in go. If your walls are too brittle, play more conservatively. If your walls are too thick, loosen up. You can make generally better moves in go just by recognizing if you are too conservative or too aggressive. Same with poker.

meant to upvote you and downvoted by accident, just so you know
Post reply on HN