What are the benefits of using the style sheet in a large company or educational institution?
I “grew up” teaching HTML to myself, and coding HTML pages manually. I didn’t know much of structure and presentation layer, and I happily mixed HTML and presentation elements together to create a big messy code stew. I remember when I first saw the CSS function in Dreamweaver and I thought that it was stupid - why would I define the look of a page element somewhere else instead of right with the very element? Well, I learned why when I decided to change the look of my website and I had to change every single element of presentation manually. CSS at first glance was terribly confusing and I didn’t feel I really _need_ it. Over the years I thought it would be nice to know CSS and I especially liked the possibilities of positioning elements with precision. Having to use tables to arrange items on a webpage always seemed awkward to me. But it would also mean having to forget everything I knew about HTML and start over. When I started at Davenport, the first class I took was CISP110 (Web Page Development) and when I looked at the book I was happy as a clam that I would finally learn CSS. Now, enough of the babble, why don’t I just answer the question?
A CSS (or Cascading Style Sheet) is a file that holds the presentational layer of a web page and thereby separates formatting from content. In a large company - and an educational institution is usually just that - it is extremely important to use CSS. It helps to keep a unified corporate image across all parts of the web page.
Often, different people work on different parts of the web site, someone may be in charge of the customer service pages while someone else takes care of the product index - the equivalent in an educational institution would be the different departments for example the Computer Science department vs. Marketing Department etc. Instead of formatting web pages manually, the formatting would be set by a CSS while the code only defined elements or regions. If you think of a web site and its different sections, they all have a similar feel to it. Most have the same page head and page footer, similar side bars and the overall fonts and color schemes are the same throughout.
Now, consider that a company changes their corporate color scheme. While I am usually a strong believer in the power of color, there are several reasons to change your corporate color scheme. One of them, I experienced with the company I work for. We used to have orange and light grey as our corporate colors, so our links were orange, backgrounds and headers were grey etc. Some years ago, we bought another company and we decided to show off the merger in combining our two business colors. Their color was dark blue, so we decided to change our corporate color from orange and grey to orange and blue. If our web site had not separated content from presentation, someone would have to go through every single page and change the color value from color=”grey” to color=”blue” - and that on thousands of pages on fonts, backgrounds, borders etc. Using a style sheet, the whole thing would take minutes and only a single file would need to be edited in a few places. Not only is this an incredible time saver, it is also a lot less likely to cause errors and ommissions. Now, of course it isn’t THAT easy, but I think it drives home the point well. Of course, we decided a little later that orange and blue really didn’t look that great and we went back to orange and grey
There are a lot of great examples on the web to display the power of stylesheets, the most famous is probably the Zen Garden (http://www.csszengarden.com/) which can have a totally new look just by switching to a different CSS file.
How is HTML different than XHTML? Which one you would prefer to use in new Web projects and why?
XHTML (eXtensible HyperText Markup Language) is an extension of the HTML language. Regular HTML is based on SGML - which is a very complex and difficult to follow syntax. With XHTML, the W3C switched to a different code base, the much simpler XML syntax. HTML was always very open and most browsers were able to acceptably render non-standard code. Unfortunately, this led to a lot of browser-specific code that caused major incompatibilities with the different browser engines.
XHTML has much stricter specifications. XHTML code must be well formed, for example in XHTML code is always lower case, all tags must be closed or contain a closing slash, attributes must have a value etc. The validity of XHTML can be tested with the Validator of the W3C (select XHTML as the document type)
For newer projects, I would always use XHTML. Most older browser are able to render XHTML correctly. I don’t think older, outdated standards should be used unless it is necessary for legacy systems.
What do we mean by postback? What is it good for?
In ASP, the predecessor of our ASP.NET version, transmitting and processing data was a lot more cumbersome. If a user entered data, the data had to be passed with POST or GET through one or more interim pages for validation and processing before it could be used. Of course, everytime the data is “touched”, errors can be introduced (think of the children’s game “Telephone”).
In ASP.NET, this has become much easier. Instead of running the controls on the client side, they are run right on the server. The server then posts the data back to itself for validation and processing - and that’s where the name comes from.
The postback function is a function that is automatically generated and included on our HTML page by the ASP.NET engine. In order for this to work correctly, the of the web page needs to include a server-side form that specifies the action to “runat” the “server”.
How do you compare client-side and server-side programming? Discuss their advantages and disadvantages.
In general, client-side means that the code is executed on the client computer while server-side means that the code is executed on the web server. A client-side program uses functions of the browser and possibly the operating system (which may pose security issues) while server-side programs use the functionality of the web server they are running on.
Client-side scripts are often part of or referenced by an HTML page. The user’s browser is responsible for processing and executing the code while or after loading the web page on the client computer. The most commonly used client-side script language is JavaScript, which is a rather simple programming language that is easy to incorporate into HTML code.
In server-side scripting, the browser requests a page from the web server, and the server creates the page content “on demand”. Most times, the client does not see or receive the actual program code but just a web page that looks like plain HTML. BlackBoard is a good example. The currently open page is a Java Server Page (EDIT: since this is on Wordpress here, it is of course a PHP page) and it has been dynamically created when you clicked on this topic. The content you see is depending on who views it and when it is viewed. The next time you click on it, it will be different. It may just not be marked as a “new post” anymore, someone else may have replied or I may have edited my post.
Both have their advantages and disadvantages. Client-side scripts are good if a programmer does not have full access to the web server. I remember a long time back I had some free web space (Xoom or so) and I was trying to create an email form. I didn’t have full access but was only allowed to use some scripts that were included - what a pain. The successful implementation of client-side scripts also depends a lot on the browser. Even though most browsers display plain old HTML pages in a similar way, there can be a huge difference in the way code is executed. In addition, we have the different operating systems, the OS settings and the browser and there are a lot of possible combinations that may cause unexpected results.
Server-side scripting is independent of the browser and OS (though slight changes in layout can always happen), and it is easier to predict what the user will see. It does require more from the web server though. Not only do you need certain programs and functions on the server, you also have to consider the server load. If you have a lot of simultaneous users accessing a server-side script, the server has to be able to process all those requests. Server-side scripting is also more secure, since the program code is not transmitted to the user but only the result.
CAN YOU SEE THIS?
Sorry for all this, but this is the real test. If you got this post in your feed, can you please post a comment?
I have selected the category and this should neither be on the main page nor in a feed.