Slashdot Mirror


Fixing the Pain of Programming

An anonymous reader writes "Light Table is a Kickstarted, open source IDE that's been trying to integrate real-time feedback into code creation. Part of their process has been figuring out how to improve the practice of programming, from top to bottom. They've put up a post about the troublesome aspects of programming that we've learned to deal with and take for granted, but which need solving if programming is to be made accessible for more people. 'Surprisingly, one of the most common difficulties we have heard from beginners is just running code. Even if we were to hand [a new programmer the whole source code] they would likely still struggle to actually use it. They have to install dependencies, compile code, start servers and open ports. At each step the errors are difficult to diagnose and time-consuming to fix.' But these problems extend to experienced coders, too: 'The simplest question we could ask about our application is "what is the current state." Bizarrely, very few programming environments give you any help on this front. Many programmers get by with nothing but print statements.' It's interesting to see somebody working on these issues, instead of accepting that they're the status quo and just part of the experience of programming."

17 of 294 comments (clear)

  1. Debuggers by Anonymous Coward · · Score: 5, Insightful

    I suppose this is addressed by the old quote "What is the best language for x?"

    "I don't know. Which has the best debugger?"

    1. Re:Debuggers by InsertCleverUsername · · Score: 4, Insightful

      People that need debuggers will never be any good.

      People who work with trivially-simple applications and never have to deal with someone else's legacy mess will never be any good either.

      --
      Ask me about my sig!
    2. Re:Debuggers by ShanghaiBill · · Score: 3, Funny

      People who work with trivially-simple applications and never have to deal with someone else's legacy mess will never be any good either.

      People that never write embedded code, and never have to trigger the debugger when a particular voltage occurs on a particular pin in order to to track down a race condition caused by clock skew and/or misaligned asynchronous inputs to the FPGA, will never be any good either.

    3. Re:Debuggers by pla · · Score: 4, Insightful

      Because in my experience it's the "apprentices" that tend to lean far too heavily on printf, which is always taught before debuggers and is much easier to use.

      Our experiences differ somewhat drastically, then - Perhaps this involves a difference between the Windows world and the Linux world. In Linux, yes, knowing how to attach and use the standard debuggers counts as something of a fine skill set (though I don't think that still holds true like it used to - We have a hell of a lot more choices today than just GDB/DDD). In the Windows world, when the code breaks, the IDE throws you into a debugger and all but tells you what happened and what to do about it.


      Because Real Programmers build houses using only hammers. Nailguns, screwdrivers, shovels, and power tools are for pussies.

      Nice strawman, but no. Real programmers use power tools when appropriate. But when the sawzall won't fit in a tight space, the real programmer knows how to use a keyhole saw.

    4. Re:Debuggers by Nemyst · · Score: 4, Insightful

      If you think you're such a great programmer that you're never ever going to write bugs into the programs you write, you've probably never written anything larger than a few thousand lines, and you've probably never debugged what you wrote in the first place.

      Hint: outside of Hello World, bugs will happen. Debuggers are a great way of determining what the bug is so you can get on with fixing it, instead of acting like the hot programmer who doesn't need them but instead wastes an entire day combing through his code looking for that one error. Deciding that you're "above" some subset of tools available to you is childish at best.

    5. Re:Debuggers by pla · · Score: 3, Informative

      Communicating with, storing data in, retrieving data from, or otherwise intercepting and changing computer resources without consent is unauthorized access. It's against the law.

      I can't tell if it worries me more that you think I would try to debug code on a system I hacked into... Or that you've never heard of low-end web hosting providers.

      Real-world access permissions don't always match the ideal, and the fact that I can legally upload a CGI via FTP doesn't mean I can hook into a remote debugger. Dealing with an overly locked-down hosting company doesn't break the law, Scoutmaster AC.

    6. Re:Debuggers by UnknownSoldier · · Score: 5, Funny

      > there are three things that catch bugs before you even get to a debugger:

      Yes, but the "hard" bugs are the ones that happen at run-time. Those depends on the context such as Networking, Rendering, and AI bugs that can be a real PITA to track down.

      Race Conditions, and Deadlock are hairiest ones.

      There has to be a comprehensive list someplace aside from the usual

      * syntax (compile time)
      -- variable mis-spelt
      * logic
      -- classic "fencepost" bug
      * run-time
      -- race conditions
      -- deadlock

      On a half serious note:

      * Bohrbugs: Most of the bugs that we come across are reproducible, and are known as Bohrbugs.
      * Heisenbugs: All experienced programmers have faced situations where the bug that crashed the software just disappears when the software is restarted
      * Mandelbugs: When the cause of the bug is too complex to understand, and the resulting bug appears chaotic,
      * Schroedinbug: Sometimes, you look into the code, and find that it has a bug or a problem that should never have allowed it to work in the first place

      http://www.opensourceforu.com/...

    7. Re:Debuggers by gweihir · · Score: 3, Informative

      Unfortunately, for Race Conditions and for Deadlocks, debuggers are mostly useless, as they change the runtime-characteristics. Typically, you end up with "Heisenbugs" that vanish or change dramatically as soon as you run under a debugger. Also if you think finding these by tests, you have already lost. You need to avoid these by design and find them with code-reviews and specialized tools.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    8. Re:Debuggers by Darinbob · · Score: 5, Interesting

      I do a lot of embedded programming, and doing the "standard" stuff like unit testing really is a pain. The bugs don't show up most of the time until they're on a real system or linked with everything else, and the bugs that do appear are the sort that are unlikely to be found in unit tests. Even without embedded programming there is almost always a hard and fast deadline with loud and angry people making sure you get it all done in time, so the unit testing is sometimes the first thing that gets cut. And let's be fair here, very often it is just as hard to write a good unit test as it is to write the code itself, and the programmer who is unlikely to find the bug in the code is also unlikely to write a unit test that would find that bug.

      So ya, you need a good debugger. And if you're good at using a debugger then your value goes up, especially if you can manage dealing with core files and deciphering what occurred in that optimized assembler.

      That said, this is the easy stuff in programing. The "pain of programming" has nothing to do with computers or languages or tools, the pain comes from management. This is why you have people who love to program but hate to come to work.

  2. Smalltalk live images by angel'o'sphere · · Score: 3, Interesting

    I simply don't get why not all programming languages/development environments support live images like Smalltalk..

    For those who don't know what that is: in Smalltalk the IDE and the running program are 'the same'. Your 'program' (what you code) never stops and/or is restarted. It just 'freezes' like a laptop and is 'restarted' or awaken at it previous state.

    That means if you send me your 'source code' you are actually sending me a sleeping, but running! program.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  3. Difficulty Spectrum by Mr_Blank · · Score: 4, Insightful

    Programming has a spectrum of difficulty. The tools can always be improved to make the easier parts easier and the harder parts more manageable, but in the end the hard parts are hard because of the nature of the work; not due to lack of tools.

    In more mature fields the spectrum of difficulty is well understood and no one expects the hard parts to be easy. If a person can write a "hello world" program then it should not be expected they will have the wherewithal to roll out healthcare.gov. If a person can apply a bandage to a skinned knee then it should not be expected they will have the wherewithal to do brain surgery; regardless of how good the tools are.

  4. Re:this is why my kids won't be coders by Shados · · Score: 3, Insightful

    Historically, so far, the easier you make it, the harder the problems become.

    One of the most visible examples of this is in frontend web development. Now that we have jquery and a billion javascript librairies, we don't do the same simple web pages we used to in a fraction of the time (something that would have taken a month back then takes literally seconds today). Instead, we do crazy shit that were never meant to be done in a browser.

    If we make that crazy shit easier, people will just go and do crazier shit.

  5. The Golden Age of Programming by Latent+Heat · · Score: 5, Interesting
    There is this, what should we call it, a mythology of a Golden Age of Programming?

    I don't use mythology in a perjorative sense that this is all pretend or wishful nonsense. I use it in the best Joseph Campbell-Hero-With-Many-Faces sense, of a dim recollection of The Way Stuff Used to Be. This is a way of communicating an Underlying Truth about the Human Condition.

    Apparently there was this era of things such as this Smalltalk that you allude to. Another version of this I hear from tales is Common Lisp. And Lisp Machines, specialized hardware and expensive workstations on which these "live images" would reside. So maybe these tales of direct, personal communication with the gods taking place with the Bronze Age Greek heros was not made up?

    I guess there was this Barbarian Invasion of Bearded Men from the land called "New Jersey", especially a high place among the rolling plains they called "Murray Hill"? There is this piece of non-canonical scripture that our elders have been trying to supress known as the Unix Hater's Handbook explaining how we came to our present age and how this Golden Age entered into myth. Our elders warn against reading this heretical tract as dangerous to our souls.

    As Jerry Pournelle describes the intervening Dark Age between now and that heroic or Golden Age, it isn't so much that people forgot how to develop and maintain a live image programming system such as Smalltalk or Common Lisp, it was that people forgot that such a thing could exist, and we attribute such things to gods or space aliens.

    But then again, just as there is talk of ancient creatures in deep lakes in Scotland or in the remote sections of Zaire or Southeast Asia, there are accounts that Smalltalk or Common Lisp are still in use . . .

  6. Re:this is why my kids won't be coders by allcoolnameswheretak · · Score: 5, Insightful

    Yeah, but this perception of programming is the real problem.

    Programming is not a "pain" if you do it right. Most of the times programming is a "pain" because you are working with code or frameworks written by mediocre programmers who probably shouldn't be programmers. The more accessible you try to make programming, the more mediocre programmers will be encouraged to write code and software that will be a pain to work with.

  7. Eclipse? by drolli · · Score: 3, Informative

    I mean, thats the elephant in the room, isnt it. I found that everything thich can be automated easily is automated in eclipse.

  8. Often we do this to ourselves. by w3woody · · Score: 5, Interesting

    More than once I've seen the existing functionality of an IDE's automatic (or semi-automatic) compile, run and debug loop sabotaged by some (sometimes mandated) third party plugin which is supposed to make things "easier." I've watched as people poorly integrate Java Spring into a project and render it impossible to use Eclipse's debug button because of badly constructed project dependencies. ("Oh, if you want to run the project, just drop into the command-line terminal and type 'ant someobscurebuildproduct run'; it's pretty easy, why are you complaining?") I've seen people integrate Maven into a build process in ways which guarantee the project will stop compiling at some unspecified time in the future by improperly scoping the range of libraries that will be accepted. (And I'm not a fan of Maven or CocoaPods or other external dependency resolution tools anyway, as in part it presumes the external libraries we link against that are hosted outside of our source kits will honor their public interface contracts as minor revisions roll out, something which isn't always true.)

    I've seen refactoring which adds code bloat (rather than simplifies the code). I've seen home-rolled configuration files which make code discovery functions break code discovery functions in Eclipse useless (do you really need to home-roll you own class loader, and specify Java classes in JSON?). I've seen plenty of 'voodoo stick waving' standing in for good coding practices. I've seen the lava flow anti-pattern obscure a simple Java RTL call in 20 discrete layers of classes, each added on by another refactoring that did nothing but make things more obscure.

    I've seen weird blends of ant and makefile build processes which took a product that should have taken perhaps 5 minutes to build take over an hour, and build processes so broken that it was impossible to shoe-horn into an IDE without rewriting the entire project. ("Real programmers use 'vi.'" *shakes head*)

    In fact, I have a working theory about programmers--and that is this: Most programmers think something should be a certain level of difficulty. And when a project turns out to be easier than they think it should be, they add artificial complexity until it reaches the expected level of difficulty. At some point, the project then needs to grow, making things organically more difficult--but the artificial difficulty added by the programmer who thought things were too easy before then simply sabotage the project. This is why quite a few projects I've worked on over the past 25 years have failed.

    This is why I have no hope for any project that attempts to fix the problem. That's because the problem is cultural, not technological. We've had IDEs which had integrated debugging and one-button build + run processes going back to the 1980's--yet somehow we always glom to the next big thing, oh, and sorry about breaking your IDE--but this next big thing is SO important it'll totally compensate for the fact that we broke your edit/run/debug cycle.

    Meaning I guarantee you the moment someone builds a fool-proof IDE which makes it brain-dead simple to edit, compile, run and debug an application, some damned brain-dead fool will come along, worried that things shouldn't be harder, and break the system.

  9. Re:The pain is good by pla · · Score: 5, Insightful

    When you spend 8 hours troubleshooting an open-source project to compile with a third party proprietary library it feels damn good to make it work. Coding is good because it's hard. The higher the stakes the more the accomplishment of that task will make me proud/happy.

    Sorry, but no. If I have a known-working source tree that I want to work with just to tweak one tiny nuisance, I want to download it, open the project, make the change, then build/test/deploy.

    In gaming, you have the concept of artificial vs natural hardness. When the game makes you do things just right with cheap tricks like an almost unavoidable trap right before boss / end of the level, when it requires pixel-perfect jumps, when it has insanely complex or tedious puzzles to solve, when it has time limits that require you to essentially memorize which buttons to mash and when, when it doesn't allow saves except at completely useless spots, the devs have made it artificially hard because they failed to make it challenging through more natural means.

    In coding, we have the same problem, except we don't (usually) do it to ourselves intentionally - And you describe the most egregious example of it, configuring dependencies. I love a good challenge in writing actual code. Optimizing a tight loop cycle by cycle, importing useful numbers from a BOL file that everyone else has given up on, implementing a new (to me) algorithm in language X (I had a great time learning SQL for that reason, because most of my stock tricks from the C world don't translate well). Those all leave me feeling deeply satisfied at the end of the day. When, however, I can't even get the damned thing to build because I have to tweak 17 obscure dependencies:

    "Oh yeah, it doesn't work with the newest 2.17.99 release of WidgetBlaster, you need to hunt down 2.17.94"
    "Oh, you used the default build parameters for WidgetBlaster? Heh, you have to pass it the undocumented NoFleem flag at compile time"
    "Yeah, NoFleem doesn't actually have any effect unless you install the not-obviously-required WidgetFleem library first"
    "Well, you can't actually do it in one pass, since WidgetFleem has a circular dependency on WidgetBlaster - So build WidgetBlaster without NoFleem, then build WidgetFleem, then rebuild WidgetBlaster with the NoFleem option".
    "Oh yeah, it only works in GCC 4.4.x, they changed the optimizer after that one and it breaks WidgetFleem."
    "Did I mention you need to cross-compile it from an OS X machine because a critical buildtool doesn't exist on Windows?"

    Shit like that drives me up the wall, I have zero patience for - or enjoyment of - trying to work around someone else's quirky build environment. If your code depends on obscure external packages, include them in your source tree, and include building them in your default project/makefile, period. I don't care if it makes your source tree 2.5GB, because I'll need to download them all anyway, and at least you know the right versions to include.