Teaching Web Application Design is not Easy

Here is a hypothetical situation: I introduce you to a total n00b – some dude who is completely green, and has no programming experience whatsoever. Let’s give this hypothetical construct some generic name – for example Guy. I bring this guy into your office, sit both of you down and say that you have 3 months to make Guy into a kick ass Java programmer. Or Python programmer. Or Ruby. Whatever floats your bout. I’m going to use Java for the sake of consistency but feel free to mentally substitute it with your favorite language of the month. Either way, you have 3 months to take him from absolute zero to a point where he can be given a moderately challenging assignment to work on. He will be working on the back end, writing complex algorithms doing some sort scientific analysis or will end up writing some crazy GUI stuff. Here is the language, here is the deadline, make it happen! This is all you will be doing, and you are free of all your other obligations until this teaching project is done. Could you do it?

Let’s assume that Guy is fairly bright student who has a good grasp of technology in general, and is fairly good at abstracting ideas and thinking in abstract terms which is kinda required here. Other than that, he is a blank slate – he never programmed before but he is eager and excited to start learning. I think this could be done – I think you could take someone like that, and train him effectively in a relatively short amount of time.

Our aim is to teach him Java but we will really be teaching him programming from scratch. He will become a programmer, and once we are done he should be able to pick up another language an learn it on his own. But we have to start with something to teach him concepts so we pick one. Right from the get go we can build a consistent curriculum that will start with the simplest “Hello World” example and slowly build him up teaching him the basic, then advanced concepts. It would be a fairly linear progression in a consistent environment. We teach him a new concept, then augment it, add another one, tie them together and so on.

The only time you actually have to shift gears is when you teach him about databases. You have to briefly take him out of the Java context to teach him SQL syntax, but at this point he should be able to grasp it quickly. You have to take him out of the OO paradigm to teach him the relational model. But that’s about it. As long as Guy doesn’t have to do any front end stuff for the web, it’s all clear and consistent linear progression. It is by no means an easy or trivial task, but it is relatively straightforward. There are few variables to worry about, and you always know where you are and where you need to go. When you finish, Guy will learn all the important concepts, and develop all the programming good habits he ought to have.

Now if I turn around and say, make Guy into a Web Designer capable of creating dynamic Web 2.0 applications the story changes a little bit. It is not an outrageous request to begin with – at least not much worse than the Java programmer one. It is still doable, but I submit that it is much more haphazard and confusing process. Web design is one of those areas that looks deceptively simple from the outside. I mean, how hard can it be? You write a simple back-end, slap together some HTML templates, dump it all on the server and you are ready to go. And it’s true – a lot of web apps are relatively simple to build. But taking someone from zero to a competent Web 2.0 designer dude it is really quite complex because all of the variables involved. For example, where do you start?

You could start with teaching Guy HTML which is easy. Every semester I teach basic HTML to my CMPT-109 students and I can assure you that all of them are from the statistical 60% population sample that will never be good at programming. But they all can manage to write simple websites that usually do not validate but look fine on your screen. I joke around that I teach them the wrong way to use HTML, but it’s kinda true. I usually don’t touch CSS because of the lovely caveat of browser support.

Anyone can write down bunch of HTML tags, but it takes patience and perseverance to learn all the quirky ways in which different browsers render certain things, and work around them. So the whole HTML experience is like a ride on an escalator that terminates in a vertical wall that must be scaled to progress any further.

You also need to teach Guy the client side Javascript which means you need to dive into imperative, functional programming paradigm with some OO thrown in for shits and giggles. You have to make a choice now – do you use Javascript to teach him programming principles? Or do you just make him learn few things by rote, and wait for the server-side language to really give him a solid programming lesson?

If you decide to stick with Javascript for a bit, you will hit another snag. It’s not consistent! Even simple things like walking the DOM often vary from browser to browser. So you are not only dealing with programming concepts but also weird quirks of client side language.

Then you have to make yet another huge leap and teach him server side stuff. We could do Java but we are on a deadline, right? And we still have a long way to go. So let’s pick something that is easier to pick up – a scripting language. PHP is a popular choice – mainly because it is deceptively easy to learn. Unfortunately writing good, maintainable code in PHP is actually a form of art in itself because similarly to Perl, PHP really makes it easy for you to develop really bad coding habits, and really ugly code. But you can probably take Guy from “Hello World” to dynamic HTML generation to DB access very rapidly so it’s good enough for our purposes.

In fact, it is probably better to start with the back-end language, teach him basic programming principles and then put him on a crash course of HTML, CSS and Javascript and XML. It’s probably more digestible this way. Either way though, you end up with a lot of context switching.

You are teaching Guy 6 distinctly different technologies: HTML, CSS, Javascript, XML, the server side language and SQL. They all have different rules, they all have their quirks and at least 3 of them are wildly inconsistent. The modern web application design field is an amalgamation of these very different technologies haphazardly thrown in together. It’s a mess! A good web designer who can envision and implement a working Web 2.0 application must wear many hats so to speak. He has to be a good back end programmer, a good client side programmer, he must have a knack for web design with css, and he has to have at least cursory understanding of databases. But most of all, he must be able to effortlessly switch between these domains of knowledge. When he finds a bug, he needs to be able to locate it – is it in the back end code? Is it in Javascript code? Is it a HTML layout issue? Or perhaps it is a problem with the way you generate Javascript code using PHP? This sort of multi-dimensional thinking is something very hard to teach.

In contrast, a Guy the Java dude who doesn’t work with web apps usually wears a single hat. When he finds a bug, he fires up the debugger in his Eclipse and steps through his code until he figures out what is wrong. It is a much more straightforward process which requires almost no context switching at all.

So can you take Guy from zero to Web 2.0 hero in 3 months? You probably could, only it is going to be messier, grittier and less elegant process. Unless of course you cheat and use a framework like Rails one of it’s many clones.

This is why Rails is just a huge hit these days. It’s because it automates a lot of this petty bullshit that web devs deal with on daily basis, and brings some consistency into the equation. It allows a single developer to whip out a decent, functional application using consistent methodology, without switching context every 5 minutes. 90% of the code he will write will be in Ruby. And while Rails does a lot of stuff behind the scenes, the programmer hardly ever has to deal with it. Nevertheless, Rails like frameworks are still just a crutch – they are code generators. They spit out relevant markup and sql when and where it is needed. The whole environment is still the same haphazard mess, it is just partially hidden from the developer. It is a step forward though.

I was watching some interview with Steve Yegge (if you don’t know who he is, look him up) recently and something he said in there really struck a chord with me. He said that perhaps we just need to come up with a brand new language for the web. Something designed from ground up with Web 2.0 in mind. Not a framework, but a language which would encompass and unify all these distinct domains under a single, consistent syntax and implementation. Something that would let us use that good old linear progression teaching model, instead of trying to force incompatible and often contradicting ideas into poor Guy’s head. You would define a display template, the model and controller logic, and client side processing and validation using the same uniform basic syntax. Then you would slap it on the server, and the relevant HTML, CSS and Javascript would be generated dynamically. Naturally I’m paraphrasing it here, but wouldn’t something like that be nice?

[tags]web design, teaching, teaching programming, teaching web design[/tags]

This entry was posted in programming and tagged . Bookmark the permalink.

7 Responses to Teaching Web Application Design is not Easy

  1. jambarama UNITED STATES Mozilla Firefox Windows Terminalist says:

    I never disagree with people inherently so much smarter than myself, like Steve Yegge. His blog posts from Amazon, as well as his recent ones are clearly insightful and right.

    One thing Paul Graham wrote about somewhere, was the power of a language. Basically his premise is this:
    * anything you can do in C/java, you can do in assembly/fortran
    * assembly takes much longer do develop anything in than C
    * C is clearly more powerful than assembly
    * C is more powerful _because_ it is more efficient
    * A language’s power is based on its efficiency
    If this is unpersuasive, he has lots of good reasoning in there. It is like a 10 page essay, and I couldn’t help but believe him here, although I violate my “don’t disagree with smarter people” sometimes with Graham.

    If this is true, rails is certainly more powerful within its scope, than any of the alternatives I know. Rails, IMHO, is sufficient for the vast majority of projects out there. If you’re going to build digg, ebay, or msn – yeah, rails will have lots of problems (scaling especially). But for a quick and dirty general purpose website, it is unbeatable.

    In some sense a language doing anything for you is a crutch. All that memory management, and buffer overflow protection in java and .NET is essentially a crutch. Just like rails, if you know what you’re doing, you can probably manage your own memory better, but then you’d probably write in C.

    With that said, I like crutches. I don’t want to have to worry about buffer overflows. I don’t want to optimize my code, especially when I can have a bloody compiler do it for me. Does this lead to bad practices, and shallow understanding? Certainly. But if we all had to write a compiler (as Yegge suggested once) and learn assembly before coding, nothing would get done.

    Reply  |  Quote
  2. Luke Maciak UNITED STATES Mozilla Firefox Ubuntu Linux Terminalist says:

    If you follow Yegge logic (which I do) this equation is actually more interesting:

    assembly < C/C++ < java < python/ruby < LISP

    Also, number of users proficient in each of these languages follows bell curve where the line above is the X axis with java and C++ sitting squarely in the middle. :)

    Also, I like the crutches too. They make things easier. :)

    Reply  |  Quote
  3. Starhawk UNITED STATES Mozilla Firefox Ubuntu Linux says:

    Certainly. But if we all had to write a compiler (as Yegge suggested once) and learn assembly before coding, nothing would get done.

    I wrote a simple Basic compiler once in C and thought that was pretty damn hard. Writing compilers is not something I understand at any kind of high level. Assembly lang all programmers my age had to learn it, on chips now obsolete too I might add. It is good for simple stuff and that is about it unless ya some kind of gluten for punishment.

    at least 3 of them are wildly inconsistent

    That reminds me luke have ya read The UNIX-Haters Handbook yet. google it if not that is one of the funniest damn things I’ve read in a while. gotta love inconsistency. lol

    The stuff you and others write about rails makes me feel I’m missing out on something :( maybe in time or if I actually had a need to learn it.

    a language which would encompass and unify all these distinct domains under a single, consistent syntax and implementation…but wouldn’t something like that be nice?

    Yep it would but the problem with a new language is ya gotta convince others to use it, doesn’t matter how good it is if it remains an academic curiosity or a powerful tool for the very few. In a way lisp and a few other lesser known languages fall in that category, not enough people use them. I guess alot of factors determine what makes one language popular and another not but sometime inefficient and horrid languages rule for a long time. I had to learn Cobol in college and Basic too, so believe me I know.

    Reply  |  Quote
  4. Luke Maciak UNITED STATES Mozilla Firefox Windows Terminalist says:

    [quote post=”2293″]Certainly. But if we all had to write a compiler (as Yegge suggested once) and learn assembly before coding, nothing would get done.[/quote]

    Actually writing a compiler exercise should be done in college. I took Systems Software class back when I was doing my MS but compilers were glossed over. We wrote a 2 pass assembler but I was one of the 2-3 people who actually implemented the whole damn thing.

    One day, I will write a fucking compiler. I swear! lol

    [quote post=”2293″]I guess alot of factors determine what makes one language popular and another not but sometime inefficient and horrid languages rule for a long time. [/quote]

    Actually one factor is predominantly important – branding! This is another Yegge thing. He gave a talk on this on OSCON 07.

    Reply  |  Quote
  5. Starhawk UNITED STATES Mozilla Firefox Ubuntu Linux says:

    Actually one factor is predominantly important – branding! This is another Yegge thing. He gave a talk on this on OSCON 07.

    Yep i do agree with that. I forget when i first discovered Steve’s stuff online but i went thru most of it i could find. I think he’s funny as shit and smart as hell.

    And yeah alot of colleges teach compiler stuff these days. When i was in college I was a math major who minored in CS and I don’t think they offered any compiler classes then. And all the languages i learned are now mostly obsolete and for the life of me now looking back I can’t figure out why they didn’t teach either C or unix stuff there. Instead I had to learn IBMS job control language.. take my word for it nothing that ever did me any good. I suppose in some ways pascal still has some life in it and maybe influenced other languages but why no C I don’t know. I learned that latter on my own.

    Reply  |  Quote
  6. Adam Kahtava CANADA Mozilla Firefox Windows says:

    Great post, I’ve been mulling over a similar thought. I see these Guys on the forums everyday; n00bs coming into a framework like Rails or ASP.NET. They typically have high expectations, an invisible teenage like attitude, and surprisingly, they churn out a couple successful projects… Until… They crash into The Law of Leaky Abstractions. They then realize that things are more complex then they had thought, and start really learning the underlying languages and technologies that had previously made their life easier, or give up entirely. The real learning seems to take place when these walls come crashing down. The danger of all these frameworks is having the underlying technologies brushed under the carpet.

    I totally respect Yegge, loved this quote from one of his latest posts:
    “I think we can conclude that people who rely too much on static types … are n00bs.”

    Reply  |  Quote
  7. Luke Maciak UNITED STATES Mozilla Firefox Ubuntu Linux Terminalist says:

    Very true about the leaky abstractions. And with Rails this is especially leaky since if you want your page to look pretty you have to dive into css and etc.


    Reply  |  Quote

Leave a Reply

Your email address will not be published. Required fields are marked *