web dev – browser compatibility

18 09 2010

Recently restart some development on web page. Encounter some browser compatibility issue between IE and the others (sad we still need to support the IE 6)

After several attempts, finally find out it missing following line.

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>

below is very good explanation:


<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
is what’s know as a “document type declaration (or definition)” (DTD). In essence it identifies to the browser the type of code that is being used in the document. When declaring a doctype, it is then your responsibility as a designer to code the page to the specifications you have “declared” you are using in the doctype. In your example, you are declaring to the browser that you will be writing your code to HTML 4.01 transitional specifications and that is what it is expecting. If you falter from those “expectations” then your code may become considerd as “invalid” and may not display correctly in some browsers.

This is where things start to get a little confusing. The transitional doctype was institituted to allow a transitional period for designers to migrate from older coding standards to newer coding standards. An alternative to a “transitional” doctype would be a “strict” doctype.

In the example you have provided the distinction would be that for a “strict” doctype to be valid and display correctly, then you must write the code for your pages specifically to HTML 4.01 standards, whereas using a “transitional “doctype would allow you to use depracated (i.e. obsolete) code from say perhaps, HTML 4.0 or HTML 3.2 and, although it’s planned to eventually be elliminated would at least still work for the time being.

An example would be <font> tags. Very old coding practice and now depricated and has been replaced by using style instead.

For more on doctype declarations (a.k.a. DTD’s) go here

http://www.w3schools.com/tags/tag_doctype.asp

link: http://www.ozzu.com/website-design-forum/first-line-html-code-doctype-html-public-t58206.html

another thing is the MUST HAVE  (life saving) tools:

- firebug

- html validator.

Just hard believe how people to develop page without these tools in the old day.

Salute to the developers them.





Flash – Right ways for GUI!?

26 01 2008

Recently, I’ve installed Flash CS3 on my home PC because I wanna write little drawing program for my daughter. The result is very positive and I am why impress with it. And it really get to think about why it is so clumsy to develop GUI using Java or .Net.

First, I want to state that I am a backend development. Most of my time is struggle with binary stream, data log and tcp/ip using java and c++. The last gui program I wrote is about 7 years ago. However, I am interest to visual effect and wonder to present the data easily.

In order to write that little drawing program, I brought a primilary flash tutorial (on AS2) and it spent only 30 minutes (I have no background on flash before that). Then, it just works and the speed of development tool and final flash is good.

After that little success, I’m doing some more research on web and found Action script 3.0. It is very alike to any mature programming language.

It really get me wonder, is it something wrong with current GUI application which using Java or .NET. Why we need to model everything with plain code? should it just as simple as flash, draw something and just inside minimal code to handle it? Is it what current flash developer doing is the right way to implement GUI application.

I am very green on flash (30 mins arr..), maybe I am not in positive to make such as conclusion yet. Let see if I find more after dig into flash later.

Links:

(Below is some tutorial I find so far)





Rethinking on Five whys

26 01 2008

I’m fan on “Joel on software”. Although his recently blog is mostly about his trip and presentation, his blog is still insightful and fun to read.

In his latest article “Five Whys”, has the full description on his internet failure in data centre. That one draws my attention.

To get it short, the cause of the failure is due to one of the switch forget to setup the speed manually. And he review this failure using “five whys”, the methods to keep asking ourself at least 5 (or more) whys to determine the root cause of a defect or problem.

Follow example is extracted from the wiki.
My car will not start. (the problem)

  • Why? – The battery is dead. (first why)
  • Why? – The alternator is not functioning. (second why)
  • Why? – The alternator belt has broken. (third why)
  • Why? – The alternator belt was well beyond its useful service life and has never been replaced. (fourth why)
  • Why? – I have not been maintaining my car according to the recommended service schedule. (fifth why, root cause)

Below diagram illustrate another example:

It is sound obvious and just like most children doing (to play with their parents ) everyday. However, this is what most adult won’t do.

As a programmer, solving bugs is a daily job (I guess I am spending more ~50% to do it ). But most programmer I’m observed, they’re just solving them without getting in-depth. Why bug happens? Is it some fundamental design flaws? Is it development process is not good enough? Can it be prevented by introducing other tools?

I think we should use five whys before actually typing the code.

Links:
5 whys – http://en.wikipedia.org/wiki/5_Whys
Joel’s blog – http://www.joelonsoftware.com/items/2008/01/22.html








Follow

Get every new post delivered to your Inbox.