Quote:Original post by kaktusas2598
So, i wanna ask, what languages it will be useful to learn for creating web sites?
Absolute base requirements for web programming are HTML, CSS, and javascript. These are the languages every web page is written in. HTML describes the layout. CSS describes the styling. When a web page is loaded by your browser, it parses the HTML and CSS and creates an in-memory object called the DOM (Document Object Model). The DOM is a tree structure describing the entire page. When the browser displays your page, it does so by walking over each node in the DOM and rendering it according to its type and properties.
javascript allows you to inspect and modify the DOM after a page has been loaded. A "static" HTML file will have a set number of everything: forms, images, links, table rows. But you can add forms, change image sources, change where a link points to, add or remove table rows, etc. by using javascript. javascript also has access to other important APIs provided by your browser. For example, in javascript you can:<br><br>* Create, read, update, and destroy (CRUD) cookies, which are very small data stores stored in the browser itself (as opposed to in your database). <br><br>* Send asynchronous messages back to the server and receive the reply. This is called AJAX or XMLHttpRequest, but it's a bit poorly named, as there is no requirement to use XML. JSON and other textual data formats work just as well.<br><br>* Render to <canvas> objects (Only in HTML 5)<br><br>These three technologies are collectively the "client side" half of web development. The other half is the "server side". <br><br>The server is responsible for generating and sending the necessary HTML, CSS, and javascript over the Internet. There are many techniques for doing this. Generally speaking, you can use any programming language you want. You can write a site in C++, C#, Python, Ruby, Java. There are a number of standard frameworks for writing web pages, but perhaps the easiest one to understand is CGI.<br><br>CGI is a very simple standard for writing web applications in the early days of the web. The premise is drop-dead simple. A CGI-capable web server (pretty much every web server ever written) receives a request. It takes the request and finds the corresponding CGI program. It executes the CGI program (which might be a C++-generated binary or a Perl script or whatever) and it executes it. Any data the web server wants to share with the program is send through environment variables. The standard output of the CGI program is redirected to the client's socket. So sending HTML to the browser is as simple as 'cout << "<html><body>Hello world!</body></html>";'<br><br>CGI isn't used all that much today for serious applications. The problem with it is that it launches a new system process for every request. Newer frameworks such as FastCGI, mod_php, or Java servlets reuse old processes, which means they will be much faster. Still, for learning, CGI is a good tool to use.<br><br>Developing web applications is hard. The core web technologies were developed over a long period of time by a large number of people who were all in competition for market share. The result is that the technologies tend to suck badly. HTML was written when memory was still measured in kilobytes. CSS has an extremely limited model for positioning HTML elements. It wasn't until 2 years ago Internet explorer finally decided to comply with W3C standards. I can't blame them, though, because W3C's standards are abysmal. New web technologies take a long time to gain acceptance on all browsers. Even now, I don't believe <canvas> is supported on IE, but it's been around for over a year on Firefox. No two browsers display the same web page the same way. <br><br>On top of that, because of the .COM boom and the easy of distributing web-based applications, everyone and their mom has tried their hand at making a website. The result is that the web development industry is swamped with amateurs and people who generally don't know what the fuck they are doing. <br><br>Security. It's a big thing on the web. When you expose your system to the entire Internet, everyone in the world has an opportunity to break your shit. If you're writing for a business, a determined individual abusing a single vulnerability could potentially bankrupt your company. There could be vulnerabilities at every level of your technology stack: in your web server, in your database server, in your encryption layer, in your compiler, in your web framework, in your application, in your client-side design.<br><br>So bottom line: learn the most common vulnerabilities. Know what SQL injection is. What cross-site scripting is. Don't use C++ to write web apps. Keep a full backup of your code and your database in a separate place untouchable by your main server. Salt all passwords you store. Never send passwords by email. Don't use PHP. <br>