Slashdot Mirror


Best Programming Practices For Web Developers

An anonymous reader writes "Web pages have become a major functional component of the daily lives of millions of people. Web developers are in a position to make that part of everyone's lives better. Why not try using traditional computer programming and best practices of software engineering?"

210 comments

  1. More than one side to this one... by fyngyrz · · Score: 5, Interesting

    Best programming practice is to do everything server side and not hijack the CPU of the site visitor; not depend on client-side active compatibility (for instance, just tried to pay for an EBay auction today, wouldn't work, don't use Explorer...) if you do server side processing, you can make it work for *everyone*. That alone is enough reason to go for it. Then there's Digg; Digg's pages are such a load on the visitor's CPU that I have to click "script not responding, continue?" three times on a page with 800 or so comments with Firefox and a dual-core 2 GHz CPU just to get the page to completely render. Sure, some of this is junk programming, not junk technology, but even so, if the server was doing the work of formatting (like it traditionally has here on slashdot), then it'd just be a matter of my browser reading HTML, instead of trying to run other people's scripts locally. I'd give up the web 2.0 "candy" in a second just to have a reliable web page.

    Sadly, I know people will typically go for glitz over functionality, so the only thing that will kill web 2.0 is web 3.0, and I have little doubt it'll be even worse. :(

    As for leaning towards good programming practices, my suggestion is to start by taking PHP off your server, learn Python (or Perl if you're feeling feisty) and write something that at least has a chance of being reasonably structured. Keeping in mind I'm a huge fan of Python.

    --
    I've fallen off your lawn, and I can't get up.
    1. Re:More than one side to this one... by timmarhy · · Score: 2
      Agreed on all counts. stick with serverside processing and you'll have a faster, better webpage. At the end of the say all the pretty scripts and flashing buttons don't mean jack if the site doesn't run properly.

      look at /. and compare it to digg, that's all you need to show anyone to convince them i think.

      --
      If you mod me down, I will become more powerful than you can imagine....
    2. Re:More than one side to this one... by Whiney+Mac+Fanboy · · Score: 1

      for instance, just tried to pay for an EBay auction today

      What payment method? I buy ebay things all the time, using FF under linux - no problems at all.

      learn Python (or Perl if you're feeling feisty) and write something that at least has a chance of being reasonably structured.

      Reasonably structured perl? The mind boggles.

      --
      There are shills on slashdot. Apparently, I'm one of them.
    3. Re:More than one side to this one... by TLLOTS · · Score: 4, Insightful

      I think you're making the same mistake that the numerous anti-Flash zealots make, and that is assuming that bad use of a tool equals a bad tool. Technologies like Flash and AJAX and all the other technologies surrounding and supporting them can add a great deal of value to a website, but only if done correctly.

      Of course with the bar being set so low for getting started in website development it's no surprise that we see the horrible messes that we do today.

    4. Re:More than one side to this one... by All_One_Mind · · Score: 5, Insightful
      I disagree. I do web programming everyday, 8 to 14 hours a day. I do understand your point, but there's a time and place for everything, including client side scripting. There's a ton of stuff that can't be done on the server side, and the DOM is a wonderful thing to work with if you don't go overboard.


      For example, I've written a few web applications per client spec that required various effects, animation, windowing, and tab features. These are all things which are better left to Javascript, and in my preference, the jquery and interface libraries. In fact, there's no real way to accomplish most of those effects without client side scripting. Hell, even Slashdot uses Javascript in their comment system, Firehose, etc. Or look at Google Apps, GMail, YouTube. Not even possible without client side scripting. A well programmed client side script (like anything Google's coded) runs great on even a 500MHz Pentium 3.


      Anyway, my point is that while I can understand minimizing client side programming, it shouldn't, and can't really be avoided completely. I personally love mixing client and server side programming to draw out the strengths in both methods. Just because the idiots at Digg can't program, doesn't mean the whole thing should be thrown out.

    5. Re:More than one side to this one... by Opportunist · · Score: 2, Insightful

      Good in theory. In practice, you'll run into managers who get all psyched out at the idea of dumping the workload onto the clients, because they have to pay for the servers and if the servers don't have to do the work, they can handle more clients, while you don't have to pay for the clients, the customer does that.

      It's not a new idea to shift the workload to the customer. The internet did it in banking (you're your own teller in online banking), shopping (you're basically your own bookstore clerk at Amazon, doing all the work from searching, ordering and with the review system it extends even to explaining and recommending), why should it be different on the technical side?

      Yes, those pages tend to stink, for the reasons you outlined perfectly. But that's not what is actually wanted by the ones who decide to create those pages. You, as the developer and the user of the page, suffer from it. As a dev, you know it's crap but that's how it is to be done (and of course, despite the client having to render and calculate it, you have to find some crafty way to obfuscate the code so nobody can steal it, making the overhead even worse). As the user, you have to suffer from insane loading and rendering times.

      But we save 100 bucks on the server!

      --
      We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
    6. Re:More than one side to this one... by astrotek · · Score: 5, Insightful

      The rules for a web programmer should be

      1) DO NOT REINVENT THE BROWSER
      2) DO NOT HINDER THE BROWSER
      3) DO NOT TRUST THE USER

    7. Re:More than one side to this one... by Isofarro · · Score: 5, Informative

      Then there's Digg; Digg's pages are such a load on the visitor's CPU that I have to click "script not responding, continue?" three times on a page with 800 or so comments with Firefox and a dual-core 2 GHz CPU just to get the page to completely render.

      Sounds like Digg is attaching events to every show/hide link instead of using event delegation and using only one event listener. Browsers can't really handle hundreds of attached event listeners, it is a known performance issue.

      Now using event delegation instead of attaching hundreds of events should definitely be in a set of web development best practices.

    8. Re:More than one side to this one... by tajmahall · · Score: 5, Informative

      Actually when /. articles have 700 comments or so I need to answer the "script not responding" error message several times.

    9. Re:More than one side to this one... by KiloByte · · Score: 4, Insightful

      learn Python (or Perl if you're feeling feisty) and write something that at least has a chance of being reasonably structured. Reasonably structured perl? The mind boggles. In Perl, you can use exactly the same structures as in most other languages, as Perl, just like English, not just borrows constructs from other languages but assaults them in dark alleys to riffle through their syntaxes. You can write near-shell, near-C, near-AWK, near-sed, etc in Perl as much as you like. And unlike Python you can, you know, use indents to mark up the code instead of placating the language's wishes.

      The only problem is, Perl allows insanely terse code. One line of Perl can often replace a page of C or five pages of Pascal. This is tempting, and it's easy to get hooked up and produce read-only line-noise. Yet, with a modicum of self-control you can write readable, well-structured Perl code.

      Of course, this is just like writing secure code in PHP. It is possible, yet no one practices it...

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    10. Re:More than one side to this one... by Mr2cents · · Score: 1

      I think you're making the same mistake that the numerous anti-Flash zealots make, and that is assuming that bad use of a tool equals a bad tool. Has flash been opened up yet? If not, that alone should be a good enough reason to dump it. Remember, the web is a standard. I could in theory design my own processor, make my own programming language, and use that to write my own browser to access the web. But if I need a supported platform to use flash, than it is useless.
      --
      "It's too bad that stupidity isn't painful." - Anton LaVey
    11. Re:More than one side to this one... by dkh2 · · Score: 5, Interesting

      You missed one.

      4) Do not use methods that are OS or Browser specific.

      As for #3) - Absolutely true. Too many developers depend on sniffing the User-Agent string to determine browser capabilities. A much better, more reliable and easier to maintain approach is to test the specific capabilities you use, and provide a way for alternative access to the content. Note "alternative" != "100% equivalent."

      --
      My office has been taken over by iPod people.
    12. Re:More than one side to this one... by jsebrech · · Score: 2, Interesting

      As for leaning towards good programming practices, my suggestion is to start by taking PHP off your server, learn Python (or Perl if you're feeling feisty) and write something that at least has a chance of being reasonably structured. Keeping in mind I'm a huge fan of Python.

      You can do any OO design in PHP5 just as easily as in Python. PHP is less constrained. It allows people to use bad designs because this allows hobbyists who haven't learned correct design practices to build things. However, even though PHP allows you to build bad designs, it doesn't require you. It allows you to do everything by the book.

      The best programming practice for web applications architecture is to serve your target market. If the target market want glitz that requires flash, and doesn't care who that cuts out, that's what you deliver. The goal of the architecture is not to instill your own sense of right and wrong onto the user, it is to enable the user to do what they want to do with high performance.

    13. Re:More than one side to this one... by TLLOTS · · Score: 2, Insightful

      That's a rather narrow-minded way to look at it. Far better to gracefully degrade if the user doesn't have Flash than to say "well someone people might not have it, so it's useless!".

    14. Re:More than one side to this one... by Hathor's+Dad · · Score: 1

      I agree. Leave user things like a "date picker" and input macros to JavaScript but leave form processing to the server, you know the one you control & trust. Firefox has a plugin to alter GET and POST vars after the form is submitted & checked by JavaScript. Server does data stuff, browser does monkey see monkey do stuff.

    15. Re:More than one side to this one... by pedestrian+crossing · · Score: 5, Insightful

      Far better to gracefully degrade if the user doesn't have Flash than to say "well someone people might not have it, so it's useless!"

      By gracefully degrade, do you mean "gracefully" putting up a banner that says "you need Flash to see the rest of this page"? Because that doesn't cut it.

      Once Flash enters the picture, it either becomes necessary to have Flash to access the content, or it becomes obvious that Flash was unnecessary in the first place.

      Very few designers use Flash to merely "enhance" a page. Flash invariably becomes necessary to access the page's core functionality. The "graceful" degradation usually follows a pretty steep curve (ie. all or nothing).

      --
      A house divided against itself cannot stand.
    16. Re:More than one side to this one... by Anonymous Coward · · Score: 0

      You can do any OO design in PHP5 just as easily as in Python.

      I take it you've not used Python then? How would you do co-routines in PHP? Decorators? Metaclasses? Things like DictMixin?

      "OO design" is a lot more than grouping methods and member variables into a namespace and calling it a "class".

    17. Re:More than one side to this one... by Anonymous Coward · · Score: 0

      WTF? I thought I understood most of this stuff until I read through those examples. What the hell do YAHOO.util.Dom.addClass() and friends have to do with it? Seems the author mistakes a library API example for an example of event handling.

      Wothless!

    18. Re:More than one side to this one... by dzfoo · · Score: 1

      >> However, even though PHP allows you to build bad designs, it doesn't require you. It allows you to do everything by the book.

      But the problem is that the book is not that good. Its full of redundant library functions, with inconsistent calling and naming conventions, and a glossy invitation to do things cheaply and thoughtlessly.

      Perl may allow you to do incredibly terse code, yes, but even when so obfuscated, it still entices you to follow a grammatically coherent structure, as it were. Howerver, most of the time, you end up writing code as you write an essay. Whereas PHP is starting to look like the Win32 API: a highly crufty battleground, where new ideas are thrown in just to fight it out with the old ones left by the previous participants.

                -dZ.

      --
      Carol vs. Ghost
      ...Can you save Christmas?
    19. Re:More than one side to this one... by ortholattice · · Score: 2, Informative
      Or look at Google Apps, GMail, YouTube. Not even possible without client side scripting. A well programmed client side script (like anything Google's coded) runs great on even a 500MHz Pentium 3.

      The one app where Web 2.0 shines is Google Maps. But Google has been phasing into other things where it is just not appropriate, making them bloated, slow, awkward to use, and even buggy where they weren't before.

      Example: The new Google Groups is an abortion, replacing the older interface (which was already slower and less user-friendly than the simple, plain DejaNews it replaced, with bugs like overlaying ad text on top of posts) with something that is truly horrendous. Nothing is formatted right unless you're in full-screen mode, making copy and paste from a local editor inconvenient. False line breaks are inserted at column 69 (whatever happened to the old column 72 or even 80 worst case?), so I have to switch my text editor to column 69 wrapping just for Google Groups if I want my post to look halfway decent. Google has ignored the huge number of user complaints about the new format (including my own insignificant one FWIW).

      I've switched back to a Usenet reader for regular newsgroups and am much happier. Unfortunately Google-only groups are becoming popular, forcing me to use Google Groups sometimes. This morning I must have spent 10 minutes futzing with a post to one such group due to my post being rejected because it somehow forgot I was logged in, then rejected because of a timeout, then... oops I forgot to wrap my text editor at column 69, so the post looked like crap with successive long and short lines and code formatting that was barely comprehensible.

      Example 2: I've played with Google Analytics, but god is it slow. Finding out a referring page is often impossible because it strips off everything after "?" in the referring URL. Maybe managers with time to kill like its pretty interface, but just give me the quick and dirty output of analog (web server logfile analyser) and I'm much happier.

    20. Re:More than one side to this one... by Eivind · · Score: 5, Insightful

      That's almost, but just almost, true.

      Thing is, serverside can be made to work for everyone, which is a plus. But the flipside is it can be *slow* for everyone, because serverside you often have no other choice than redraw the entire page (which can be expensive sometimes) even for a tiny change.

      So, the way we tend to do it is graceful degradation.

      If there's something to click on that'll rely only change a small part of a big page (say clicking a link to expand a comment-tree) this is what will happen:

      The link is a normal a href= link, fully standards-compliant, should work even in ancient lynx.

      We then use a standards-compliant well-documented library, jQuery, to add an onclick-handler to the link. The handler returns false, which supresses normal link-following for browsers with javascript turned on. The benefit is that those with javascript saves a lot of bandwith and time, they'll only load the ~500 bytes for the extra comment, not the ~20kb for the entire page.

      The only way someone would be screwed with this solution would be if their browser *did* support javascript (and had it turned on), yet *wasn't* correctly supported by jQuery *AND* doesn't support the relevant standards for javascript. I am not aware of even a single example where this is true, if I became aware of such an example, a single "return true" for that browser would instantly enable all functionality.

      Now, if someone has a browser with javascript, and with a faked browser-header so I can't tell it apart from browsers with a working javascript-implementation, and the javascript-interpreter doesn't understand standards-compliant javascript, then they're screwed. (well, they need to disable javascript to get the site to work...) but in that case they've spent rather a lot of energy for getting screwed....

      I think this solution is a fair bit better than "only serverside everything" actually. But yeah, it is extra work, because you really offer both alternatives for these functions.

    21. Re:More than one side to this one... by Skapare · · Score: 1

      Until technologies like Flash are made reliable and secure across all platforms, web developers ... don't have to stop using them, but ... really must take into account that some web users won't have the capability and they (the developers) need to provide alternatives, even if less glitzy. Things like don't make the whole content be in flash would apply here. Use Flash for what can't be done by other means. And make audios and videos available directly in standard formats.

      --
      now we need to go OSS in diesel cars
    22. Re:More than one side to this one... by Planesdragon · · Score: 3, Insightful

      Server does data stuff, browser does monkey see monkey do stuff. This kind of "you can have any color so long as it's black" thinking is why I had to suffer through a web form user-account system that told me "invalid password" ten times as I tried to guess what their specific rules were.

      Make the user's browser guide the data, check the input once, and then send to the server. There, the server checks it AGAIN. That gives you a redundant check in case someone hacks your client-side script, and lets the non-hacker still get the benefit of an intelligent page.
    23. Re:More than one side to this one... by Hathor's+Dad · · Score: 1

      I see your point but in the end it goes down the same hole...the sites I work with are more regimented that a user cannot cause unintentional errors (Recruitment sites).

    24. Re:More than one side to this one... by Skapare · · Score: 2, Insightful

      I can still submit comments to Slashdot with Javascript disabled. Be sure your submission system works that way as well. Javascript can enhance, and should. Lack of Javascript should not disable. It is not required to submit a comment.

      As for YouTube ... totally possible without Javascript, Java, or even Flash. True, it would not look so good and would be harder for some people to use. But the way they do it, it's a broken site altogether when these facilities are not usable, and that does not have to be.

      There are many sites that do just plain stupid things with otherwise great tools, mostly because they use them the wrong way, or for the wrong purpose. One example is the use of Javascript to replace hyperlinks. That breaks tabs. Instead, the design should include a genuine hyperlink that is intercepted by Javascript if Javascript is enabled. Make sure every "link" on your site works when I press the middle button to open it in a tab.

      --
      now we need to go OSS in diesel cars
    25. Re:More than one side to this one... by Anonymous Coward · · Score: 0

      I don't use yahoo api and even I can tell what's going on. He's basically saying don't attach handlers to every element in the page that needs handlers, instead have an event handler fire every time anyone clicks anywhere, handle the click and determine whether you're supposed to do something with it. Of course I could be wrong, I glanced at it for like 10-15 seconds.

    26. Re:More than one side to this one... by Hognoxious · · Score: 1

      I've written a few web applications per client spec that required various effects, animation, windowing, and tab features.
      Requires? Really? I definitely call busllshit on the first two, unless it's a game.
      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    27. Re:More than one side to this one... by Anonymous Coward · · Score: 0

      ... except that Youtube videos are flash videos???

    28. Re:More than one side to this one... by cs02rm0 · · Score: 1

      I agree. Leave user things like a "date picker" and input macros to JavaScript but leave form processing to the server, you know the one you control & trust. Firefox has a plugin to alter GET and POST vars after the form is submitted & checked by JavaScript. Server does data stuff, browser does monkey see monkey do stuff.

      You should do both, so you've got security server side and so that users don't chew up your bandwidth or have their time wasted to find out they've entered invalid details.

    29. Re:More than one side to this one... by Anonymous Coward · · Score: 0

      But you probably already understood bubbling. Here is a much better example.

    30. Re:More than one side to this one... by umghhh · · Score: 1

      No amount of new shiny compilers, languages etc will help if you start project not knowing engineering basics.
      part of those basics is review process:

      1.design
      2.review what you have done
      3.if needed do rework and goto 2.
          else continue
      4.write a report of finished work

      That it is needed avoids many. Some even are delusional enough to believe that for instance outsourcing removes need for proper design whith result that they either lose customers, lose control or both.

      There are (almost) no technical problems - quality is decided where budget and methodolgy is. Once these are screwed the product is doomed. From this perspective it is cheaper to skip/refrain from development instead of developing 'flowed by design products' that do not work anyway.

    31. Re:More than one side to this one... by jefu · · Score: 2, Insightful

      The problem is that the "designers" have often only learned flash, as they consider themselves "designers" and not "programmers" (who should know more than one language, programming techniques, how to debug and ...). They only want to "design" - pick their favorite fonts, make fancy navigation structures that look cool. They usually consider programming a bit icky and "right brain" (or is it "left brain"?) and somehow beneath them. Sadly, for many this attitude is taught to them in college (sometimes even by people in CS programs). Naturally, this is not true of all "designers" and the best either work hard to figure out how to do things well, or realize their limitations and use good programmers to help them.

    32. Re:More than one side to this one... by SCHecklerX · · Score: 4, Interesting

      Definitely. And because of this ability to adopt a particular style, Perl is the only language I know that I can walk away from for a year, and still be able to write a simple script without having to look at any reference material. If I ever have to do a comparison test in bash, I always have to dig up sample code to figure it out.

    33. Re:More than one side to this one... by Anonymous Coward · · Score: 0

      1) DO NOT REINVENT THE BROWSER

      While I agree that nobody wants to use your new, fancy way of navigating web pages (ie: Having those stupid Flash scrollbars instead of the browser's), there are things you just can't do (realistically) with today's browsers without resorting to Flash or heavy AJAX (some Intranet applications come to mind).

      So you can either not create these sites/apps, or build them any way you can. Besides, I think that's part of how browsers evolve, by pushing these limits. Sure, many of these sites/apps are just junk, but there's a real legit demand for some of them, and they bring the issues to the surface.
    34. Re:More than one side to this one... by Snocone · · Score: 1

      ... not on my iPhone.

    35. Re:More than one side to this one... by skeeto · · Score: 4, Interesting

      anti-Flash zealots [...] assum[e] that bad use of a tool equals a bad tool

      If 98% of the use of hammers was just to smash random things for no reason in particular, I would avoid being around people who owned hammers. I would probably call it a "bad tool" as well.

    36. Re:More than one side to this one... by bteeter · · Score: 1

      You had me until you said "taking PHP off your server".

      Being a good Computer Scientist is all about applying sound principles and practices whatever particular problem your working on at the time. Some programmers blame tools and languages for their inability to use them well. (Kind of like blaming the hammer for smashing your thumb.) You _can most definitely_ code in PHP in a structured, easy to maintain way. I've done it, I've seen it done plenty of times. Same goes for Perl, Python, C/C++, Java, etc. Sure some may have better tools than others, but good code can be produced in all of them.

      Some languages certainly have better tools, but programmers 30 years ago did just fine without all the wiz-bang development tools we have today. It just took a little more planning and effort - the two items that are lacking in most poorly written projects.

    37. Re:More than one side to this one... by Anonymous Coward · · Score: 0

      So you can either not create these sites/apps
      I'll take that one!
    38. Re:More than one side to this one... by Hognoxious · · Score: 1

      This kind of "you can have any color so long as it's black" thinking is why I had to suffer through a web form user-account system that told me "invalid password" ten times as I tried to guess what their specific rules were.
      I'd say the reason is that someone implemented a rule without either:
      saying on the page what the rule is,
      or
      providing a link to said rule.

      But I'm wierd like that.
      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    39. Re:More than one side to this one... by Hognoxious · · Score: 1

      "OO design" is a lot more than grouping methods and member variables into a namespace and calling it a "class".
      It is? Oh, bugger!
      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    40. Re:More than one side to this one... by emurphy42 · · Score: 2, Funny

      it's easy to get hooked up and produce read-only line-noise.
      ITYM "write-only"
    41. Re:More than one side to this one... by kpharmer · · Score: 1

      > And unlike Python you can, you know, use indents to mark up the code instead of placating the language's wishes.

      I was thinking about this - and couldn't come up with a scenario in which I wouldn't want my indentation to accurately reflect flow of control. This is what python enforces.

      Any scenarios you can think of?

    42. Re:More than one side to this one... by Anonymous Coward · · Score: 0

      usable information technology - http://www.useit.com/
      any browser campaign - http://www.anybrowser.org/campaign/

    43. Re:More than one side to this one... by Anonymous Coward · · Score: 0

      You're not an entrepreneur are you?

    44. Re:More than one side to this one... by ShatteredArm · · Score: 1

      Really, really long statements. I'm no python expert, but is there a way to do multi-line statements?

    45. Re:More than one side to this one... by Keeper+Of+Keys · · Score: 4, Insightful

      Completely agree. Yes, unobtrusive srcipting does mean providing the same resource in two different ways, but that needn't be too much of a chore. The backend part is more than just an insurance policy against your javascript failing for some reason: it's the only way the Googlebot will see your content at all - it doesn't run page scripts. I'd say: develop a standard call-and-response website first, then unobtrusively ajaxify the parts where a full page refresh is too costly.

    46. Re:More than one side to this one... by ShatteredArm · · Score: 1

      Is it fair enough to say that if the website *requires* flash to accomplish its very aim, then go ahead and use it? In that case, the non-flash people wouldn't get the functionality either way, so there's no reason to ditch it for them. IMO, flash should be used for stuff like media, games, etc., as a way to accommodate the functionality, not for things that can be done--even if it's not as "pretty"--without flash.

    47. Re:More than one side to this one... by mpathy · · Score: 1

      Of course there is. Do you know any real programming language that doesn't allow you that? :)

      --
      Ubuntu, a terminal, Python and Slashdot. Thats all you need.
    48. Re:More than one side to this one... by MikeFM · · Score: 3, Interesting

      Do anything but use Perl. Perl programs are often a nightmare to maintain because the vast majority of them are written by people who don't really know how to program in Perl and don't know or care enough to keep their programs readable. Perl is just to easy to make a freaking mess from so use it only when you have a specific job it's good for.

      Python works quite well for implementing the logic of an application thanks to it's clean syntax and good object support. It's not always the easiest to get working, and keep working, with your web server though. That's something I think should be improved. It works great but isn't as good a solution for a new developer because of that issue.

      PHP I usually use only for output logic and templating. I make remote calls to my app logic via XML-RPC and then use PHP to make it look nice. PHP is really easy to develop in so long as you don't code like a novice and cram everything into it. If you must program your entire app in PHP then please keep things clean and don't write HTML, CSS, Javascript, SQL, and PHP all inline. Don't mix user interface logic with application logic. If your application logic is going to be simple enough it's fine to write it in PHP so long as you keep it tidy. Sometimes it's easier than messing around with setting up something like Python as a backend.

      As for glitz over function - don't do it! Make sure things work first and then go back and try to make them look and feel nicer where you can - if you think it will really help. Don't make things complex to maintain if it isn't going to benefit the user. With CSS and Javascript behaviors it's easy to write a clean XHTML site and then layer in improved looks and interactivity.

      I was a programmer before the web came into existance and I started make web sites. I think there is a major benefit to learning to be a programmer and sysadmin first because you understand better how things can be done to be more effecient and easier to maintain.

      I've often seen developers spending a lot of time doing even simple tasks like preparing images that'd be much easier if they had programming experience. For example, cutting out product images - my graphic artists tend to hand trim the pictures which takes forever and results in a rough edge. When I do it I create a second layer in which I fill in the parts I don't want using the very quick use of the select tool and sliding the sensitivity back and forth. Then I use a drawing tool to just fill in the individual pixels I need to smooth things out. Mine take about 30 seconds each and look nicer than my graphic artists' 5 minute effort.

      I've seen developers spend a lot of time coding in features that could be configured in a couple minutes of configuring the web server or using a system feature such as cron jobs.

      In principal I agree with the article that it's good to gather requirements before you start and don't repeat yourself but I feel I have to point out that web development is often a rapid application design type of thing where you aren't given significant time to plan or implement your work and requirements will change often. It's best to develop some best practices that work for everything and stick to it. Usually your boss or client isn't going to have any idea what the requirements are so stick to your best practices unless you have something specific that needs changed and update your best practices as you build experience. Do try to keep from duplicating work or repeating yourself but don't spend an exhaustive amount of time avoiding it - instead do your work and refactor now and then as needed. Refactoring is a much better idea than trying to plan every possibly line of code.

      Testing I think is probably the most important thing, after following standards, that most web developers don't do. Get at least IE6, IE7, Firefox, Opera, and Safari and test every page of every site with each of them. As you develop test and re-test because things are going to change without you noticing. At least Firefox, Safari, and Ope

      --
      At what price learning? At what cost wisdom? The price is a man's peace of mind, and the cost is his life.
    49. Re:More than one side to this one... by Hatta · · Score: 0, Flamebait

      Too many developers depend on sniffing the User-Agent string to determine browser capabilities.

      What's wrong with that? A user who knows enough to change their UA should know that it might break things.

      --
      Give me Classic Slashdot or give me death!
    50. Re:More than one side to this one... by DaggertipX · · Score: 1

      So how is the video's native format more portable than Flash? Flash has a higher and more consistent install base than any video codec I know of, not to mention giving a consistent user experience across all of them - which an OS dependent embedded player wouldn't do.
      Youtube made it work without flash for the iphone to overcome an iphone limitation - not because it was the more portable implementation.

    51. Re:More than one side to this one... by Hatta · · Score: 1

      there are things you just can't do (realistically) with today's browsers without resorting to Flash or heavy AJAX (some Intranet applications come to mind).

      Maybe you shouldn't be using a browser then. What's wrong with an old fashioned client-server app?

      --
      Give me Classic Slashdot or give me death!
    52. Re:More than one side to this one... by h2g2bob · · Score: 1

      Technologies like Flash and AJAX and all the other technologies surrounding and supporting them can add a great deal of value to a website, but only if done correctly.
      I agree - and the most important part of doing it correctly is Ensure that pages are accessible even when newer technologies are not supported or are turned off .

      Like JavaScript. You might excuse something as complex as Google Maps for requiring javascript: instead they made the effort and it works without it. So how can sites like Monster.com need JavaScript to submit a simple form? Without even a nice warning message in noscript tags?

      AJAX and Flash done right can add extra features and improve the site - Ask.com has done a lot of that. But it's the fact that it still works without the latest and greatest technologies which ensures that everyone - including those 1 in 20 people without JavaScript - can enjoy the site.
    53. Re:More than one side to this one... by Hatta · · Score: 2, Insightful

      I've written a few web applications per client spec that required various effects, animation, windowing, and tab features. These are all things which are better left to Javascript

      Per client spec. Just because your client thinks you need those things doesn't mean the users actually do. I understand you got paid to write it that way, but that doesn't mean that's the best way to write it.

      --
      Give me Classic Slashdot or give me death!
    54. Re:More than one side to this one... by SlowMovingTarget · · Score: 2, Informative

      Indeed:

      Backslash can be used to allow continuing the program line past a carriage-return, but you almost never have to use it. Python is smart enough to do the right thing when it sees an open bracket, a comma separated list, and a carriage-return.

      From Moving To Python From Other Languages.

    55. Re:More than one side to this one... by stewbacca · · Score: 1
      #3 should read: "Without the user, you are nothing."

      Users WILL break the system out of stupidity, because most users aren't programmers or engineers. This is why an engineering/programming approach is misguided as applied to the web. If we could concentrate more on usability and design, we'd give the dumb user less opportunity to break the system.

    56. Re:More than one side to this one... by PopeRatzo · · Score: 1

      Of course with the bar being set so low for getting started in website development it's no surprise that we see the horrible messes that we do today.
      I'm betting that there was a time when that "low bar" was just about the right height for you, too.

      The fact that the requirements for getting started in web development are very low is one of the things that makes the Internet great. I can remember when some of the web sites that today are among my favorites were also "horrible messes" in their earliest stages.

      I'll gladly take a web that has the occasional "horrible mess" over a slick professional web where only those who are certified and vetted "web developers" have an opportunity to put up a site.

      Just remember, the production quality on network television is uniformly excellent, in terms of video- or cinematography, sound engineering and editing. But, the content is vapid, insulting and...useless. I hope the World Wide Web never achieves such high standards for "quality".
      --
      You are welcome on my lawn.
    57. Re:More than one side to this one... by Anonymous Coward · · Score: 0

      First post and the PHP trolling begins... Why would you think ebay requires IE? I'm pretty sure I'm not the only person on here who's paid for stuff on ebay in FF... Perhaps you have adblock or some crap installed.

    58. Re:More than one side to this one... by jp10558 · · Score: 1

      I'd say two things - One, it requires you to check for more things and have more complex code as different versions of a browser will support different features so you end up checking for IE5, IE6, IE7, FF1, FF2, Safari whatever, hopefully Opera 7,8,9 and whoever else shows up.

      Or... you could have a single check does feature X exist. So potentially a lot less if statements ...

      Second, when Opera 9.5 comes out and supports new features, or FF3 comes out supporting new features, above you get to rework the page with *yet more* browsers. Feature checking can be left alone and automagically works with newer browsers. It also works with browsers you don't specifically write code for (like possibly Opera etc).

      I generally don't think much of a webdev that will send me a browser unsupported page when I say I'm Opera, but if I change one setting to say I'm Firefox, now it works...

      --
      Opera, Proxomitron-Grypen,GPG 0x0A1C6EE3
    59. Re:More than one side to this one... by Lodragandraoidh · · Score: 2, Interesting

      I would say the same thing about Python vs. Perl.

      There are so many different ways to do something in Perl that you end up doing what is expedient - but not maintainable over the long haul. On the other hand there is usually just one way to do a given thing in Python - which makes learning, and retaining the language much easier over time for me.

      I've written production programs in Perl, awk, sed, Java, C(++), Pascal, sh, php, and tcl for many years - and Python is just better in every way imaginable (JIT bytecode compilation, speed of development and debugging, more logical and standardized libraries and easy creation of your own libraries, strong (duck) typing, more of a 'computer science'-ish approach to programming including functional programming constructs, the ability to extend the language via a well defined interface in C, and out of the box GUI development using TK - "batteries included" indeed - when coupled with Zope/ZODB for persistence and web development, even more so).

      I am not saying you *can't* program well in the others - I am just saying it takes more control; control that most programmers do not have - particularly in the learning stages. Some never get it - and thus the abominations we see crawl from the dank cesspool that is the internet on an almost daily basis. Python enforces good programming practices, and minimizes the options for a developer to shoot himself in the foot - while retaining the power needed to get real work done. There are only a few situations I would not use Python (generally programming tasks that depend upon leveraging hardware - drivers and system kernels - where every CPU cycle counts).

      YMMV.

      --

      Lodragan Draoidh
      The more you explain it, the more I don't understand it. - Mark Twain
    60. Re:More than one side to this one... by Thrip · · Score: 1

      I generally agree with you, but one part of the OP that unobtrusive javascript doesn't address is the tendency for large, script-heavy pages to freak out your cpu and ultimately fail to load. I run into this more and more often. On slashdot, for instance, I generally use the new comment engine, but if I browse to a page with 500 comments, I end up having to kill and restart my browser.

      --
      I'm awake! The answer is BONK!
    61. Re:More than one side to this one... by poulbailey · · Score: 1

      How does jQuery fare in this case? Does its system attach itself the proper, scalable way?

    62. Re:More than one side to this one... by chartreuse · · Score: 1

      Hmmm, are you running Greasemonkey or some other Firefox add-on? 'Cuz I don't get that at all.

    63. Re:More than one side to this one... by Electrum · · Score: 3, Informative

      Python needs an equivalent to CPAN. I often use Perl instead of Python because of CPAN. PyPI just doesn't cut it. If I'm writing a quick script needing some library, it's quick to find it on CPAN and install with one command. With Python, you have to search PyPI, hope what you want exists on there, hope it works with the version of Python you are using, etc.

      Perl packages have a standardized method for doing unit tests, and consequently, many CPAN modules have them. Python does not, so most packages do not have unit tests, or if they do, it isn't as easy to run them as make test.

      Python really needs to copy CPAN.

    64. Re:More than one side to this one... by raddan · · Score: 1

      And, of course, as far as input validation goes, you MUST do the validation on the server-side anyway, regardless of whether you have JavaScript validation happening on the client-side. Not doing so puts you at great risk of having your website hacked. I basically consider JavaScript to be an additional aid to the UI, sometimes, but not a necessity. E.g., you can reduce one roundtrip exchange with the webserver if you have the first round of validation happen at the client. Also, those little web-calendar widgets are useful to put a particular date in context. But as others have pointed out, you really can't rely on Javascript being there or working properly, especially given the growing number of people who might need to use your web app on, say, a cellphone.

    65. Re:More than one side to this one... by turgid · · Score: 0, Flamebait

      Definitely. And because of this ability to adopt a particular style, Perl is the only language I know that I can walk away from for a year, and still be able to write a simple script without having to look at any reference material.

      Assuming no-one else modifies your code in that time.

      PERL is a glue language and should be used sparingly. Anyone who thinks they can write substantial programs (>20 lines (yes, I am being sarcastic)) in PERL that will be maintainable, reliable and testable is severely misguided.

      I have seen it abused far too much to recommend its use for anything other than 10-line scripts.

    66. Re:More than one side to this one... by Anonymous Coward · · Score: 0

      The only "valid" python indentation gripe I've found (and I've written a massive pile of python) is something like this:

      if a == b:
          print "dog"
          if c == d:
              print "cat"
              if e == f:
                  print """this is a very long string
      spread over multiple lines using the triple quote mechanism
      to preserve embedded linefeeds. This is a valuable and useful
      piece of python syntactical sugar, but it has a few annoying side effects
      that are not easy to address"""

      The problem? Odds are the editor will blows chunks on the """ string and indent them. The long nested string kills the readability of the surrounding code as the paradigm of indentation always reflecting nesting depth is broken. You can manually split the lines up but it makes the inclusion of linefeeds in """ a misfeature.

      This is hardly a major issue, but it is a design issue. Long strings in the body of a program is often a sign of poor code design anyway; especially when there are a lot of them. You wanted an example, that's the best I've got.

    67. Re:More than one side to this one... by Poromenos1 · · Score: 1

      > And unlike Python you can, you know, use indents to mark up the code instead of placating the language's wishes.

      Ah, but can you write blocks of code without block termination sequences? You know, ifs without endifs, like in Python? I THOUGHT NOT!

      Seriously though, marking blocks with indentation is great. In every piece of code that matters (i.e. is not art or for fun) you are going to indent your code, so also terminating the block with statements is superfluous.

      --
      Send email from the afterlife! Write your e-will at Dead Man's Switch.
    68. Re:More than one side to this one... by JM78 · · Score: 1

      Best programming practice is to do everything server side...
      ...if you do server side processing, you can make it work for *everyone*. That alone is enough reason to go for it.
      ...then it'd just be a matter of my browser reading HTML...
      Sadly, I know people will typically go for glitz over functionality...

      There are more factors to consider than you're giving credit - too many blanket statements without enough consideration. The internet is a media platform with many uses and methods. One of the biggest uses is as a marketing tool. Target market is a major consideration for how one should design, develop and deliver any given site. I don't necessarily WANT to make it work for everyone because it's unlikely that everyone is my target audience. Even myspace, youtube, digg, slashdot, etc, etc. are all geared towards a specific type of audience - that's how brands work. One has to consider who is most likely to visit their site.

      Making blind assumptions about what the content is, who it's to be delivered to and/or how it should be delivered is not a good position to start from when beginning a new project. Delivering HTML-only pages, while likely accessible to *everyone*, may not be the best practice when comparing the target audience to another approach (Adobe Flash for example).

      The problem with your perspective (IMHO), is that you cannot seem to see why people develop/want glitz. There is absolutely nothing wrong with glitz. True there are best practices in programming/delivering a glitzy site, like all types of sites, but to boo glitz simply because you've got a predefined belief of how things should be delivered to *everyone* is not a good practice in itself. Glitz has its place. Clean has its place. It all has a place. Knowing that not all audiences are equal from the beginning and *then* selecting the style of development is a start to best programming practices for the internet as a medium, in my opinion.

      --
      I am Jack's smirking revenge.
    69. Re:More than one side to this one... by Fozzyuw · · Score: 1

      We then use a standards-compliant well-documented library, jQuery, to add an onclick-handler to the link.

      Absolutely, this design style, called Unobtrusive JavaScript (for those reading and learning something new) seems to have become a recent push since the whole AJAX thing exploded. It's well covered by the gurus of the field Jeremy Keith (talks about it in his book Bulletproof AJAX) and Peter-Paul Koch (ppk) of QuicksMode. I've not read his book, "PPK on JavaScript" but if it's half has good as his website, it would be a standard buy for any web person.

      Speaking of jQuery, Jeremy Keith also lists the following JavaScript Libraries/Frameworks/Toolkits...

      The only way someone would be screwed with this solution would be if [...] I am not aware of even a single example [of a browser that could screw this up]

      Right, while not all objects/functions are supported cross-browser, they usually work the same when they are supported. There's only one real concern about the world of "AJAX" and "Web 2.0" that Jeremy Keith pointed out in Bulletproof AJAX: screen readers. Apparently Screen readers are far behind in detecting dynamically updated content via JavaScript. JavaScript "could" be turned on and the page properly updated but the Screen Reader won't understand this and this is a big problem for those sites concerned with accessibility. In short, those who require screen readers should turn off JavaScript and allow the site (if properly designed with unobtrusive JavaScript) fall back to the full page refresh updates. However, I don't know if there's a foolproof (or bulletproof) way of making sure screen readers turn off JavaScript and it could be bad to assume one would be turned off (if your sites traffic has high accessibility needs).

      Cheers,
      Fozzy

      --
      "The past was erased, the erasure was forgotten, the lie became truth." ~1984 George Orwell
    70. Re:More than one side to this one... by mikee805 · · Score: 1

      I think (might wrong about this) but http://www.openlaszlo.org/ might a good way to degrade. It will create similar interfaces in both flash and dhtml. So you can detect if a user has flash if so give them flash if not give them dhtml. Of course (and this the part I have wondered myself) why not just always use dhtml?

      --
      B5 71 ED FB 55 D6 4E 68 07 25 E2 FA CA 93 F0 2F, is mine! All mine!
    71. Re:More than one side to this one... by Fozzyuw · · Score: 1

      A well programmed client side script (like anything Google's coded) runs great on even a 500MHz Pentium 3.

      A very good "apples to apples" example of good/bad JavaScript programming can be seen by anyone who uses Blockbuster Online's website vs NetFlix.

      Blockbusters new site (while better than their previous site) suffers horribly from by Client-Side scripting. Most queue management causes 3-4 second lag, even on a desktop built for high-end gaming. It's also too feature rich. Every link or item is trying to do something, even when your in a context when you don't need to know this extra information, like pop-up bubbles and such.

      Netflix is much more enjoyable to use and I find runs a lot faster. Though, I still prefer the Blockbuster style of online rentals (free in-store rentals), I wouldn't mind if they cleaned up their JavaScript on their site. Not to mention, I've had just some bizarre situations like getting duplicate discs in a "locked" TV series (because I double clicked the "add to queue" button.

      Cheers,
      Fozzy

      --
      "The past was erased, the erasure was forgotten, the lie became truth." ~1984 George Orwell
    72. Re:More than one side to this one... by crystalattice · · Score: 1

      FWIW, I had to write a Python script yesterday after not having programmed at all for almost six months. It only took me 30-40 minutes to hack it out, mostly because I couldn't remember the exact format for a user prompt or where I needed to place my "while" loop to make it work correctly.

      Other than that, I could fumble my way through while Python "helped" me out by not requiring any strange coding practices. I just "told" it what I wanted to do and it did it.

      --
      Free Programming BookLearn to program
    73. Re:More than one side to this one... by JaWiB · · Score: 1

      But at least slashdot has options to decrease bandwidth usage. Very nice to avoid all the bells and whistles when all you want is to read the article and comments.

    74. Re:More than one side to this one... by Chandon+Seldon · · Score: 1

      Anyone who thinks they can write substantial programs (>20 lines (yes, I am being sarcastic)) in PERL that will be maintainable, reliable and testable is severely misguided.

      Anyone who doesn't think this is possible has never learned Perl. Perl's greatest weakness is that it looks just enough like other languages that people expect to be able to just jump in and read / write Perl code without actually learning Perl - and then they hit some common perl idiom like an inside-out class (or even just the code to access a nested data structure), have no idea what's going on, and blame the language.

      --
      -- The act of censorship is always worse than whatever is being censored. Always.
    75. Re:More than one side to this one... by cbhacking · · Score: 1

      Very few designers use Flash to merely "enhance" a page. Flash invariably becomes necessary to access the page's core functionality. The "graceful" degradation usually follows a pretty steep curve (ie. all or nothing). I would actually disagree. Quite a lot of pages these days use things like Flash-based nav bars. These can have pretty effects like fading in and out on mouse-over, which is doable with javascript but you can make very fancy effects in flash with (according to those who develop it, I don't) a minimum of effort (compared to javascript, that's not surprising... what a mess of a language). The thing is, there's effectively no need for flash there, but it can improve the site design, and the client browser supports Flash, it eliminates the need to code to the JS peculiarities of each browser when making pretty visual effects.

      That said, it's also quite easy to automatically downgrade this to a basic HTML 1.0-compliant nav bar if needed (most people won't drop it that far, but you get the point). It may be harder to have pictures and text fade in and out, or do little ripply effects on mouseover, but none of that is "core functionality" anyhow.
      --
      There's no place I could be, since I've found Serenity...
    76. Re:More than one side to this one... by dcam · · Score: 1

      Best programming practice is to do everything server side...


      Rubbish. Doing everything server side means you have slow, unresponsive apps. I'll pick one real world example.

      One application I work on allows people to upload documents, lots of documents. It isn't unusual to have people uploading 5Mb of documents in a single POST. The names of these documents need to be checked to ensure that that don't conflict with existing document names. With a small amount of AJAX, I can check the name and warn people of the conflict. If I stuck with keeping everything server side, I'd have to wait until the POST had been completed before warning them.
      --
      meh
    77. Re:More than one side to this one... by jc42 · · Score: 1

      Technologies like Flash and AJAX and all the other technologies surrounding and supporting them can add a great deal of value to a website, but only if done correctly.

      True, perhaps. But if I enable them, I find that the Web is full of sites that abuse them and attempt to take over my cpu. As a "client", I can't know beforehand what a site may attempt to do to my machine. So my only sensible approach is to use a browser (browsers, actually) that let me disable such horrors.

      I'm sorry for the very few sites that use such tools appropriately. But the fact is that the Web has been colonized by arrogant folks who think that it's OK to attack their client's machines. That's what humans are like, mostly. So the few honest folks suffer.

      Sorry 'bout dat. Really, I am. Web 2.0 sounded so cool at first. But I learned how it could be abused. And I learned to defend against the abuse.

      One of my favorite examples is the ComedyCentral.com site. I've tried looking at the Daily Show online off and on. It has never worked. Recently, they apparently listened to their customers, and did a radical revision. As a result, it totally bogged my machine down, and my only recourse was to "kill -9" my browser. What had they done? Each page had around 8-10 separate flash movies. One was content, the rest were ads. My machine can't do 8-10 flash movies simultaneously. I installed flashblock in firefox and seamonkey, and verified that this was the problem. If I let just one flash movie (the content) run, it worked fine, but with flashblock disabled, everything hangs due to the competition. It's just one example of what web developers can to do a "customer".

      Maybe Web 3.0 will find a way to do it so that my machine can't be attacked via my browser, and I can leave such things enabled. Maybe. I don't have great hopes, though; the marketers will find any loophole in the implementations to get at the client's cpu.

      I do wish I could be more positive about all this.

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    78. Re:More than one side to this one... by rhizome · · Score: 1

      I believe you've just typed the longest explanation of American job-security.

      --
      When I was a kid, we only had one Darth.
    79. Re:More than one side to this one... by Anonymous Coward · · Score: 0

      Install base...

    80. Re:More than one side to this one... by NamShubCMX · · Score: 1

      Flash do not annoy people, people annoy people :P

      --
      We've always been at war with Eurasia.
    81. Re:More than one side to this one... by smellotron · · Score: 1

      Once Flash enters the picture, it either becomes necessary to have Flash to access the content, or it becomes obvious that Flash was unnecessary in the first place.

      On the contrary, there are many cases where Flash + graceful degradation is a nice thing to have; they may not be obvious to you, though, because you probably don't notice them (since they aren't annoying). One example is Fahrner Image Replacement, which uses Flash + Javascript for fancier text headers, but falls back to vanilla HTML headers when it fails (so yes, it works in Lynx).

      The main problem this solves is the absolute suckitude of font management/use on the web. Want to use a font that isn't in the default Windows fontset? Your other alternative to FIR is to generate images for all of your headers, which is far worse.

    82. Re:More than one side to this one... by Anonymous Coward · · Score: 0

      Best programming practice is to do everything server side and not hijack the CPU of the site visitor; not depend on client-side active compatibility (for instance, just tried to pay for an EBay auction today, wouldn't work, don't use Explorer...) if you do server side processing, you can make it work for *everyone*.

      Bzzt, wrong. You're making the fallacy of assuming that "everyone" and "every browser" are the same thing.

      Sites that do some work on the client-side can be more responsive, because they don't 'freeze' whenever you try to do something. I know in your ivory tower, user success at using a site is 100%, because you built the thing, and the speed is fine, because it's running locally. Super. Out in the real world, it's possible to make a much more user-friendly site with some Javascript. That translate directly into user success rates. (I know it's hard for slashdot users to believe, but if you take 100 people, sit them in front of a web browser pointed at amazon.com, and tell them "buy the book with this title", *some will fail*. User success rates are almost never 100%.) If you do something that screws up for all the Netscape 4 and Opera-for-phones users, but makes it twice as easy for IE and Firefox users, it will probably be a net win.

      Yeah, I'm sure lots of sites screw it up (I don't read Digg). Lots of developers screw up unit tests, too, but that doesn't mean they're bad practice.

      Cry all you want. I'd rather have all my IE+Firefox users happy today, and maybe the weirdos in a few months, than making everybody feel "meh" about my site today.

    83. Re:More than one side to this one... by CopaceticOpus · · Score: 1

      Of course, this is just like writing secure code in PHP. It is possible, yet no one practices it...
      2002 called, they want their criticisms of PHP back. :) While there will always be examples of bad code in any language, and PHP may have more examples than any of them, this is no longer a general rule. It's not hard to find fantastic, modern, highly secure web apps written in PHP these days.
    84. Re:More than one side to this one... by Eivind · · Score: 1

      I've done my homework :-) Prior to choosing to standardise on jQuery we evaluated YUI and Prototype. Neither where bad, but YUI had focus on something else than what we where interested in (user-interface-widgets for example), and prototype just plainly was a worse fit for our development-methodologies.

      The rest I've heard of, but never seriously investigated.

    85. Re:More than one side to this one... by Eivind · · Score: 1

      Actually, the main thing we need to do to enable this is *always* to develop a page as a set of pretty self-contained modules that are then fit together into one whole page on full page-refresh, but which can also be called individually for ajax-refresh.

      If you've got, for example, a query that then loops over the resulting comments, and applies a given template for each of them, then that very same template can be run only once with 1 comment to do an ajax-refresh without much extra code.

    86. Re:More than one side to this one... by clayne · · Score: 0

      Exactly how is removing PHP going to solve the client vs server bias? It's a server-side resource just as well.

      IMO, the main issue is simply one of signal:noise, unsurprisingly. As much as graphics are neat, and sometimes useful, the majority of the time I feel people want information first and most importantly - fast. Minimal design oriented graphics used for separation and layout are fine with me. However, data should be driving things - not crap.

    87. Re:More than one side to this one... by Keeper+Of+Keys · · Score: 1

      I have to take issue with a few things here:

      First, Javascript and Actionscript are both essentially the same core language with different extensions, so it makes no sense to choose one over the other on the basis of which is the best language.

      Second, the core language, Ecmascript, is not a mess. In fact, I find it the most elegant and intuitive language I have used (including Ruby, though I'd put that a close second). There are specific problems with its implementations both as a browser scripting language and within Flash. Actionscript suffers from its relationship with the Flash IDE which - to a programmer - is less than intuitive, though the larger your flash app the more you get away from this. Javascript's burden is differences in implementaion of a few features, which unfortunately are key ones. The solution to this is to use a framework. I use jQuery, which does such a good job of hiding these differences I'd have to rack my brains to remember what they are and how to work around them in regular js.

      Thirdly, I agree that animated nav bars can enhance a site but they can also detract, especially if the user has a slow PC. This is a matter of good taste and judgement, but I'd suggest thinking at least three times before doing a site's navigation in flash. As you point out, it can be built to degrade in such a way that the NoScript user (and we're on the increase) doesn't even know they're missing something. CSS can accomplish an enormous amount in making a well marked up nav look the business.

      Fourthly, if you really must have them, you'd be surprised what kind of animation effects can be achieved quite easily using a framework like jQuery.

    88. Re:More than one side to this one... by Keeper+Of+Keys · · Score: 1

      Mod parent up.

    89. Re:More than one side to this one... by clayne · · Score: 0


      You can do any OO design in PHP5 just as easily as in Python.



      I take it you've not used Python then? How would you do co-routines in PHP? Decorators? Metaclasses? Things like DictMixin?

      Right, because coroutines are oh so useful.


      "OO design" is a lot more than grouping methods and member variables into a namespace and calling it a "class".

      An OO language is not necessarily required to implement derivation, polymorphism, or inheritance in order to make use of object oriented concepts.

      window w;
      dialog d;
      int s;

      w.close();
      d.close();
      close(s);
    90. Re:More than one side to this one... by Keeper+Of+Keys · · Score: 1

      Until technologies like Flash are made reliable and secure across all platforms

      While I agree that developers must provide fallbacks, I can't think of any recent serious security issues with Flash, and it's the most cross-platform browser plugin there is (especially if you trail a couple of versions behind the bleeding edge), so I'm not sure what your problem is. And I've gotta question that 'until'. Lynx will never support flash, and nor will Googlebot, so the main 'reliability' issue with Flash is that you can't rely on it being present - though it will almost certainly work as intended if it is.
    91. Re:More than one side to this one... by shvern · · Score: 1

      Agreed on all counts that a return to basic skills will improve the web for everyone. We want functional, maintainable, highly responsive websites and for this to happen the architecture and system design must be put in place. Just slapping together a solution of "good enough" does not scale and results in wasted effort and reorganization later. Instead of rushing to implement poor solutions, some consideration and planning needs to be undertaken. We have a lot of thoughtful guidance for this so there is no excuse for bad design that ends up frustrating users and failing to achieve business objectives. We can all do better than this but it requires educating project teams first and showing why the tried and true approaches are so important.

      --
      http://robert.shvern.com/
    92. Re:More than one side to this one... by turgid · · Score: 1, Flamebait

      Anyone who doesn't think this is possible has never learned Perl.

      Everyone has their own "expert opinion" on what constitutes "good code." PERL is so baroque and full of exceptions to rules, non-obvious conveniences (e.g. command-line parameter processing), default variables, case requirements etc. that it is impossible for mere mortals to produce code that is understandable and maintainable by anyone other than themselves, and certainly not to anyone learning the language. It's probably easier to get a newbie productive on an existing C++ project than on a PERL one, and C++ sucks. Indeed, someone once said that C++ is an octopus made by nailing extra legs on a dog, and they're not far wrong.

      Object orientation in PERL is not part of the core language, but is a hack based on the way that the symbol table works. You can not possibly seriously suggest that it's a good idea.

      PERL is duct tape. It's covered in fluff and hair. Let me know when PERL 6 is ready.

    93. Re:More than one side to this one... by Chandon+Seldon · · Score: 1

      Everyone has their own "expert opinion" on what constitutes "good code."

      And apparently yours is "not Perl or C++", even though those two languages have been used to build useful real-world systems with some regularity for years and there are accepted community standards for writing good code in both. I think Bjarne Stroustrup said it best: "There are just two kinds of languages: the ones everybody complains about and the ones nobody uses."

      Object orientation in PERL is not part of the core language, but is a hack based on the way that the symbol table works. You can not possibly seriously suggest that it's a good idea.

      Why not? Writing object oriented code in Perl works great in practice. Just because the syntax extensions to allow it didn't need to be that drastic doesn't mean the result isn't good.

      --
      -- The act of censorship is always worse than whatever is being censored. Always.
    94. Re:More than one side to this one... by dkh2 · · Score: 1

      Somebody mod this person up for getting it.

      --
      My office has been taken over by iPod people.
    95. Re:More than one side to this one... by turgid · · Score: 1

      And apparently yours is "not Perl or C++", even though those two languages have been used to build useful real-world systems with some regularity for years and there are accepted community standards for writing good code in both. I think Bjarne Stroustrup said it best: "There are just two kinds of languages: the ones everybody complains about and the ones nobody uses."

      I've yet to see a good piece of PERL written by more than one person who wasn't a very experienced expert.

      I've seen very little C++ in the Real World. Usually, C++ jobs are C jobs with a smattering of basic C++ code thrown in because someone once thought it might be a good idea to look at C++.

      OK, Windows is C++ and in the free unix world, KDE. I don't use C++ by choice, or PERL.

  2. Avoid ASP is a good start. by Anonymous Coward · · Score: 0

    See subject.

  3. "Good practice" is an outdated concept by BadAnalogyGuy · · Score: 4, Funny

    The whole idea that you should design before implementation is laughable. So is the idea that programs should be built to last.

    The program you write today will be tomorrow's cruft. Better to write cool, flashy apps that keep you at the front of the technology and let the monkeys in the basement cubes figure out how to keep your crap running. It's how you cultivate a good reputation for being a technology leader.

    You only live once. Why waste that time writing good code that's going to be thrown out anyway? Write cool code that makes you look good. Make a lot of money and retire early.

    1. Re:"Good practice" is an outdated concept by Colin+Smith · · Score: 1, Funny

      Sadly, please mod insightful.

      --
      Deleted
    2. Re:"Good practice" is an outdated concept by Opportunist · · Score: 1

      Make a lot of money and retire early. ...and until you do, gives you total job security, since nobody but you can actually read the crap you wrote.

      Oh yeah, those were the days at some large, German company. I heard they still use the crapola spaghetticodemonster I created. I really, really don't want to meet the maintainers and have to admit that I was the one creating it. That's something you usually get to see on Springer.

      --
      We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
    3. Re:"Good practice" is an outdated concept by Pike65 · · Score: 4, Insightful

      Lemme guess - you're a contractor.

      Unfortunately someone has to maintain your crappy code, and from my experience contractors all seem to be well aware that it isn't going to be them. We've stopped hiring contractors now, because frankly I'm tired of cleaning up other people's shit.

      As to my advice:

      - have a proper data layer (we codegen it using Entityspaces)
      - have a proper business layer (we codegen most of that too with Codesmith)
      - it's a database, not a spreadsheet
      - XHTML will make your life easier

      --
      "If being a geek means being passionate about something, then I pity those who aren't geeks." - Pike65
    4. Re:"Good practice" is an outdated concept by DangerJones · · Score: 2, Interesting

      I'm not a contractor - but I like his style.

      I'm a web developer with a successful SAAS product in the market. It's a cool flashy app that's kept us at the front of technology. Yesterday I could have either built a new ajax graph widget for the front page - so we can win another client - or fixed the log in code so it stopped calling the database twice per log in and save me having to order another server.

      Guess which I did? :)

      There are more types of apps and development practices in heaven and earth, Pike65, than are dreamt of in your advice.

    5. Re:"Good practice" is an outdated concept by Pike65 · · Score: 2, Interesting

      I guess that's what really grates on me.

      You tell a client that they need to pay for a new server and they're fine with that.
      You tell them that they can pay you 30 developer-hours to fix some issues so they won't need the new server in the first place and they act like you're trying to rob them.

      --
      "If being a geek means being passionate about something, then I pity those who aren't geeks." - Pike65
    6. Re:"Good practice" is an outdated concept by Hathor's+Dad · · Score: 0, Flamebait

      "We've stopped hiring contractors now, because frankly I'm tired of cleaning up other people's shit." Sorry the Romans are on the phone and are wondering if .....never mind. Hey you work in X you clean up the Y of the X that went before you.

    7. Re:"Good practice" is an outdated concept by SatanicPuppy · · Score: 1

      I don't know about you, but 30 hours of my time would buy a hell of a server.

      Anyway, you have to sympathize with their desire for something tangible. If anyone ever asks them to cost justify a server, they can take that guy into the server room and point to it. If someone ever asks them to justify the code...Well, that gets ugly. "We had to fix the code." "O Rly? Why didn't it work right in the first place?" "Well, it did, but..." "So you gave the same people more money?" "Uhh, well, other people would have cost..." Etc, etc, etc.

      I used to do consulting where I cleaned up existing monstrosities, made them maintainable, etc. When you do that kind of work, you ask for your money up front, because as soon as they start code auditing and find out that you reduced their codebase by 40% they lose their minds, because the metrics they use to put that crap in the budget don't account for "negative work".

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    8. Re:"Good practice" is an outdated concept by oliverthered · · Score: 1

      now all you have to try and do is keep your customers happy even though you've got a flaky product.

      --
      thank God the internet isn't a human right.
    9. Re:"Good practice" is an outdated concept by SatanicPuppy · · Score: 1

      This kinda stuff is a special case...Working on a pre-existing system, especially one that is so screwed up that the in-house people can't fix it, you're generally going to be charging a minimum of 150.00 an hour, and it can easily be 3 times that.

      It's a hell job, so if you can do the work, you can set your price.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    10. Re:"Good practice" is an outdated concept by TheLink · · Score: 1

      "Why didn't it work right in the first place?"

      Well thing is, if you wrote stuff that worked right in the first place, bosses don't seem to appreciate it. Not like they'd give you a big raise.

      After all you're not working hard like the rest fixing bugs, spending hours to add new features etc. You're also not filling out your timesheet with huge amounts of activity.

      And most bosses certainly don't appreciate the "rather long period" when you're just sitting around thinking about it, or vainly trying to given the typical cubicle in a noisy environment.

      Lastly, what are the odds that they'd even notice they didn't need to hire Mr Consultant to rewrite the code that was written right? ;)

      --
    11. Re:"Good practice" is an outdated concept by SatanicPuppy · · Score: 2

      Well, I had less sympathy for that stuff when I worked for development companies, because we had good processes, and people who knew code to vet and double-check things.

      I've worked in some non-computer-focused industries since then though, and the way projects come about is wildly different, so I can appreciate the bastardized hell code I used to work on better. Hell, I've even produced some of it.

      When you have 20 practical projects on your plate and every single one of them has a FUNCTIONAL PURPOSE (e.g. "Processing credit cards put into a database"), and you have no code oversight, and people breathing down your neck all day every day demanding status reports, you bang out ugly functional code, often comprised of hacked off pieces of other projects, with wild-assed jury-rigged code holding everything together. It's ugly. It's slow. It works. Next project.

      You come into a place where some under-appreciated code monkey has been slaving away for a decade with little or no oversight, and you're going to find this kind of crap. And when that guy leaves, as he inevitably will, either through death or stress meltdown or (rarely) actually being terminated, that hell-beast of code will become instantly unmaintainable, and the bosses will have to find someone who can clean it up, or they'll have to pay someone to replace it.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    12. Re:"Good practice" is an outdated concept by Fujisawa+Sensei · · Score: 1

      Why waste that time writing good code that's going to be thrown out anyway?

      How about because your being paid to write good code?

      Write cool code that makes you look good. Make a lot of money and retire early.

      Not where I work. We give the cool stuff to the developers in house, the ones who have been here awhile, because the new apps to work with other applications and in house APIs, and we aren't going to take the time teach a job hopper that much about our systems. If you're hired as a contractor where I work you're a warm body because some idiot manager, has created an impossible time line and his VP buddy has decided he needs help so he throws contractors at the job so they look good for their bosses. Then the real engineers have to find something to keep you busy where you can't do much damage and take up too much of our valuable time.

      Also we do code reviews for all contractor code and with my group and other groups if its not good code, you get to rewrite it. If you don't product satisfactory code you get to start looking for work again. In fact getting rid of contractors is easy. All I have to do is say, I'm not satisfied with your code and you aren't improving, then you're gone. No questions asked.

      --
      If someone is passing you on the right, you are an asshole for driving in the wrong lane.
  4. Not news by Anonymous Coward · · Score: 0

    "Why not try using traditional computer programming and best practices of software engineering?"

    By now, this is -- or should be -- common practice.

  5. Productivity vs. The Right Thing by Max+Romantschuk · · Score: 4, Insightful

    Most web developers I know (myself included) have a fair idea of how to do things well. But most web development is project-driven, and once the page/site/app looks and works OK telling management that you need an extra week to refactor things isn't necessarily feasible.

    That being said, we all know what happens to maintainability of a big project if done the fastest way possible...

    Damned if you do, damned if you don't.

    --
    .: Max Romantschuk :: http://max.romantschuk.fi/
    1. Re:Productivity vs. The Right Thing by siyavash · · Score: 1

      I second that, it's very true. Sadly, a week extra for doing better code is not doable for all projects. They usually want the project out the door "yesterday" :(

    2. Re:Productivity vs. The Right Thing by Opportunist · · Score: 3, Insightful

      Actually, worse than that. You have it designed, created, streamlined and finished, all the while management tells you during reviews it's fine and exactly what they want, then, as soon as it's done, they want it upside down and inside out, and you get a few hours to basically rewrite it all because "It's all allready there, how much work could it be to do the few adjustments?"

      And this is where it starts to get ugly.

      --
      We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
    3. Re:Productivity vs. The Right Thing by Anonymous Coward · · Score: 0

      yeah. the poster is absolutely right about writing scripts that are processed on the server. Just like this site i developed http://www.ebuynigeria.com/ which is totally server sided.

    4. Re:Productivity vs. The Right Thing by Anonymous Coward · · Score: 0

      Amen, brother (or sister)! I feel your pain. Daily.

    5. Re:Productivity vs. The Right Thing by Anonymous Coward · · Score: 0

      your story sounds familiar, but you know your boss really has issues when they have you do a working model before he'll go to the designers/graphics people and ask them what it should look like and how it should work.

  6. XSLT! by Toreo+asesino · · Score: 1

    Good article, but it doesn't mention anywhere XSLT - quite a major "step" in the giant layered cake that is web dev....which is basically from the bottom:

    DBMS + Server-side code, XML, XSLT, HTML/Javascript, CSS

    Xslt takes all the need to program & process display logic out of the server-side code, and is completely language independent - making it highly portable. It rocks when you know how to control the beast. You don't even need a server to run it - every browser since 1995 is capable of doing XML+XSLT client-side, meaning a whole chunk of "code" can be cut out from core development.

    --
    throw new NoSignatureException();
    1. Re:XSLT! by Anonymous Coward · · Score: 1

      XSLT isn't 'language independent' -- it's a language. In XML.
      Sheesh, Java developers...

    2. Re:XSLT! by mcvos · · Score: 4, Insightful

      Xslt takes all the need to program & process display logic out of the server-side code

      XSLT should only be used to transform backend XML into different XML or HTML. It should not be used for any kind of logic, processing, etc, because it doesn't perform nearly as well as a real programming language, and becomes very unreadable as soon as you deviate from simply applying templates and doing straightforward transformations.

      I program in XSLT every single day, and I use a framework (Apache Cocoon) that is basically designed around XSLT transformations, and the most common problems I see, are caused by people trying to do complex stuff in XSLT. XSLT is really great. Really. But it's no substitute for Java.

    3. Re:XSLT! by Anonymous Coward · · Score: 1, Informative

      every browser since 1995 is capable of doing XML+XSLT client-side

      Really? Browsers have supported XSLT since four years before it was standardised (and three years before XML was standardised)?

  7. Avoid ActiveX is a better start. by Anonymous Coward · · Score: 0

    See subject

  8. Theres only one programming practice : by unity100 · · Score: 2, Insightful

    1 - Do whatever your client wants you to do.

    there is no 2. thats that. your client is your software development customer if you are self-employed or working as a lead developer in a software house, and your client is your superior if you are a programmer employee.

    each and any other practice are only valid when you are doing your own personal projects.

    1. Re:Theres only one programming practice : by Anonymous Coward · · Score: 1, Insightful

      1 - Do whatever your client wants you to do.

      there is no 2. thats that. your client is your software development customer if you are self-employed or working as a lead developer in a software house, and your client is your superior if you are a programmer employee.

      each and any other practice are only valid when you are doing your own personal projects. Clients often have only a limited idea of what problems are connected with a certain development approach. Letting a totally clueless client micromanage the way you implement a solution is a recipe for disaster. In the end it is your role as a developer/engineer to criticize what the client wants you to do and if necessary point out better and more efficient ways of accomplishing it than the methods your client has in mind. In the end you are going to have to put this project on your CV, so a failed project that results in a bad product isn't just your client's problem it is also your problem because to some extent it reflects on your competence as a developer. Personally I'd rather bail from a project that I can see is going really badly than to stay with it to the end and have to explain why it crashed and burned when I get asked about it on my next job interview.
    2. Re:Theres only one programming practice : by rucs_hack · · Score: 5, Insightful

      Nice idea. Unfortunately, clients do not always know what they need. They usually have an idea of what they want, but not how best to achieve it.

      If asked about the development process they want, most would say 'fast and cheap'. Bearing in mind that a less than perfect website that is up and gaining revenue is better then a wonderful, fully featured website of d00m that won't be ready for six more months. A good programmer should advise the smallest possible feature set at first, so that can be tested, and decisions made as to the best way to proceed.

      Besides, a cheap website can be improved over time, an expensive one that looks nice but doesn't quite do the job (find me a version 1 of anything that did) is costly even if all you do is remove stuff you paid a lot for.

    3. Re:Theres only one programming practice : by simong · · Score: 4, Insightful

      Not true. Take your client's requirement and interpret it in according to standards and best practise. Your client has hired you for your skills so it's your duty to do it properly and make it easy to update in the future if it's you who has to update it or someone else. Anyone can design a web page and far too often it's obvious that anyone has.

    4. Re:Theres only one programming practice : by someme2 · · Score: 3, Insightful

      1 - Do whatever your client wants you to do.
      Yes.
      Elaboration:
      • Define an appropriate granularity of your actions that you expose to the client.
      • Ensure that each action block results in something the client wants.
      • Do not do whatever your client wants you to do inside of an action block.
      • In time & material based projects an action block length may be atomic (client advises you on microscopic action, e.g. client says: Now press return. Now write 10 ?"Hello World").
      • In fixed price projects action block lengths can be defined by milestones (possibly with deliverables). Communication during action blocks may be a matter of tactics (e.g. misrepresenting project state as better or worse than in reality if necessary).
      • Client triggered course changes during action blocks in fixed price projects result in billable change requests.
      Or something to that effect...
      --
      You can attach boosters to anything. It just costs more. -
      Anonymous Coward on Sunday November 07, @12:26PM
    5. Re:Theres only one programming practice : by unity100 · · Score: 1

      youre right from tip to toe, but, its the client. rather stay with the project and explain stuff than leave them halfway.

    6. Re:Theres only one programming practice : by unity100 · · Score: 1

      everyone does that. however client has the last word.

    7. Re:Theres only one programming practice : by TrappedByMyself · · Score: 1

      I'm pretty sure you didn't understand TFA

      --

      Help me take back Slashdot. When did 'News for Nerds' become 'FUD and Conspiracy Theories for Extremist Nutjobs'?
    8. Re:Theres only one programming practice : by apt142 · · Score: 2, Informative
      Agreed, I find it is much, much easier to do small incremental updates and gains than to do the big website of d00m. Chances are, if you work with a customer and get the that version 1.0 up and running well, they'll look at you to do more for them. It is so much easier then to kick into incremental updates. Do small but functionally significant improvements.

      Going from version 1.0 to 1.1 is much easier than from 1.0 to 2.0. And there are added benefits.

      • Since the changes are so small it's easy to explain what is covered in the scope of the change and what you can promise in another change. This keeps yourself from getting derailed by "new shiny's".
      • Not doing a lot of change all at once lets the users get trained to the new functions without getting overwhelmed.
      • As a developer you'll be forced to think more modularly. Which in my experience has been a very good thing.
      • The changes will be able to be done very quickly. So, the managers see progress, the company sees improvements.
      • Having the small projects lets you reorder them by priority and gets you a flexible long term plan.
    9. Re:Theres only one programming practice : by Hognoxious · · Score: 1

      everyone does that.
      The guy I replaced didn't. His code looks like a trainee shipping clerk dictated it to him over a bad phone line.

      however client has the last word.
      No, I do. I quit!

      You really can't win in this situation - say anything and you're wrong for arguing, do what they say (even if you said it won't work, it writing, in triplicate) and it's your fault when it doesn't work.

      They say that if one thing irritates doctors, it's patients who self-diagnose. I can see why.
      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    10. Re:Theres only one programming practice : by unity100 · · Score: 1

      You really can't win in this situation - say anything and you're wrong for arguing, do what they say (even if you said it won't work, it writing, in triplicate) and it's your fault when it doesn't wor

      no client is able to object when what happened was due to what they have requested despite being warned about.
    11. Re:Theres only one programming practice : by Hatta · · Score: 1

      You'd be surprised.

      --
      Give me Classic Slashdot or give me death!
    12. Re:Theres only one programming practice : by grahamd0 · · Score: 2, Insightful

      "If I asked people what they wanted, they would have said 'faster horses.' "
      -Henry Ford

    13. Re:Theres only one programming practice : by unity100 · · Score: 1

      hahaahahahahaaa

      well, henry ford was an inventor. he is exempt from this subject, since inventors are people who go against the advice, and make something that is not done before and make it big - its pointless, they generally are not subject to any serious supervision.

    14. Re:Theres only one programming practice : by grahamd0 · · Score: 1

      He was an inventor, but he didn't invent the internal combustion engine or the automobile, in that context he was primarily a skilled manager and salesman. If you don't think it's a relevant quote, try asking a client what they want rather than helping them determine what they want. Most of them want boring, annoying flash intros, background music, annoying sound effects, all-flash layouts for what is essentially a brochure, etc. They're not stupid, they're just lay-people who've been exposed to 15 years of terrible websites, just like consumers at the turn of the 20th century who've only been exposed to horses for transportation.

    15. Re:Theres only one programming practice : by unity100 · · Score: 1

      He was an inventor, but he didn't invent the internal combustion engine or the automobile, in that context he was primarily a skilled manager and salesman.

      inventing mass production line. its an invention by itself. lets say it wasnt. even then he would be exempt from the rule since he is an innovator, and would be less dependent on investors, sponsors or clients than anybody else probably. that was the main idea i was talking about.

      If you don't think it's a relevant quote, try asking a client what they want rather than helping them determine what they want. Most of them want boring, annoying flash intros, background music, annoying sound effects, all-flash layouts for what is essentially a brochure, etc. They're not stupid, they're just lay-people who've been exposed to 15 years of terrible websites, just like consumers at the turn of the 20th century who've only been exposed to horses for transportation.

      well you gotta give them that. and then the other stuff.
    16. Re:Theres only one programming practice : by grahamd0 · · Score: 1

      We're clearly coming at this from different points of view.

      You're totally correct, if you accept a job and take someone's money, you do have to give them everything they ask for.

      However, if potential clients don't see me as an expert who knows more about my area of expertise than they do, I choose not to work with them.

      I recommend the philosophy. I've never made more money or been more satisfied with my work than I am now.

    17. Re:Theres only one programming practice : by unity100 · · Score: 1

      the fact is i see web development as a service to people. they have dreams, they come to you and they expect you to realize it. so i dont discriminate between them, and take any jobs.

    18. Re:Theres only one programming practice : by grahamd0 · · Score: 1

      But having a flash intro or whatever isn't really their goal. If they're a for-profit company, ultimately their goal is increasing their profits. They probably have other secondary goals related to accomplishing that goal, such as growing their brand awareness or providing better customer service. Those are the goals they need to accomplish with their website, not "having a flash intro". So if a client asks for something that I know from experience and observable metrics will run contrary to their real goals, it would be unprofessional of me not to explain that to them and to try to help them figure out a better way to accomplish those goals.

    19. Re:Theres only one programming practice : by Hognoxious · · Score: 1

      Can too. Far too many people buy into the myth that the customer is always right (including the moron of an IT director I have to tolerate at the moment).

      You're either very young and naive or you've been extremely lucky not to have come across people like that.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    20. Re:Theres only one programming practice : by unity100 · · Score: 1

      actually im a cautious person.

    21. Re:Theres only one programming practice : by Anonymous Coward · · Score: 0

      I am too, especially after I was told to stop working on X and do Y, then fired because I missed the deadline for X.

  9. I am pretty confident.. by daydr3am3r · · Score: 3, Insightful

    ..that a vast majority of all we see on what's out there and instantly disregard as bad practices, are the result of pressure from marketing, management, corporate interests, politics, whatever you may call it, applied to a skillful and knowledgeable handful of people that had the mischance of being skilled at their craft, but powerless to make a stand on what is best and more efficient for the actual code and most probably, for the actual target audience. Of course that applies to any product, commercial or otherwise, being created by the ones who have the expertise but controlled by the ones who are considered managerial staff and probably know next to nothing about the product in question. Can you make it great? Perhaps you can. Do you have sufficient time/permission/resources to do that? Well then, that's probably not up to you now, is it?

  10. Well, it does make me wonder, though by Moraelin · · Score: 5, Insightful

    Well, you bring an insightful point into how that goes downhill, but that's exactly what makes me wonder.

    Engineering used to be about starting from a problem and figuring out the best solution. Well, best within the limits of your knowledge and abilities.

    E.g., let's say you have to get people from A to B across a river. You'd start from that problem and figure out a solution, and not from "but I wanna build a cantilever bridge, 'cause it's the latest buzzword" and find a river in the middle of nowhere. Or dig a canal if you don't have a river for your buzzword bridge.

    Then you'd look at the exact data your problem is based on. How wide is that river? What kind of traffic you expect over it? Is there barge traffic on the river that you'd have to deal with?

    Then you'd look at the alternatives: do you need a bridge? Maybe a ferry is enough? How about a tunnel under it? If you decided on a bridge, should it be cantilever, suspension, or what? There is no free meal. Each option has its own advantages, but, and here's the important part, also its disadvantages and limitations.

    And I think that's exactly what's missing in most of "software engineering" today. People start from what's the latest buzzword, and then work backwards to try to find some problem (even imaginary) to apply it to. They'll build a bridge in the middle of nowhere, in the style of 19'th century follies, just because they want a cantilever truss bridge, everything else be damned.

    (Except the 19'th century follies were actually known to be follies, and built as a fucked-up form of social security in times of crisis. The laissez faire doctrine said that it's wrong to (A) just give people unemployment benefits, since supposedly that would have turned everyone into parasites, and/or (B) to use them to build something useful, since that would have competed with private initiative. So they built roads in the middle of a field, towers in the middle of nowhere, etc, instead. Whereas today's programs don't even have that excuse.)

    And while it's fun to blame monolythic programs written by monkeys, I'll go and blame the opposite too: people who do basically an overblown cargo-cult design.

    (Cargo cults happened on some islands in the Pacific when some supplies were supposedly paradropped to troops fighting there, but instead landed on some local tribe. The aborigines then proceeded to worship the big birds that dropped those, and pray that they come drop some more of that stuff. And when they didn't come back, they sculpted airplanes out of wood, and kept hoping that those'll drop some food and tools.)

    People who don't understand what a singleton, or a factory, or a decorator pattern, or a manager pattern are, or when they're used, go ahead and created tons of them just because they got told that that's good programming practice. Everything has to go through layers upon layers of decorators, built by a factory, which is a singleton, registered with a manager, etc. They don't understand what those are or when or why they're used, so they effectively went and sculpted their own useless wooden factory, like the tribes in the Pacific.

    So maybe just telling people about some "best practices" isn't everything. Some people _will_ manage to turn any best practice into the worst nightmare. Maybe what's really needed is to remind more people what engineering used to mean.

    The same goes for design before implementation. There are places which sanctified the worst caricature of the waterfall model, but again, in a form that actually is worse than no design. Places where you have to spend two years (don't laugh, I know of a team which had to do just that) getting formal specs out of every single user (who hasn't even seen a mock-up yet, and some don't even understand what the techies actually want), then have an architect design an overblown framework that does everything except what the users actually wanted, then get on with the coding, then they have 1 month allocated for tests and debugging at the end

    --
    A polar bear is a cartesian bear after a coordinate transform.
    1. Re:Well, it does make me wonder, though by nospam007 · · Score: 2, Informative

      (Cargo cults .....The aborigines then proceeded to worship the big birds that dropped those, and pray that they come drop some more of that stuff. And when they didn't come back, they sculpted airplanes out of wood, ....
      ---
      Actually they did the _airport_ (not the planes) out of wood and straw, complete with tower and offices.
      They wanted to attract the planes.

      from Wikipedia: ...
      Famous examples of cargo cult activity include the setting up of mock airstrips, airports, offices and the fetishization and attempted construction of western goods, such as radios made of coconuts and straw. Believers may stage "drills" and "marches" with twigs for rifles and military-style insignia and "USA" painted on their bodies to make them look like soldiers, treating the activities of western military personnel as rituals to be performed for the purpose of attracting cargo. The cult members built these items and 'facilities' in the belief that the structures would attract cargo. This perception has reportedly been reinforced by the occasional success of an 'airport' to attract military transport aircraft full of cargo...

    2. Re:Well, it does make me wonder, though by Hathor's+Dad · · Score: 1

      Engineering used to be about starting from a problem and figuring out the best solution. Well, best within the limits of your knowledge and abilities.

      That is exactly what is required to innovate. Looking at solved problems does not make one engage at solving the problem themselves. People cry don't reinvent the wheel but then wonder why the prodigy of that idea have no idea what a spoke is.

      Go invent your own wheels!!! There is much to learn, much knowledge to enjoy. Do it for yourself. Do it because you want to. Don't reach for the wheel.

    3. Re:Well, it does make me wonder, though by TheDugong · · Score: 1

      Depends which cult. The John Frum cult on the island of Tanna in Vanuatu did/do the runway thing.

      However, look at the, now defunct, office cargo cults from this perspective:

      Stone age Papua New Guinean sees fantastically wealthy - to a hitherto unknown level - white men arrive. His people have already figured out that they are not gods, but merely men with white skin. He takes notice of the fact that the white man sits in an office all day doing no more than passing paper around while the black fellas do all the work and do not get anywhere near as rich. He comes to the conclusion that the way to riches is to create an office and pass paper around.

      How much of a modern western economy is based on shuffling papers? The right papers in the right order, but shuffling papers no less.

    4. Re:Well, it does make me wonder, though by Anonymous Coward · · Score: 0

      Oh....my....god. Let me see if I can hit this nail on the head.

      You LOVE UML.
      You hate computer science majors.
      You are a rocket scientist...seriously.
      You love Java but seem to write most of your stuff in C#.
      You hate Microsoft Visual Studio yet you still use it.
      You talk to students like they are idiots.
      You collect cookie fortunes and comics (...boring).
      You used to sing until you realized a pizza could feed a family of four while you couldn't.
      You went back to college, became an engineer, and have yet to get off of your high-horse since.
      You are from a German decent.....remember at Deer Park?

    5. Re:Well, it does make me wonder, though by bobetov · · Score: 1

      And I think that's exactly what's missing in most of "software engineering" today. People start from what's the latest buzzword, and then work backwards to try to find some problem (even imaginary) to apply it to. They'll build a bridge in the middle of nowhere, in the style of 19'th century follies, just because they want a cantilever truss bridge, everything else be damned.

      The main reason I use the same set of tools for each project I do, to the limit of my ability to do so, is not because it's flashy, but because the code I've written and used before is far more trustworthy, and faster to apply, than a new from-scratch solution.

      You'd see an awful lot more of the kinds of behavior you're attacking if engineers building bridges could, freely and quickly, clone an actual bridge. Code re-use is a very good idea, and so the fact that I use fancy widgets a lot has more to do with my having fancy widget libraries that I trust than that I love fancy widgets per se.

      I guess I'm just frustrated by the inevitable comparison between software design and other real-world engineering design. The domains have very, very little to do with one another. Analogies between the two realms rarely add value to the discussion, IMHO.

      --
      Looking for a Rails developer in Chapel Hill?
    6. Re:Well, it does make me wonder, though by Hognoxious · · Score: 1

      There are places which sanctified the worst caricature of the waterfall model, but again, in a form that actually is worse than no design.
      Holy false dichotomy, Batman! While it's impossible to pin-down 100% of the requirements in advance (the so-called BDUF methodology) that doesn't mean you shouldn't be aiming at 90%, or that 0% is ideal. Let's say we were building an accounts system. It'd be good if we knew in advance whether it had to cover sales, purchases, or both.

      the requirement that a form has to be saved in the database each time the user leaves a field or switches tabs on a tabbed pane
      That's not a requirement. It's a method of implementing one.

      He just wanted that the data doesn't disappear from his form when he switches tabs.
      That's a requirement.

      If you let the users do detailed technical design you're hosed before you start. I could tell a hundred war stories about this. They rarely if ever have the knowledge or skills - but often think they do. They should be specifying what, not how.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    7. Re:Well, it does make me wonder, though by Moraelin · · Score: 1

      Oh....my....god. Let me see if I can hit this nail on the head.

      To spoil the ending for you, you missed by a wide margin. Starting with the fact that instead of worrying about whether the message is right or wrong, you try to figure out a way to pick at who wrote it. Still, in the interest of transparency:

      You LOVE UML.

      Can't say I have any particular fetish for that. Honestly, even if you just spend 5 minutes thinking in your head, "ok, do I need a singleton here? What am I trying to accomplish? What alternatives are there?" that's already a damn good start. That's what engineering is about. That's my main point. Whether you actually go and formalize it in any other way, we could make a whole thread out of that too. But for a start, just asking yourself why you need something, and if you really need it, is already something I'd praise.

      You hate computer science majors.

      Nope, not really. In fact, I'd gladly take more of those and less monkeys who don't even know what the O notation is. Mind you, I have my minor disagreements with some of them, but it's far, far, far from being even close to "hate". In my top 10 list of "what's wrong with programming today", CS doesn't even make it on the list.

      You are a rocket scientist...seriously.

      I wanted to be a rocket scientist, seriously. See, my first nerdy obsession as a kid was physics. But having also grown up with a computer, by the last year of high school I figured out that I like computers more. So I went and studied that instead of physics.

      You love Java but seem to write most of your stuff in C#.

      Actually, I don't even know C#. Which is a shame, really. I should study it soon. Knowing one more tool is never bad.

      You hate Microsoft Visual Studio yet you still use it.

      Wrong on both counts, actually. I only used MSVC waay back for C++. It seemed like a nice IDE actually. I still liked Borland's compilers more, but still, I had not much reason to hate MS's IDE either. Nowadays, I use Eclipse.

      You talk to students like they are idiots.

      Now, now... I like to think I'm above petty a-priori discrimination against any group, students included. I talk to _everyone_ like they're idiots ;)

      You collect cookie fortunes and comics (...boring).

      Guilty as charged. Well, computer games too. Can't forget those.

      You used to sing until you realized a pizza could feed a family of four while you couldn't.

      Heh. Nah, you obviously never heard me sing. I'm pretty sure I wouldn't even be allowed to do it in public. It would probably count as cruel and unusual punishment under the terms of the Geneva convention ;) So, nope, I never tried my luck there. I went straight to be a programmer after college, and it actually paid damn well so far.

      Mind you, it was the dot com craze of the 90's. Anyone could make a damn good living if they knew anything about computers. (For example where the start menu is.) So much as I'd love to wave that as some proof of my l33tness, truth is, it doesn't say much. Probably staying in the job, and even getting a pay raise, _after_ the dot-com bubble imploded is by far a bigger achievement.

      You went back to college, became an engineer, and have yet to get off of your high-horse since.

      Again, wrong on both counts. That was the college I went to in the first place, so there's been not much reason to go back. As for the high horse, pfft, I was pretty much born in the saddle. I don't need college to teach me to be snotty ;)

      If anything, I thought I mellowed out a bit ever since. I'm at least trying to give other peo

      --
      A polar bear is a cartesian bear after a coordinate transform.
    8. Re:Well, it does make me wonder, though by Bloke+down+the+pub · · Score: 1

      I guess I'm just frustrated by the inevitable comparison between software design and other real-world engineering design.
      Even though they don't always stand up to scrutiny (what analogy does - if it did it wouldn't be an analogy, it would be reality) they're a useful counter to the PHB types who come out with crap like "How long to change it? But it's just a simple bit of typing!"

      Another analogy here is what would happen if you changed a few lines of a novel - say made a character male instead of female. It may still make grammatical sense but the plot might become nonesense.
      --
      It's true I tell you, feller at work's next door neighbour read it in the paper.
  11. Misleading question by suv4x4 · · Score: 5, Insightful

    "Why not try using traditional computer programming and best practices of software engineering?".

    Did you see the straw man? The question assumes we do NOT follow best practices already, and sends us on the wrong path to doing so, having to explain ourselves.

    A quick run down of the article: getting requirements, D.R.Y., refactoring, test-driven development. Why on Earth assume we're new to this. Grab any amateur framework for web dev and see what it's about. Framework people's mantra is all about D.R.Y. and even taking it to inappropriate extremes.

    But I do use best practices, and I believe many do. Here's the catch: there's no single set of best practices.

    On the server side the task, dev tools, and target platform are quite classical, and hence the best practices are similar to classic development (and it's mostly classic development after all, parallelizable task).

    On the client side we have several awfully inadequate standards, with several awfully inadequate clients (browsers) that interpret those standards more subtly or less subtly differently, and all of this runs in a sandbox, streamed through the tiny pipe of our site visitors/service users. It's a brand new challenge, with brand new bottlenecks, and has brand new best practices.

    And I'd argue still many people get it right for what I see. If you believe you can do better than what we have, by all means don't just talk, but go on and do it.

    1. Re:Misleading question by herve_masson · · Score: 2, Informative

      On the server side the task, dev tools, and target platform are quite classical, and hence the best practices are similar to classic development (and it's mostly classic development after all, parallelizable task).

      Web development adds specific complexity to "classical" dev platforms. You have to deal with 4 dialects at minimum: html, css, javascript, and the one that really run on the server. Worse than that: you are usually given development tools that makes possible (and encourage) to mix these languages endlessly in a single piece of code.

      Web dev best practice #1 to me is: do _NOT_ mix this stuff; keep them well apart as much as you can, otherwise you endup with spaghetty-write-only-code than even you won't be able to read in a few month from its writing (I'm assuming the programmer care about that). Mixing them will also guarantee that you won't be able to reuse your code efficiently.

    2. Re:Misleading question by seebs · · Score: 1

      I have used an awful lot of web sites that very clearly do not follow even basic and reasonable engineering practices.

      I know that many developers are doing their best with sucky tools, but you guys will always be outnumbered by people who aren't, same as in any other field. Most of the web developers I talk to are totally shocked at the notion that they should care about "software" engineering, when all they're doing is "page design".

      --
      My blog: http://www.seebs.net/log/ --- My iPhone/iPad app: http://www.seebs.net/seebsfrac/
    3. Re:Misleading question by Anonymous Coward · · Score: 0
      Moreover, the article shows a distinct misunderstanding of TDD and why it's valuable.

      Quoth the article:

      TDD is an agile development methodology that says you should test like you vote -- early and often! When you're designing a Web page, be sure you know what your target platforms are and whether your page works on them.
      What makes TDD so important is the realization that there's never enough time to do sufficient manual testing but that automated testing allows tests to be run quickly by developers to ensure that they (most likely) haven't caused a regression.

      This doesn't mean that web programmers shouldn't practice TDD. Things like Selenium and JSUnit, while clunky, are a lot better than nothing. But summarizing TDD as basically "you should manually test your code a lot" shows a fundamental ignorance of why it's important to practice TDD.
  12. In a word... by dkh2 · · Score: 1

    DUH!

    Better practices make for better pages that load faster, have fewer (if any) linking errors, and make minimal use of client-side work.

    --
    My office has been taken over by iPod people.
  13. Only one best practice needed by wrmrxxx · · Score: 1

    If/when software development becomes simple enough to reduce to a set of universally applicable simple rules, human beings probably won't be needed to do the job.

    The best of best practice is to use your experience and knowledge to program in a way to suit the situation you find yourself in. Don't rely on any arbitrary list of 'best' practices to suit your particular circumstances and lead you to a good result. Including this one.

  14. Sadly by achurch · · Score: 1

    I've had people seriously make that argument to me. Whatever happened to pride in workmanship?

    1. Re:Sadly by BadAnalogyGuy · · Score: 1

      If I get paid the same whether I paint No. 5, 1948 or the Sistine Chapel, it only makes sense that I would put the minimum amount of effort into the work before moving on to the next project.

      You ask "whatever happened to pride in workmanship". The answer is that each individual accomplishment is a source of enough pride to carry me over to the next lucrative job.

      You can spend each day contemplating whether tempra is a better medium than oil-based paints, but I'll be splashing buckets of paint onto canvas and taking a tidy profit from each "exertion" while you're still counting the number of camel hairs on your brush. There's a place for both of us in this world. Mine is in the here and now. Yours is in the long-term historical record. When I'm dead and gone, you can have the last laugh. Until then, let me snort my cocaine off supermodel bellies in peace.

  15. QUITE NICE by techoon · · Score: 0, Offtopic

    THis story seems quite nice for me. i wonder why http://slashdot.org/firehose.pl?op=view&id=281259 is not yet being promoted by slashdot editors.it is a nice one isnt it? http://slashdot.org/firehose.pl?op=view&id=281259/

  16. too easy by theMerovingian · · Score: 0


    Web pages have become a major functional component of the daily lives of millions of people. Web developers are in a position to make that part of everyone's lives better.

    I just know there's a porn joke in there somewhere...

    --
    "If you think you have things under control, you're not going fast enough." --Mario Andretti
  17. my philosophy by FudRucker · · Score: 1

    Easy on the Giggle Cream...

    --Giggle Cream, it makes desserts funny...

    --
    Politics is Treachery, Religion is Brainwashing
  18. psyched out? by airdrummer · · Score: 0

    i think the idiom u want is "psyched up";-) and i think there are valid reasons to shift the load to the client: sorting tables, 4 instance...it's silly to make another db query to retrieve the same data in a different order.

    1. Re:psyched out? by Opportunist · · Score: 1

      I've seen managers beeng psyched up, down, in, out and I swear, even top, bottom, and very, very strange, too. They've rarely been charming, though. But ya know, some states are hard to come by.

      --
      We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
  19. They didnt work so well for trad projects by supersnail · · Score: 4, Informative

    Traditional projects using so called "best practices" fail with atonishing regularity.

    Most project failures are covered up by tha management but in environments such as UK government projects where public scrutiny makes it imposible to spin failure into success the failure rate is about 60%.

    In my experience the private sector is just as bad they are just better at redfining success to be whateever crud was delivered, or, quietly cancelling projects and pretending they never happened.

    I would also posit that "traditional" best practices are a big contributer to these failures.
    Among the many problems:-
                1. Analysts paying lip service to user requirements but actually ramming thier own pet vision down the customers throats.
                2. Equating expensive with good. Which leads to chosing ludicrously expensive and inappropriate software where something cheap and free would have worked just as well.
                3. Dumping existing working software because it is not "re-usable" for a "re-usable" design which doesnt work.
                4. Spending eons of time perfecting design documents and diagrams as if they were the end product not just a tool for getting there.
                5. Treating all developers as equals. They arent. If you dont recognise and cherish your start programmers you will lose them.
                6. Failing to reconise the simple fact that if you dont deliver something by the second year the prohject will get canned.

    --
    Old COBOL programmers never die. They just code in C.
    1. Re:They didnt work so well for trad projects by twiddlingbits · · Score: 1

      The failure rate is not what you quote. It's slghtly better. There is a firm (Standish Group)that keep statistics (CHAOS report) on the failure rates of software projects. As of 2006 only 35 completed on time and on budget and meet user requirements. However only 19% were outright failures. "Success" is different in every company so these numbers could be biased. In any other industry failing 65% of the time would be a quick way out of business.

    2. Re:They didnt work so well for trad projects by kpharmer · · Score: 1

      > failing 65% of the time would be a quick way out of business

      you would think so.

      However, remember that you can meet requirements without meeting objectives. There are quite a few applications out there that met the requirements, but failed to meet the objectives of adaptability, usability, manageability, etc.

      These apps are error-prone, frustrating, and inefficient to use. They are hated and despised by their users. But they may still be quoted as successes by IT ivory-tower folks specializing in project estimation, etc.

      Lastly, I'm not talking only about custom software here. The above certainly applies to commercial solutions, to network/server/telecom architectures, etc.

    3. Re:They didnt work so well for trad projects by PPH · · Score: 1

      Among the many problems:-
      1. Analysts paying lip service to user requirements but actually ramming thier own pet vision down the customers throats.
      Having worked on everything from corporate IT projects and avionics hardware to utility infrastructure development, I'd have to say this problem looks quite familiar. At some management level, there is someone who pushes the analysts/engineers/whatever to select a vendor and/or architecture. Often, this is done before the scope of the problem has been identified yet. The reason it is done is so that this person (or department) can commence being wined and dined (supplied with hookers?) by the various competing vendors.

      Its a management problem where personnel in key decision-making positions aren't adequately restrained from conflicts of interest. Sometimes its just ideological. Like where a Windows/Linux afficionado will always recommend their favorite platform. Sometimes there are stock options involved.

      --
      Have gnu, will travel.
    4. Re:They didnt work so well for trad projects by jumperboy · · Score: 1

      Traditional projects using so called "best practices" fail with atonishing regularity.

      Most projects fail, regardless of whether best practices were followed (although I believe that implementing best practices informed by experience will improve the chances of a project's success).

      Your list of problems that contribute to failure is spot on. To that list, I would add poor planning, which includes identifying if the need really exists. I'm sure many developers here have worked on a "high priority" project that became a failure simply because it was delivered, but never used, or even evaluated.

    5. Re:They didnt work so well for trad projects by smellotron · · Score: 1

      Traditional projects using so called "best practices" fail with atonishing regularity.

      My Software Architecture professor (Ralph Johnson) said something to the effect of, "Best Practices should really be call Good Enough Practices", because they're really just a collection of ideas that are known to not be outright failures.

      But just because it's not an outright failure doesn't mean that a "best practice" can't still be the wrong thing to do in a particular situation.

    6. Re:They didnt work so well for trad projects by mcmonkey · · Score: 1

      In any other industry failing 65% of the time would be a quick way out of business.

      Or to the Hall of Fame.

  20. Best Web Practices by curmudgeon99 · · Score: 2, Interesting

    Well, I have an entire website that is devoted to answering this question: Free Java Lectures is about that. Specifically, I have a lecture called "Web App Best Practices."

  21. Requirements and Functionality First! by Anonymous Coward · · Score: 0

    Well, instead of focusing on the programming side, why not focus on the requirements and usuabiliy side for once?

    I don't care that you are some 'master webmaster' (ie: I can read learn PHP, Java/Javascript in 21 days..)..but give me a website that is FUNCTIONAL and usable. I don't want or need animated flashing cursors. I don't want or need 500 banners. I don't care about your java crapplet, just let me find the information I want.

    Making a shopping website, just have a cart and a checkout button, nothing fancy.

    Making an information website, let me search, and use boolean search.

    and the list goes on and on...leave your java crapplets at home.

  22. Last Cranky User, too. by seebs · · Score: 1

    And yes, the 76 in that title is (I believe) an accurate article count. The Cranky User column has gone through something like three developerWorks "zones" and had I think six editors.

    It was a lot of fun. :)

    --
    My blog: http://www.seebs.net/log/ --- My iPhone/iPad app: http://www.seebs.net/seebsfrac/
  23. Calendar Tech by Doc+Ruby · · Score: 2, Insightful

    The most important part of being a Web programmer is knowing how to meet a deadline. Part of which is designing the project schedule, which means designing the product in terms of delivery dates and contingencies. And therefore almost as important is how to notice, and to communicate in advance when a delivery might be late, and by how much.

    After learning how to use calendar tech and spoken/email languages for project communication, the rest of the development is relatively easy.

    --

    --
    make install -not war

  24. "Web site" is really "EAI" by Nygard · · Score: 2, Informative

    In the corporate world, there hasn't been a pure "web site" project since about 1998. I said in my book, "Despite lip service, companies didn't really get off the starting line for enterprise integration until they needed to create dynamic websites. Those projects were the impetus that finally forced many companies to integrate systems that have never played well together."

    The place where you need to look for actual software engineering is in the whitespace on the block diagrams. Those innocent looking little arrows that connect the boxes together are the source of most failures and inefficiencies. I've seen one little "interface" arrow implemented with 20 moving parts on half a dozen servers. (Send a message to a queue, the broker picks up the message and appends a line to a file. Once an hour, another broker picks up the file and FTPs it to the "integration server", which then slices the file into lines and uses SOAP to send messages out to a third party.) Talk about failure modes!

    Civil engineers consider the loading factors, material strength, and design life of their structures. Together, these constitute the "design envelope" of the system.

    Software engineers need to think the same way. How long will this system last? One year? Five years? Two months? The level of demand and demand growth over that time span matters a great deal. An architecture that works well for 10,000 page views a day will bomb badly when it's asked to serve 10,000,000. That sounds like a "duh", but it's ignored surprisingly often.

    I could go on and on about engineering systems for real-world survival... but I won't do it here. (Since I already have.)

    --
    "Genius may have its limitations, but stupidity is not thus handicapped." --Elbert Hubbard (1856-1915)
    1. Re:"Web site" is really "EAI" by VoidEngineer · · Score: 1

      MOD PARENT UP INSIGHTFULL!

      By the way, *fantastic* book, Michael! I read the entire thing, and it was 100% spot on. Opened up my eyes to design patterns that I hadn't been aware of, made me appreciate the importance of not re-inventing logging services, and that advice about using the soft references to prioritize garbage collection... simply awesome. You really took my knowledge of programming up a notch.

      Anyhow, I had been thinking of dropping you a note saying how great that book was, and lo-and-behold, I read your post here on Slashdot and realized it was you... great job on the book!

  25. Comment removed by account_deleted · · Score: 2, Insightful

    Comment removed based on user account deletion

  26. Unobtrusive Flash by Keeper+Of+Keys · · Score: 1

    Graceful degradation is quite possible with flash, once you discard those annoying scripts that try to auto-install it (nope. I have already have it thanks, but it's disabled by default - hello NoScript). Content inside the tag will be displayed if the plugin is not available - it's just that most developers can't be bothered to put in anything more useful than a message telling them to get flash.

    This is an example of a flash site I worked on that passed WAI level 2. Try navigating it with javascript off.

  27. DRY CSS example... by ItsLenny · · Score: 2, Interesting
    they said

    h1 { font-family: Helvetica, sans-serif; font-size 250% }
    h2 { font-family: Helvetica, sans-serif; font-size 200% }
    h3 { font-family: Helvetica, sans-serif; font-size 150% }
    h4 { font-family: Helvetica, sans-serif; font-size 100% }


    should be replaced with

    h1, h2, h3, h4 { font-family: Helvetica, sans-serif; }
    h1 { font-size 250% }
    h2 { font-size 200% }
    h3 { font-size 150% }
    h4 { font-size 100% }


    Then they go on to say...

    ...while the second isn't much shorter...

    the second one is actually LONGER and more characters and why do you even need that top line...umm are we not using a font tag in our body?

    body, td{ font-family: Helvetica, sans-serif; }

    this topic makes sence for PHP, java, javascript, ASP, etc... but HTML is not a programming language it has no logic... no loops.. it's just data storage really...

    the one thing I will admit (as a web designer who still makes everything in notepad) is the way web design software makes HTML does drive me nuts... but thats just 'cause I started making websites when the size of your file mattered back in the days of 28.8 k/33.6 k ...so I still think that every byte counts... however really in a word where almost everyone has DSL or better the size of an HTML document doesn't matter much at all (within reason)

    </rant>
    --
    ----------
    Trying to fix or change something only guarantees and perpetuates it's existence
    1. Re:DRY CSS example... by nygma666 · · Score: 1

      I'm happy to know I'm not the only one who still 'codes.' It is insane to have to pick up a site in development, and was designed using a designers point rather than a programmer. Coming from a software background, it amazes my clients how clean my stuff is to not only look at, easy to debug, and how much less space it takes up. (i'm from the same old school of every byte counts). The biggest issue I have tho is the client and their persception of thier own users. They always want flashy state of the art stuff, when 90% of thier base usually never even has the ability or want to use it. Greatest example was a contract I had. 1) after nearly finishing a site they come to me saying the layout wasn't what was agreed to. Funny thing from my point of view as I had been working with thier own person on this and the dummy site had been availble to view on a server as we worked on it, which they had been viewing (I had a tracking cookie in it) the whole time. Of course they wanted the whole thing re-done by yesterday! 2) The intended audience was some schools from poor neighborhoods, with barely hanging by a thread infrastructure, and by that i mean 800x600 screens that were all blurry on machines that can't rival my wrist watch. Yet they wanted all the bells and whistles. I warned them, but they made me do the work anyways with the predictable results. Glad I made them sign a waiver stating they were ignoring my advice. Turns out, i made loads off them in after launch trouble shooting. The whole server/cpu side issue i think is kind of pointless. Theres no right way of doing it, it all depends on the client's servers, the audience and goofy management thinking. :-)

    2. Re:DRY CSS example... by Anonymous Coward · · Score: 0

      but HTML is not a programming language it has no logic... no loops.. it's just data storage really...

      I call it what it is, markup.

    3. Re:DRY CSS example... by smellotron · · Score: 1

      the second one is actually LONGER and more characters and why do you even need that top line...umm are we not using a font tag in our body?

      Whoa, calm down! This was a pretty limited example... If you follow the spirit of the article, you would probably be able to skip that first line, if Helvetica was the site-wide font.

      this topic makes sence for PHP, java, javascript, ASP, etc... but HTML is not a programming language it has no logic... no loops.. it's just data storage really...

      So you think repetition is somehow more acceptable for structural markup? Just because it's not executing doesn't mean that poorly-factored CSS isn't a PITA to maintain.

      the one thing I will admit (as a web designer who still makes everything in notepad) is the way web design software makes HTML does drive me nuts... but thats just 'cause I started making websites when the size of your file mattered back in the days of 28.8 k/33.6 k

      The size of files still matters... the effect is less pronounced than it used to be, but it's still definitely an issue. Some web authors even deliberately break standards-compliance to reduce size, since many attribute quotes and close-tags can be omitted without confusing web browsers. But if you use Notepad to keep your HTML sizes down, you're a braver man than I... I like an editor with syntax highlighting (Notepad2, or EditPlus, or GVim, or anything but god-awful Notepad!).

  28. More than one client to this one... by Anonymous Coward · · Score: 0

    "Good in theory. In practice, you'll run into managers who get all psyched out at the idea of dumping the workload onto the clients, because they have to pay for the servers and if the servers don't have to do the work, they can handle more clients, while you don't have to pay for the clients, the customer does that."

    Well now you know why P2P is so popular. Complete with defenders to the death.

  29. They didnt work so well for Deep Throat by Anonymous Coward · · Score: 0

    "1. Analysts paying lip service to user requirements but actually ramming thier own pet vision down the customers throats."

    Hmmm. Now I see the slashdot obsession with porn. You all are frustrated rammers.

  30. Then you're not my problem by Moraelin · · Score: 1

    Well, then you've just told me that you're not the kind I was ranting against. You know why you use those, you know about code reuse, and it's just a widget library anyway.

    In a perverse way, by what you wrote there, you're the kind of guy who's closer to RL engineering. Much as you seem to be against that comparison.

    The kind I'm ranting about would throw that perfectly functional library away, and rebuild it based on whatever the latest buzzword is (let's call it Snake Oil Droplets (TM)), just because they want that buzzword in the app or on their resume. If they can't figure out an existing problem that Snake Oil Droplets (TM) solves, they'll pervert the rest of the design into creating a case for using that.

    And I'm not talking about people who just use a library. Using existing components is good. I'm talking people who put some hard work into creating a cargo cult framework... and a maintenance problem for their successors in the process.

    I know one team where you could fill a whiteboard just with the _layers_ through which a data object had to go (with factories, decorators and managers at each step) from being read from the database to being actually used. Not just happening to be so because of some third party framework's design. They actually coded each and every line of that bloat. That were some 25 man-years or so, sunk just into coding pure bloat.

    That's not the only way to do bad engineering, of course, but it's one example where pointing people at "best practices" can be just a ticket to have them turned in ingenious ways into "worst practices."

    --
    A polar bear is a cartesian bear after a coordinate transform.
    1. Re:Then you're not my problem by bobetov · · Score: 1

      Fair enough. I've certainly known a few coders like you describe, and it's annoying.

      Anyway, I think the real comparison for good coding practice is that of coders versus lawyers. In both cases, crafting a document is the goal, but the whole thing has to work as an entity. Single words and careful punctuation matter. Reuse is common. Each document is, in a sense, a work of art. Each one is guided by functional needs.

      Building bridges is too easy. Coding (and legal work!) is a way harder problem to solve. :-)

      --
      Looking for a Rails developer in Chapel Hill?
  31. We can agree then by Moraelin · · Score: 1
    Well, then we can agree.

    Holy false dichotomy, Batman! While it's impossible to pin-down 100% of the requirements in advance (the so-called BDUF methodology) that doesn't mean you shouldn't be aiming at 90%, or that 0% is ideal. Let's say we were building an accounts system. It'd be good if we knew in advance whether it had to cover sales, purchases, or both.


    Very much so, and I can only agree there. Note that that's not a dichotomy _I_ made. That's a reason I called that a caricature. But some places did feel a need to institutionalize just that kind of false dichotomy. Because no design is bad, they'll ask for everything to be 100% specified in detail before it even starts.

    If you let the users do detailed technical design you're hosed before you start. I could tell a hundred war stories about this. They rarely if ever have the knowledge or skills - but often think they do. They should be specifying what, not how.


    Amen.
    --
    A polar bear is a cartesian bear after a coordinate transform.
  32. Clients vs. The Right Thing by TheMCP · · Score: 1

    And then there's clients. A lot of web programming gets done either by a consultancy or at least by a programmer who works for someone who isn't a programmer. When you have non-technical people involved too deeply in the process, dumb things happen.

    The article talks about things like how easy the URLs are... I had a client for which my then boss made the mistake of bringing up this topic with them, and they freaked out and spent a week coming up with a new naming scheme that was insanely complex (but they thought it was easy) and made for filenames so long that the version control system couldn't handle them. Then they got really angry with us because we brought the subject up and then "refused" to do what they wanted us to. In many situations such as this, I believe it's in the best interest of all involved for the developer to make a decision about how best to serve the site's audience and go with it, because sometimes gathering the requirements just opens up a huge can of worms unnecessarily.

    The article also talks about developers anal-retentively making page layouts that control everything down to the individual pixel level of precision, and then if the slightest thing changes on the page (such as the logo) the page layout has to be substantially reworked to accommodate it. This is not abnormal. Indeed, every Fortune 500 company whose web site I worked on insisted on this level of precision, understood the consequences, and was prepared to pay for the time it would take to do the work that way. I worked out reliable methods to quickly and easily lay out a page with absolute precision, with certain reasonable constraints. Any developer working in that sort of environment does the same.

    The article complains about building a site to support a specific browser. While I certainly will be among the first to chew out a programmer who builds a site to only work in one browser to the exclusion of others, I believe that it's normal and good to build it to work in a specific *set* of browsers. It's all well and good to say how standards are important and we should all write standards complaint code, except for the minor detail that none of the actual browsers are truly standards complaint as implemented. Oh sure, some are much better than others, but none are really perfect, so if you want to ensure that your site (or application) is going to actually work, the only way to do so is to code it in a way that copes with the known quirks of the various browsers.

    Refactoring is a great thing to do when you need to do it. However, I try to design my software for scalability up front when possible so that I don't have to do a lot of refactoring down the road.

  33. Re: you forgot... by Anonymous Coward · · Score: 0

    -1) Do not talk about web programming.
    0) Do not talk about web programming.

    Ooops. I think I just generated an exception. :(

  34. Forms by cyberchondriac · · Score: 1

    The one thing in web design that pisses me off more than anything else is when a webform is loaded, and the first, topmost, and obvious field doesn't automatically get the focus to type in. So, the hand goes back off the keyboard to the mouse to click in the box, and then typing begins or resumes.
    It's a really stupid thing that affects ergonomics and workflow, but its so easily correctable. I think it's just lazy web development.. even lazier than me for having to move my hand 12 inches to the right and back. ;-)

    --

    Look back up at my post, now look back down, you're on the Internet. Now look back up. I'm a signature.
    1. Re:Forms by Anonymous Coward · · Score: 0

      The one thing in web design that pisses me off more than anything else is when a webform is loaded, and the first, topmost, and obvious field automatically gets the focus to type in... some users like to use their hot keys and hate when the hot keys stop working on a website purely because the stupid site auto-focused into a text field. It's a really stupid thing that affects ergonomics and workflow, but its so easily correctable. I think it's just lazy web development.. even lazier than me for having to move my hand 12 inches to the right and back.

    2. Re:Forms by smellotron · · Score: 1

      The one thing in web design that pisses me off more than anything else is when a webform is loaded, and the first, topmost, and obvious field doesn't automatically get the focus to type in. So, the hand goes back off the keyboard to the mouse to click in the box, and then typing begins or resumes.

      Sorry. I'm partially responsible for that, being a web developer. Here's the issues from the other side of the fence:

      • Focusing on an input rather than the page itself breaks the up/down/pageup/pagedown/space/maybe-scrollwheel functionality of any page that has a scrollbar. As a user, I get frustrated when a large page is displayed with focus defaulting on the first input, since it prevents me from scrolling the page without clicking out of the form. Thus, for some pages, the focus issue is "damned if you do, damned if you don't". Though, for trivial pages like login forms (e.g. Gmail), this is definitely the way to go.
      • Timing issues come into play, since autofocusing an input element requires Javascript. No matter when you specify to perform the focus (on window load, or inline in the page), it's possible that the user has already clicked on some part of the page to give it focus. You may end up inadvertently stealing the focus from a user, which again is frustrating. I always wished there was an HTML focus attribute for labels, so the browser would deal with this issue.
      • It takes a little bit of time to set up the infrastructure required to reliably do this on all of the forms of a web application. If you work for someone who understands the benefits, this probably isn't a problem, but not everyone works for such enlightened managers/clients.

      If the (X)HTML spec provided for something like <body focus="idOfSomeElement">, this would be easy... but it's just one of those things that got overlooked. There's probably some tricks around that by using tabindex, but I try not to mess with that too much, as I hear it can do some nasty things to non-visual browsers.

  35. Ontology Recapitulates Whatever-It-Was by dwye · · Score: 2, Insightful
    > Why not try using traditional computer programming and best practices of software engineering?

    Because every generation has to make the same mistakes as the previous one before learning that just because it is the latest thing, that doesn't mean that you, educated in the latest thing, know what you are doing (until you actually do it for a while).

    And then you learn it, everything works, and it seems a new golden age is upon us.

    And then a new paradigm will come in, claiming that the only thing to do with (old paradigm) programmers is shoot them, just as we suggested doing to all the old COBOL programmers in our days of stupid youth, and in the meantime, lets skip all the cruft of the previous generation (wonder why everything is breaking, though).

    And so on, and so on, and so on.

    1. Re:Ontology Recapitulates Whatever-It-Was by taradfong · · Score: 1

      (music starts playing...)

      Sunrise...sunset. Sunrise...sunset...

      --
      Does it hurt to hear them lying? Was this the only world you had?
  36. Getting down to practicalities.. by cavebison · · Score: 1

    ..is there a web site/blog/forum somewhere which discusses the latest in "best practices" (and variations thereof) all in one place? i.e. discussing good js libraries, UI design, various handy techniques for doing this and that...?

  37. ppk by Keeper+Of+Keys · · Score: 1

    I don't know Jeremy Keith's book, but the ppk book is an excellent exposition of unobtrusive scripting. His philosophy is that js should aid usability - no more, no less. So if you have an enormous form, most of which won't be relevant to to any particular user, you put the whole thing into the HTML - so it's all there for js-off users - then hide most of it in script, revealing only the parts that become relevant as the user makes their way through the form.

    The book is a good balance of theory and practise, pragmatic when necessary (eg he explains the few occasions when browser-sniffing is the best solution), with highly liftable example scripts. Recommended.

  38. Boy, do you need NoScript... by Keeper+Of+Keys · · Score: 1

    http://noscript.net/

    Allows you to turn scripting off (including most flash) on a per-domain basis. Kill the ads, keep the content.

    1. Re:Boy, do you need NoScript... by jc42 · · Score: 1

      Got it. Had it for a couple years, actually.

      Allows you to turn scripting off (including most flash) on a per-domain basis.

      That doesn't do you much good if the ads and the content are both video from the same domain. In my example of the Daily Show, the ads and content are all video from the comedycentral.com domain, and the pages make heavy use of scripts. So you must allow scripts to see the content, and that turns on the ads, too.

      Funny thing about their site is that the usual failure mode has ads running but not the content videos. You'd think if they could make one work, they could make them all work. Dunno how they messed up so badly.

      But most of their good stuff is mirrored on various (mostly political) blogs, so it's not hard to find. And the bloggers usually have the sense to not let their ads get in the way of people seeing their content. In fact, they usually link to ads on ad sites, so you can block them by domain. And few blogs make significant use of scripts, for obvious reasons, so noscript mostly just blocks ads.

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
  39. My web framework by martin_the_geek · · Score: 1

    I am putting together a framework at http://methodsupport.com/program/About.html for generating process/method(ology) support websites.

    The emphasis is on document (paper form equivalent) based processes automated quickly and easily.

    At this stage it is pre-alpha, but I hope to get a minimum feature set in place soon and upgrade it to alpha.

    The source is available from the Sourceforge page.

    At this stage, I need any comments or advice that anybody can give me.

    --
    Regards, Martin IT: http://methodsupport.com Personal: http://thereisnoend.org
  40. Sorry, wrong topic, was: My web framework by martin_the_geek · · Score: 1

    Sorry, I think I posted this to the wrong topic....

    --
    Regards, Martin IT: http://methodsupport.com Personal: http://thereisnoend.org
  41. Why not? by Anonymous Coward · · Score: 0

    Why not indeed? In fact, we do. Where I work at Caplin Systems, my team is working on a streaming ajax trading platform, and we use mock based test driven development using mock4js, a mocking library for javascript written by a member of the team to support our work here, which has been open sourced. We do unit testing with JSUnit, and acceptance testing with Selenium. We do documentation with JSDoc. We use object oriented programming using standardized paradigms weve developed. We have automatic generation of basic UML from the live javascript code using a tool I wrote. We use Ant tasks to build, package and deploy our code. We use version control linked into our issue tracking software.

    And thats just on the technical side, you can be assured that we are also following a best practices of software engineering method in the way we organize and plan our project as well.

    So its hard for me to imagine what youre recommending we do that we dont already. It is difficult sometimes, compared to more traditional languages, such as java, as the tools support is already there. For us, we often have to improve the tools that exist, or write them ourselves, but its also fun being on the edge of something new.

    -- adam

  42. Best Programming Practices For Web Devs is... by Anonymous Coward · · Score: 0

    ...please don't. please? pretty please? with a cherry on top?

  43. ... erm, and AdBlock by Keeper+Of+Keys · · Score: 1

    If you're talking about this site I can see the main video but just an empty column on the right (headed "Payin' The Bills", ha). I enabled www.comedycentral.com in NoScript and not google-analytics.com or doubleclick.net, but I think AdBlock (with Filterset G) is doing its sterling work in the background and keeping the ads at bay.