Big picture questions regarding Django, Java, Python, HTML and web-site development in general [closed]

I am trying to get a handle on the state of the art regarding web site development and have several questions. Maybe I’ll end up finding most of the answers on my own. I come from a background of C++ and Windows development, and generally I am befuddled by what seems to be the ad-hoc nature of web development.

I focussed in on Django, after online research of it and Ruby (on Rails). From what I read, ROR tries to do everything for you behind the scenes and so therefore is slow and unscalable (and overhyped and not ready for prime time). So I have gotten into Django – downloaded Python and Django, the source from a complete Django site, got it running, and so forth.

And the first thing that surprises me about Django, is that there does not seem to be any innovation to speak of regarding actual presentation. All the innovation would concern database issues, business logic, reusability of code, etc – but not actually anything new regarding innovative visual controls or graphics for a web-site. When you build a Django view or template, it will still be making extensive reference to html from what I can see (And presumably also Javascript – but I haven’t actually even seen any Javascript in Django templates yet.)

And I would have thought previously that html might be analagous to assembler, so a conventional application developer from years past might know and occasionally even use a little assembler, but generally would hardly ever use it, whereas from what I can see, html (and also CSS and javascript) still have to be mastered and written continually by every web developer, whether they’re using Django or anything else. Is that a true statement?

There is one site in particular that would to me as an end user represent the state of the art for web sites and I would be curious as to what the foundations of such a site might be. That site is chess.com, and there are all sorts of facilities for playing chess online with other users, user customization of their account with various graphical effects and so on. Is it most likely Java applets they’re using for a site like that? How relevant would Django be for a such a site. Would Django be used in conjunction with something like Flash or even Java applets? Also when a site like chess.com is ported to a mobile device, what is used to write it – the same development tools as for the desktop or something completely different (Yes, I have a lot of catching up to do.)

Are there in fact complete websites written solely in Java, perhaps using very high level Java API’s? Why would someone say (as I read somewhere) that they despised Java so that is why they had gotten into Ruby on Rails and Django.

And regarding Python (and also PHP) what is the justification for their existence? First of all, Python is much, much slower than say C++, being interpreted. Why are websites written in Python or PHP – is platform independence the sole issue here. I am incredulous that application development is much faster in Python than C++ (aside from the garbage collection issue – is that what the primary reason for Python is – garbage collection.)

So anyway, a bunch of newbie questions – will probably end up answering most of them myself if they’re not answered here. Maybe they’re relevant to someone else though.

Answer

Hmm, you’ve asked a laundry list of questions here. I’ll pick a couple of the important ones and answer.

As for the rationale for languages like Python… the truth is that many web applications are either I/O bound or database bound. When that’s the case it doesn’t matter much if the language you’re using is not as fast as C++- the bottleneck is elsewhere. Beyond that an awful lot of the core Python routines and data structures are written in C. Python is used to drive the highest level of logic, but most of the work happens in fast native code. It might surprise you to learn that in my current job I write 3D animation software in Python. Of course a lot of what is going on behind the scenes was written in C++. There’s a name for this: “Alternate Hard and Soft Layers.” The reason we use Python is pretty simple- our choices are Python or C++ because of the APIs we write to, and we’re several times as productive in Python. I would actually ask what the rationale for the existence of C++ is, but that’s another subject (and flamebait ;).)

As for the visual presentation issues… traditionally there has been a pretty distinct separation between the server-side logic of an application and the in-browser logic, partially because the only language you can count on being in the browser is Javascript (and even then you can’t actually count on it being on, leaving aside the existence of browsers like Lynx.) So you wrote your server logic in some sort of framework like Django, and then you used some Javascript framework to do your front-end stuff, and (in the last few years) you used something like AJAX to let them interoperate a bit more smoothly.

This is still pretty much the dominant paradigm, but things have started to change. A lot of server-side frameworks have started including facilities for generating Javascript in one way or another. And people have started writing compilers that translate from other languages to Javascript. One prominent example is Google’s GWT, which translates from Java to Javascript: http://code.google.com/webtoolkit/ There are other examples of this sort of approach though. I did a lot of programming in a common lisp library called parenscript ( http://common-lisp.net/project/parenscript/) a few years ago, and there is the beginning of a Clojure ( http://clojure.org/) library for doing something similar. Also, one of the most interesting set of frameworks around is Seaside/Magritte ( http://www.seaside.st/ and http://www.lukas-renggli.ch/smalltalk/magritte) which use continuations to manage the state of widgets. There are similar frameworks for scheme and common lisp.

As for html being like assembler, I’m inclined to agree in cases where I am writing the html. I tend to use some sort of abstraction layer to generate html in those cases. But an awful lot of the html in the world is made by designers. Some of them use GUI applications to generate html, and the better ones use text editors. But most of them don’t want to deal with anything more complicated than simple templating in html, which is what they know.

One thing you have to understand about the evolution of the web is that http and html were not initially designed to do the kinds of things they are being used for today. And on top of that the major browsers have very often been really broken. And on top of that you have no control over what facilities the user has available to them- they could be using any browser, with or without Java, Javascript, Flash, etc, and with any of a number of permutations of bugsets, depending on the browser. So it’s only in the last several years that things have stabilized enough for people to be a little less conservative about the facilities they use on the client side. It’s still a good idea to make sure that pages degrade gracefully, when possible. A general purpose web page should be usable in a text browser, though of course many types of web applications can’t be made to work in that limited an environment.

HTML 5 is going to shake a lot of this up. But it is going to be a long time before it is safe to assume that everyone is using a browser capable of doing anything from HTML 5, and longer before it is safe to assume that everyone is using a browser that implements all of HTML 5. Anyway, I’d suggest you look around at some of the less visible projects, like Seaside for instance. There is a lot of experimentation going on. But the web has always been a tough environment for this kind of thing.

Leave a Reply

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