At the time of interview, many of you faced this question, “What is Good Code”?
The answer for this question will differ from person to person. I can define Good Code as follows;
- Are source files organized in a clean manner and Looking at the code, can I find code with out too much difficulty?
- The code is well documented?
- Is there a clear pattern to where variables are declared? Does the code have a logical flow to it and avoid unnecessary control structures?
- Is all the functions, queries have comments for them explaining what they do in the code?
Al these above points are from my point of view. Others can have different opinions about this.
Kindly reply, if you have different view at this
Nowadays we all using websites, web applications for our work. But do you know how this websites are working on internet. Here you can find the steps how the web world works:
- You type an URL into address bar in your preferred browser.
- The browser parses the URL to find the protocol, host, port, and path.
- It forms a HTTP request.
- To reach the host, it first needs to translate the human readable host into an IP number, and it does this by doing a DNS lookup on the host
- Then a socket needs to be opened from the user’s computer to that IP number, on the port specified (most often port 80)
- When a connection is open, the HTTP request is sent to the host
- The host forwards the request to the server software configured to listen on the specified port
- The server inspects the request , and launches the server plugin needed to handle the request.
- The plugin gets access to the full request, and starts to prepare a HTTP response.
- To construct the response a database is accessed. A database search is made, based on parameters in the path (or data) of the request
- Data from the database, together with other information the plugin decides to add, is combined into a long string of text (most probably HTML).
- The plugin combines that data with some meta data in the form of , and sends the HTTP response back to the browser.
- The browser receives the response, and parses the HTML in the response.
- A DOM tree is built out of the broken HTML.
- New requests are made to the server for each new resource that is found in the HTML source. Go back to step 3 and repeat for each resource.
- Stylesheets are parsed, and the rendering information in each gets attached to the matching node in the DOM tree
- The browser renders the page on the screen according to the DOM tree and the style information for each node.
- Aftre all above steps, you will see the web page on your screen.
Once a web page loads, your browser generates something called a DOM, or Document Object Model, of the page. The DOM acts as as programming interface for HTML, which defines HTML properties, events, and methods. It also refers to HTML elements as objects.
The Document Object Model is a platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure and style of documents.
The document can be further processed and the results of that processing can be incorporated back into the presented page.
This is an overview of DOM-related materials here at W3C and around the web.