Big picture questions regarding Django, Java, Python, HTML and website development in general

I am trying to understand the essence of website development and ask some questions. Perhaps I will eventually find most of the answers myself. I come from the area of ​​development in C ++ and Windows, and as a rule, what puzzles me is what seems to be the specific nature of web development.

I focused on Django, after researching this online and Ruby (on Rails) online. From what I read, ROR is trying to do everything behind the scenes for you, and therefore it is slow and immodest (and ultra-high and not ready for prime time). So, I got into Django - downloaded Python and Django, the source from the full Django site, launched it, etc.

And the first thing that surprises me in Django is that there seems to be no innovation talking about the actual presentation. All the innovations were related to database problems, business logic, code reuse, etc., but in reality there is nothing new in regard to innovative visual controls or graphics for a website. When you create a view or Django template, it will still make an extensive html link from what I can see (and presumably also Javascript), but in fact I have not even seen any Javascript in Django templates.)

And I would think that html might be similar to assembler, so a regular application developer from past years might know and sometimes even use a small assembler, but usually it’s hardly ever used it, whereas from what I see, html ( as well as CSS and javascript) still need to be constantly mastered and written by every web developer, regardless of whether they use Django or something else. Is this a true statement?

In particular, there is one site that would be for me, since the end user represents the current state of the websites, and I would be interested to know what the basics of such a site can be. This site is chess.com, and there are all the possibilities for playing chess online with other users, customizing their account with various graphic effects and so on. Are these the most likely Java applets that they use for such a site? How relevant would Django be for such a site. Will Django be used in conjunction with something like Flash or even Java applets? In addition, when a site like chess.com is transferred to a mobile device, what they write is the same development tools as for the desktop, or something completely different (yes, I’m catching up a lot.)

Are there really complete websites written exclusively in Java, possibly using the highest level Java APIs? Why did someone say (as I read somewhere) that they despise Java, so they ended up in Ruby on Rails and Django.

And as for Python (as well as PHP), what is the justification for their existence? First of all, Python is much, much slower than C ++ being interpreted. Why websites written in Python or PHP are platform independent, the only problem here. I am incredulous that application development is much faster in Python than C ++ (except for the problem with garbage collection - this is the main reason for Python - garbage collection).

One way or another, a bunch of newbie questions will probably ultimately answer most of them if they don’t answer them. Perhaps they relate to someone else.

+6
java python html django mobile
source share
8 answers

Hmm, you asked a list of questions here. I will pick up a couple of important ones and answer.

As for the rationale for languages ​​like Python ... the truth is that many web applications are either associated with I / O bindings or with database bindings. In this case, it doesn't really matter if the language you use is not as fast as C ++ is a bottleneck elsewhere. In addition, a large part of the basic Python routines and data structures are written in C. Python is used to control the highest level of logic, but most of the work is done in fast native code. It may surprise you to learn that in my current job I am writing 3D animation software in Python. Of course, a lot of what goes on behind the scenes has been written in C ++. There is a name for this: "Alternative hard and soft layers." The reason we use Python is pretty simple - our options are Python or C ++ because of the APIs we write, and we are several times efficient in Python. I would really ask what is the rationale for the existence of C ++, but this is a different subject (and flame);)

Regarding visual presentation problems ... there has traditionally been a fairly clear separation between the server-side logic of the application and the logic in the browser, partly because the only language you can expect to be in the browser is Javascript (and even then you are on you really can't count on it being turned on, leaving aside the existence of browsers like Lynx.) So, you wrote your server logic in some kind of structure like Django, and then you used some JavaScript environment to execute your (in the last few years) you used something like AJAX to allow them to interact more smoothly.

This is still a pretty dominant paradigm, but things are starting to change. Many server platforms have begun to include tools for generating Javascript anyway. And people began to write compilers that translate from other languages ​​into Javascript. One striking example is Google GWT, which translates from Java to Javascript: http://code.google.com/webtoolkit/ However, there are other examples of this approach. A few years ago I programmed a lot in a common lisp library called parenscript ( http://common-lisp.net/project/parenscript/ ), and there is the beginning of a Clojure ( http://clojure.org/ ) library for doing something something like that. In addition, one of the most interesting sets of frameworks is Seaside / Magritte ( http://www.seaside.st/ and http://www.lukas-renggli.ch/smalltalk/magritte ), which use extensions to control the state of widgets. There are similar schemes for schema and generic lisp.

Regarding html as a collector, I tend to agree in cases where I write html. I try to use some kind of abstraction layer to generate html in these cases. But terribly many html in the world are made by designers. Some of them use GUI applications to generate html, and the best use text editors. But most of them do not want to deal with something more complicated than simple html templates, and this is what they know.

One thing you need to understand about the evolution of the Internet is that http and html were not originally designed to do what they use today. And besides, the main browsers are very often very badly broken. In addition, you cannot control what tools the user has: they can use any browser with or without Java, Javascript, Flash, etc., And with any number of error permutations, depending on the browser. So only in the last few years did the situation stabilize so much that people were a little less conservative about the objects that they use on the client side. It’s still good to make sure that the pages are degrading competently, if possible. A general purpose web page should be used in a text browser, although, of course, many types of web applications cannot work in this limited environment.

HTML 5 is going to shake a lot. But it took a long time before one could assume that everyone uses a browser capable of doing anything from HTML 5, and longer than one can assume that everyone uses a browser that implements all of HTML 5. Anyway, I would suggest you look at some of the less visible projects, for example, on the coast. Many experiments are being conducted. But the network has always been a difficult environment for these kinds of things.

+12
source share
  • Django has not tried to innovate in how websites are displayed in a browser. Their goal was to simplify the process of creating a website. They could use new ways to create widgets in the browser as part of this goal, but they did not. There was a lot of pain to facilitate the classic construction of sites.

  • If you build websites, you will deal with HTML. Your assembler analogy is interesting, but there are no popular higher-level languages ​​in this analogy. This is probably because each higher-level language, of necessity, must impose certain restrictions on what can be expressed, and the web is not in a state of desire to meet such requirements.

  • Python is an easy-to-use language than C ++, and you can really develop faster in it. You should try this. Automatic memory management is one of the reasons, but others are easy-to-use data structures that do not require the compiler permission to do what you need, extensive third-party libraries to create, and a messy language to express yourself in. About speed: websites are not related to computing, they are related to I / O, so language speed rarely makes a difference.

  • About the special nature of web development. You come from the background of Windows development, where one vendor defined the whole environment and did a good job of this. Web development is ad-hoc because the network itself is ad-hoc. Not a single group identified it; it organically grew with the help of many.

+10
source share

All the innovations were related to database problems, business logic, code reuse, etc., but actually nothing new regarding innovative visual controls or website graphics

Correctly. Good mark. This is problem?

html can be similar to assembler, so a regular application developer from past years might know and sometimes even use small assembler, but usually hardly ever used it

False Indeed, even close. All browsers use HTML. It is easy to change.

chess.com ... Are these the most likely Java applets that they use for such a site?

Use view source in your browser to answer this question yourself. In general, you should do this for every website you visit. You will learn a lot about web and web development.

Will 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 transferred to a mobile device, what is used to record it is the same development tools as for the desktop, or something completely different (yes, I’m catching up a lot.)

Yes.

Are there really complete websites written exclusively in Java, possibly using a high level Java API?

Yes.

Why would someone say (as I read somewhere) that they despised Java, so they ended up in Ruby on Rails and Django.

Some people like to despise Java. Their arguments have few technical advantages.

After using Java and Python, you will find that Python is less verbose. You do more with less typing.

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

They are better than alternatives. For the specific things people should do, Python (or PHP) is better than alternatives. For "all" or even a wide class of things this may not be entirely clear.

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

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

Which is hardly relevant, it turns out. Websites are not governed by the raw speed of a single architecture element.

Why are websites written in Python or PHP?

It is easier than alternatives.

- This is platform independence, the only problem here.

Not.

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

Have you done a lot with Python? You should try for a year or so. This makes C ++ rather tedious and error prone by comparison.

is because the main reason for Python is garbage collection.

Not.

+7
source share

And I would have thought earlier that html could be similar to assembler, so a regular application developer from past years could know and sometimes even use a small assembler, but usually it’s hardly ever used it, whereas from what I see, html (as well as CSS and javascript) still need to be constantly mastered and written by every web developer, whether they use Django or anything else. Is this a true statement?

Yup - if you need a website, someone will have to write HTML code.

HTML differs from assembler in that you cannot write parsers for new languages ​​in HTML. HTML is just a declarative language for adding value to text. Thus, the main thing is that everyone in the world agrees on how to do this and what tags mean. Ultimately, this can replace something new, but HTML has so far proven to be effective and resilient. It is also quite easy to learn and free.

Most likely, these are Java applets that they use for such a site? How relevant would Django be for such a site. Will Django be used in conjunction with something like Flash or even Java applets?

Django really just refers to the server side of websites. It leaves the client side of things (that is, everything that works in the browser) to you. (In addition to the built-in admin site.)

Are there really complete websites written exclusively in Java, possibly using a high level Java API?

I do not consider it common. Java applets are hardly used, and some people ( cough Steve Jobs cough regret coughing there, I said “Steve Jobs”) think Flash will go the same way.

+2
source share

In addition to everything everyone else said, just building a very simple website with HTML, some CSS and maybe even some JavaScript will probably give you a decent idea of ​​how these three work. A place suitable for HTMLDog is a good place to start.

Also, read the HTTP protocol for a bit, as this is still what regular web pages use, and therefore defines the basics of how servers and clients communicate on the Internet.

HTTP, HTML, CSS, and JavaScript (and probably will take quite a while), the same if you use Java, Django, ASP.NET or PHP for your application logic. If you are more into web development, this is important no matter what server technology you have ever chosen. It is also good to have a general understanding of browsers. Both that and another, how they process visual rendering of HTML and CSS, but also how sessions, cookies and requests are processed.

+1
source share

The javascript stuff may seem complicated, but there are currently pretty decent libraries that are Free / OSS, especially jquery . I believe jquery partially replaces Flash.

You do not need so much extra javascript to use it productively. I would definitely use jquery if I had to use an interface, such as using chess.com.

see www.jquery.com and www.jqueryui.com

+1
source share

From what I'm reading, ROR is trying to do everything behind the scenes for you and therefore is slow and immodest (and ultra-high and not ready for prime time).

Well, first of all, you should not believe everything you read on the Internet:

  • I would not say that RoR is not ready for prime time. RoR, like any tool, uses it. If you are building a site, such as Twitter, Rails is not the best tool (as Twitter found out). Although everyone thinks they are building a high-performance site, most developers do not, and Rails is likely to be suitable. In addition, Rails can scale, and much work has been done to improve this situation even further.
  • The reason Rails sometimes has performance issues is not because it tries to do everything for you - it's more because of the nature of the Ruby interpreter itself, which (while Ruby 1.9) was pretty slow, and still not so same as other interpreted languages.

And the first thing that surprises me in Django is that there seems to be no innovation talking about the actual presentation. All the innovations were related to database problems, business logic, code reuse, etc., but in reality there is nothing new in regard to innovative visual controls or graphics for a website.

Yes, but this is an innovation. Prior to frameworks such as Django and Rails, many of these backends were manual. Django frees up developer time to work on additional application-level features.

And I would have thought earlier that html could be similar to assembler, so a regular application developer from past years could know and sometimes even use a small assembler, but usually it’s hardly ever used it, whereas from what I see, html (as well as CSS and javascript) still need to be constantly mastered and written by every web developer, whether they use Django or anything else. Is this a true statement?

Yes, to a large extent. Nothing better than HTML, CSS and JS. Although I agree that, in a way, HTML seems to be "low level" in the same sense that assembly language is low level, I think most would agree that it’s much more pleasant to work with the problem area of ​​HTML.

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

You can. Flash and Java are simply embedded in HTML pages, and Django spits out HTML, so that’s possible.

Are there really complete websites written exclusively in Java, possibly using the highest level Java APIs? Why did someone say (as I read somewhere) that they despise Java, so they ended up in Ruby on Rails and Django.

In addition to applets, you can write a backend in Java (for example, Java server pages). I think most web developers who have worked with both will agree that Ruby and Python are much nicer than Java. Java web frameworks are a pain, Java lacks REPL, Java has a separate compilation step ... Java is also statically typed; you can argue all day about the benefits of dynamic typing and static typing, but Rails and Django take advantage of the input and introspection of Ruby and Python to make a lot of code less verbose than Java. (Regardless of whether Ruby and Python do better than Java subjective.)

And as for Python (as well as PHP), what is the justification for their existence? First of all, Python is much, much slower than C ++ being interpreted. Why websites written in Python or PHP are platform independent, the only problem here. I am incredulous that application development is much faster in Python than C ++ (except for the problem with garbage collection - this is the main reason for Python - garbage collection).

Performance is not everything. Almost everyone wants to think that their code is performance critical, but often it is not. As noted in several other answers, most web applications are connected with I / O binding in any case - they either wait for access to the database or wait on the network, and both of these types of operations are several orders of magnitude slower than the task processor, even with slow (er) interpreted languages. In addition, there is a lot of processing in strings in web applications, and string processing is much better in Python or Ruby than, for example, in C or C ++. Python and Ruby are also more concise languages, and both offer REPLs that can shorten development time. It's also easy to write C extension modules in both Python and Ruby, so if you really find the code path that causes the optimization, you can always go down to C if you want.

Garbage collection is a plus.

+1
source share

And I would have thought earlier that html could be similar to assembler, so a regular application developer from past years might know and sometimes even use a small assembler, but usually it’s hardly ever used it, whereas from what I see, html (as well as CSS and javascript) still need to be constantly mastered and written by every web developer, whether they use Django or anything else. Is this a true statement?

That is why I use Primorye. You still need to understand html and css and javascript, but at least there is an abstraction of the programming language over html. I will never return to a template-based system.

+1
source share

All Articles