Web Programming

Started by
14 comments, last by pulpfist 14 years ago
Quote:Original post by zyrolasting
Web development, at it's bare minimum, is XHTML.

You mean HTML? Using the XHTML flavor is no requirement (and practically, not a big technical advantage either).

Quote:Grab a WYSIWYG editor like Dreamweaver if you can.

Have to disagree here. WYSIWYG editors aren't much helpful in learning the underlying languages, IMO.
Advertisement
Quote:Original post by Konfusius
Quote:Grab a WYSIWYG editor like Dreamweaver if you can.

Have to disagree here. WYSIWYG editors aren't much helpful in learning the underlying languages, IMO.


Use an editor to create your site, but before doing that, the only way you have to learn how things are under the hood is (as usual) by doing it by hand.

Basicly you have HTML. An HTML page is the only thing really required:

Here the most basic web page you can have:
<html><body>Hello World!</body></html>


Css are the new way to define the visual attributes (images, colors, fonts, position of the elements,...). Those descriptions are kept in a separate file that you can switch in order to change the layout of the page without changing the content.

&#106avascript is a programming language that is executed by the client to make your page more dynamic.<br><br>Until now all the pages have been created statically and stored in a file. But you can build your html pages dynamically using programs executed by the web server: those programs output an html file that is then transfered to the browser.<br><br>There are many such languages, a few are asp.net, php, java, python, perl.<br><br>Sometimes that program is kept in a separate file (a *.java for Servlet, or a *.cs), or they can be embedded in a kind of html file (*.php, *.asp, *.jsp). In that case the server runs the scripts and replaces them with their output, so that an html page is returned.<br><br>Hope that helps
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 &#106avascript. 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.

&#106avascript 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 &#106avascript. &#106avascript also has access to other important APIs provided by your browser. For example, in &#106avascript 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 &lt;canvas&gt; 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 &#106avascript 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 &#111;ne 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 &lt;&lt; "&lt;html&gt;&lt;body&gt;Hello world!&lt;/body&gt;&lt;/html&gt;";'<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 &#111;n all browsers. Even now, I don't believe &lt;canvas&gt; is supported &#111;n IE, but it's been around for over a year &#111;n 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 &#111;n 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>
Quote:Original post by kaktusas2598
It will be easy to learn these languages if i got experience with C/C++/C#?

Yes.
IMO web programming is a no brainer compared to C++.
I found the hardest part to be finding a decent IDE since most web languages aren't as strongly typed are quite annoying to debug.

[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
Quote:Original post by Tac-Tics
Don't use PHP.


That makes no sense. If you want to imply that PHP is inherently insecure, you're wrong.
Quote:Original post by kaktusas2598
I can combine many languages?
and what about PHP?


Technically you probably could combine several languages on both server and client side, but what you probably want to do is to choose one server side language and one client side language.

What I call a server side language is a language (code) that runs on the web server before a page is wired over to the client. It is typically used to fill database query results into the page before it is sent.
A client side language runs on the client (inside the web browser) after the page has been sent. Basically, you add client side code to your page, and after the page has been sent and loaded by a browser this code gets executed.

PHP and C# would be server side languages. &#106avascript and VBscript would be client side.<br><br>Since you already have experience with C# I guess ASP.NET/C# would be a good choice.<br><br>About syntactic similarities between languages, PHP is often compared to C, while C# has more in common with Java.<br><br>Web development is a no brainer compared to console programming in languages like C++, LISP and MASM. As someone said the major pain in web development compared to console is the fact that the connection between the client and server is <a href="http://en.wikipedia.org/wiki/Stateless_server">stateless</a><br>However, the viewstate introduced by ASP.NET makes this considerably less painful.<br><br><!--QUOTE--><BLOCKQUOTE><span class="smallfont">Quote:</span><table border=0 cellpadding=4 cellspacing=0 width="95%"><tr><td class=quote><!--/QUOTE--><!--STARTQUOTE--><br>It will be easy to learn these languages if i got experience with C/C++/C#?<br><!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br>Learning a language like C/C++/C# will make it easier to learn new languages in general. Infact, C# is already a powerful server side language useful for web development.

This topic is closed to new replies.

Advertisement