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

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


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.


  1. Django wasn't trying to innovate in how web sites are displayed in the browser. Their goal was to simplify the process of building a web site. They could have taken on new ways of creating widgets in the browser as part of that goal, but they didn't. There was plenty of pain to relieve in the classic construction of websites.

  2. If you are building web sites, you will be dealing with HTML. Your analogy to assembler is interesting, but in that analogy, no popular higher-level languages have emerged. This is likely because every higher-level language would of necessity impose some constraints on what could be expressed, and the web is not at the point of wanting conformity like that.

  3. Python is an easier-to-use language than C++, and you really can develop faster in it. You should try it. Automatic memory management is one reason, but others are easy-to-use data structures, not having to ask permission from the compiler to do what you want, extensive third-party libraries to build on, and a clutter-free language in which to express yourself. About the speed: web sites are not compute-bound, they are I/O-bound, so the speed of the language rarely makes a difference.

  4. About the ad-hoc nature of web development. You're coming from a Windows development background, where one vendor defined the entire environment, and did a good job of it. Web development is ad-hoc because the web itself is ad-hoc. No one group defined it, it's grown organically with contributions from many.


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

Correct. Good assessment. Is that a problem?

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

False. Indeed, not even close. All browsers uses HTML. That cannot be changed easily.

chess.com... Is it most likely Java applets they're using for a site like that?

Use view source in your browser to answer this question for yourself. In general, you should do this for every web site you visit. You'll learn a great deal about the web and web development.

Would Django be used in conjunction with something like Flash or even Java applets

Yes. We use FLEX and Django.

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.)

Yes.

Are there in fact complete websites written solely in Java, perhaps using very high level Java API's?

Yes.

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.

Some people like to despise Java. There's little technical merit to their argument.

After you've used Java and Python, you'll find that Python's less wordy. You get more done with less typing.

what is the justification for their [Python PHP] existence?

They're better than the alternatives. For specific things people need to do, Python (or PHP) are better than the alternatives. For "everything" or even a broad class of things, it may not be perfectly clear.

We do a lot of ad-hoc data crunching. Python's flexibility is absolutely superior to the alternatives.

First of all, Python is much, much slower than say C++, being interpreted.

That's hardly relevant, it turns out. Web sites are not governed by raw speed of one element of the architecture.

Why are websites written in Python or PHP

It's easier than the alternatives.

is platform independence the sole issue here.

No.

I am incredulous that application development is much faster in Python than C++

Have you done much with Python? You should give it a try for a year or so. It makes C++ quite tedious and error-prone by comparison.

is that what the primary reason for Python is - garbage collection.

No.