Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Programming

Toward Better Programming 391

An anonymous reader writes "Chris Granger, creator of the flexible, open source LightTable IDE, has written a thoughtful article about the nature of programming. For years, he's been trying to answer the question: What's wrong with programming? After working on his own IDE and discussing it with hundreds of other developers, here are his thoughts: 'If you look at much of the advances that have made it to the mainstream over the past 50 years, it turns out they largely increased our efficiency without really changing the act of programming. I think the reason why is something I hinted at in the very beginning of this post: it's all been reactionary and as a result we tend to only apply tactical fixes. As a matter of fact, almost every step we've taken fits cleanly into one of these buckets. We've made things better but we keep reaching local maxima because we assume that these things can somehow be addressed independently. ... The other day, I came to the conclusion that the act of writing software is actually antagonistic all on its own. Arcane languages, cryptic errors, mostly missing (or at best, scattered) documentation — it's like someone is deliberately trying to screw with you, sitting in some Truman Show-like control room pointing and laughing behind the scenes. At some level, it's masochistic, but we do it because it gives us an incredible opportunity to shape our world.'"
This discussion has been archived. No new comments can be posted.

Toward Better Programming

Comments Filter:
  • by null etc. ( 524767 ) on Friday March 28, 2014 @06:11PM (#46606747)

    In my 25 years of professional programming experience, I've noticed that most often, most programming problems are caused by improper implementations of the separation of unrelated concerns, and coupling of related concerns. Orthogonality is difficult to achieve in many programming exercises, especially regarding cross-cutting concerns, and sometimes the "right" way to code something is tedious and unusable, involving passing state down through several layers of method parameters.

  • by Anonymous Coward on Friday March 28, 2014 @06:12PM (#46606753)

    Or.....

    Maybe software development is just hard and you need to be a rocket scientist to see it.

  • Proverb (Score:1, Insightful)

    by Anonymous Coward on Friday March 28, 2014 @06:14PM (#46606769)

    Something something blames his tools.

  • Balance (Score:5, Insightful)

    by MichaelSmith ( 789609 ) on Friday March 28, 2014 @06:23PM (#46606843) Homepage Journal

    Better tools and languages just allow bad programmers to create more bad code.

  • pft. (Score:5, Insightful)

    by HeckRuler ( 1369601 ) on Friday March 28, 2014 @06:26PM (#46606863)

    What is programming?

    The answers I got to this were truly disheartening. Not once did I hear that programming is “solving problems."

    I'd like to think that's because the majority of programmers (not once? Does that mean all of us?) aren't the sort to bullshit you with CEO-level bullshit about vision and buzzwords that fit into powerpoint slides.
    It's probably not true, but it's a nice dream.

    The problem with defining programming as "solving problems" is that it's too vague. Too high level. You can't even see the code when you're that high up. Hitting nails with hammers could be problem solving. Shooting people could be problem solving. Thinking about existential crisis could be problem solving.

    The three buckets:
    Programming is unobservable - you don't know what something is really going to do.
    Programming is indirect - code deals with abstractions.
    Programming is incidentally complex - the tools are a bitch

    Something something, he doesn't like piecemeal libraries abstracting things. "Excel is programming". Culture something.

    The best path forward for empowering people is to get computation to the point where it is ready for the masses.

    We're there dude. We've got more computational power than we know what to do with.
    Cue "that's not what I meant by 'power'".

    What would it be like if the only prerequisite for getting a computer to do stuff was figuring out a rough solution to your problem?

    Yep, he's drifting away into a zen-like state where the metaphor is taking over. Huston to Chris, please attempt a re-entry.

    AAAAAAAAnd, it's a salespitch:

    Great, now what?

    We find a foundation that addresses these issues! No problem, right? In my talk at Strange Loop I showed a very early prototype of Aurora, the solution we've been working on to what I've brought up here.

  • by Doofus ( 43075 ) on Friday March 28, 2014 @06:37PM (#46606915)
    Not clear to me that his is a viable objective. 80% of the masses do not think like programmers. Some might be trainable. Some, not so much. Many will not want to think the way problem-solving in code requires. I'm not sure how to quantify it, but the amount of effort expended on a project like this may not see an appropriate payback.

    Even if we change the environment and act of "coding", the problem-solving itself still requires clear thinking and it *probably* always will.
  • by Anonymous Coward on Friday March 28, 2014 @06:41PM (#46606925)

    No matter how flexible an architecture you try to design, after the software is mostly built, customers will correspondingly come up with even more incredibly bizarre, complex and unrelated functionality that just HAS to be integrated at the oddest points, with semi-related information thrown here and there, requiring data gathering (or - god forbid, (partial) saving) that slows everything down to a halt. And they rarely give much time to do redesign or refactoring. What was once a nice design, with clean, readable code is now full of gotchas, barely commented kludges, extra optional parameters that might swim around multiple layers, often depending on who called what, when, and from where, and also on various settings, which obviously are NEVER included in bug reports. Of course, there are multiple installations running multiple versions...

  • by Anonymous Coward on Friday March 28, 2014 @06:42PM (#46606937)

    Programming is hard because we only call it programming when it's hard enough that only programmers can do it. Scientists do stuff in Mathematica, MBAs in Excel, or designers in Flash/HTML, that would have been considered serious programming work 30 years ago. The tools advanced so that stuff is easy, and nobody calls it programming now.

    Lots of stuff that takes real programmers now will, in 20 years, likely be done by equivalents of Watson. And the real programmers will still be wondering why is so hard.

  • Re:Proverb (Score:5, Insightful)

    by lgw ( 121541 ) on Friday March 28, 2014 @07:02PM (#46607011) Journal

    Something something blames his tools.

    The point of that proverb is that a good craftsman chose his tools to begin with, so he has only himself to blame. Programming is odd in that you have bad toolchains forced on you by management - tools you know are bad, know will cause more problems than their worth, but they're a corporate standard or some such BS. Usually not bad enough to be worth quitting over, so you hobble along.

    Of course, I did quit a job once primarily because we had Rational Rose forced on us from above (but mostly because a management that would do that would do anything).

  • by Joce640k ( 829181 ) on Friday March 28, 2014 @07:05PM (#46607023) Homepage

    The reason it doesn't change is because the "coding" is the easy part of programming.

    No programming language or IDE is ever going to free you from having to express your ideas clearly and break them down into little sequences of instructions. In a big project this overshadows everything else.

    Bad foundations? Bad design? The project is doomed no matter how trendy or modern your language/IDE is.

  • by lgw ( 121541 ) on Friday March 28, 2014 @07:22PM (#46607117) Journal

    No amount of training wheels is going to make complex programming significantly easier.

    True enough, but I could do without the razor blades on the seat and handles. But my complaints are generally with the toolchain beyond the code. I so often get forced to use tools that are just crap, or tools that are good but poorly implemented. Surely it's mathematically possible to have a single good, integrated system that does source control with easy branch-and-merge, bug and backlog tracking and management, and code reviews, and test automation and testcase tracking, and that doesn't look and perform like an intern project!

    There are good point solutions to each of those problems, sure, but the whole process from "I think this fix is right and it's passed code review" to: the main branch has been built and tested with this fix in place, therefore the change has been accepted into the branch, therefore the bug is marked fixed and the code review closed, and there's some unique ID that links all of them together for future reference - that process should all be seamless, painless, and easy. But the amount of work that takes to tie all the good point products together, repeated at every dev shop, is just nuts, and usually half done.

  • Re:Proverb (Score:5, Insightful)

    by lgw ( 121541 ) on Friday March 28, 2014 @07:25PM (#46607131) Journal

    A good craftsman can get by with suboptimal tools.

    A good craftsman is not content to "get by", almost by definition. If some part of your workflow sucks, you make it better, whether that's a better tool or more skill/training. If you're good, you never stop improving (until management forces BS on you, of course).

  • Re: Pft. (Score:3, Insightful)

    by anonymous_wombat ( 532191 ) on Friday March 28, 2014 @07:31PM (#46607175)

    Shooting people could be problem solving

    Any idiot can shoot people. The expertise is in knowing how to dispose of the bodies.

  • by Jmc23 ( 2353706 ) on Friday March 28, 2014 @07:31PM (#46607179) Journal
    Perhaps you didn't understand the answer. It's pretty much 100% from both.
  • by Greyfox ( 87712 ) on Friday March 28, 2014 @08:11PM (#46607343) Homepage Journal
    After decades of wondering what's wrong with programming, did you ever stop to think that perhaps the problem... is you? If you don't like programming, why do you do it? I'm a programmer too, and I love it. I love making a thing and turning it on and watching it work as I designed it to. While other programmers wring their hands and wish they had a solution to a problem, I'll just fucking write the solution. I don't understand why they don't. They know the machine can perform the task they need and they know how to make the machine do things, but it never seems to occur to them to put those two things together. And I never, not even ONCE, asked why a playing card representation can't just look like a playing card. This despite having written a couple of playing card libraries.

    This guy seems to want an objects actions to be more apparent just from looking at the object, but he chose two rather bad examples. His math formula is as likely to look like gobbledygook to a non-math person as the program is. And the playing card has a fundamental set of rules associated with it that you still have to learn. You look at an ace of spades and you know that's an ace of spades, you know how it ranks in a poker hand, that it can normally be high or low (11 or 1) in blackjack or in a poker hand. But none of these things are obvious by looking at the card. If a person who'd never played cards before looked at it, he wouldn't know anything about it, either.

  • by Darinbob ( 1142669 ) on Friday March 28, 2014 @09:34PM (#46607611)

    There's the other meme that crops up now and then, that programming as an engineering skill should be similar to other engineering practices. That is you pick out pre-built components that have been thoroughly tested and optimally designed and screw them together. Except that this utterly fails, because that's now how engineering works at all really. Generally the pre-built components are relatively simple but the thing being built is the complex stuff and requires very detailed and specialized knowledge. The advent of integrated circuits did not mean that the circuit designer now doesn't have to think very much, or that a bridge builder only ties together pre-built components with nuts and bolts. So maybe they pick an op-amp out of a catalog, but they know exactly how these things work, understand the difference between the varieties of op-amps, and how to do the math to decide which one is best to use.

    However the programming models that claim to be following this model want to take extremely complex modules (a database engine or GUI framework) and then just tie them together with a little syntactic glue. Plus they strongly discourage any programmer from creating their own modules or blocks (that's only for experts), and insist on forcing the wrong module to fit with extra duct tape rather than create a new module that is a better fit (there's a pathological fear of reinventing the wheel, even though when you go to the auto store you can see many varieties of wheels). And these are treated like black boxes; the programmers don't know how they work inside or why one is better than another for different uses.

    Where I think this attitude is coming from is from an effort to treat programmers like factory workers. The goal is to hire people that don't have to think, thus they don't have to be paid as much, they don't have to have as much schooling, they can be replaced at a moment's notice by someone cheaper. So the requirement of low thinking is satisfied if all they need to do is simplistic snapping together of legos. That's part of the whole 4G language thing, they're not about making a smart programmer more productive by eliminating some tedium but instead they want to remove the need for a smart programmer altogether.

    (I certainly have never met any circuit designer or bridge architect bragging at parties that they skipped school because it was stupid and focused too much on math and theory, but that seems to be on the rise with younger programmers... Also have never seen any circuit designer say "I never optimize, that's a waste of my time.")

Suggest you just sit there and wait till life gets easier.

Working...