Jump to content

can't people tell the difference between php and html ?


Recommended Posts

  • Replies 53
  • Created
  • Last Reply

Top Posters In This Topic

For the purposes of programming, I consider anything resembling a language to have syntax, not markup -- so HTML falls outside my definition.


Frankly, I don't care how the "L" came about.


But HTML is not a programming language. It's a markup language.


That's like saying English isn't a language just because it is not a programming language. Things can be languages without being programming languages, you know.

Link to comment
Share on other sites

Looks like all the staff are against HTML being a language.


1 persons opinion VS. the phpfreaks staff


I know which side i'd agree with.


I think you alt to read the thread before making comments like that, Daniel agrees with me and he is the administrator


status in a forum or even a majority, does not always make something right

Link to comment
Share on other sites

It's not a programming language. I think the w3 consortium defines what html is pretty well:

To publish information for global distribution' date=' one needs a universally understood language, a kind of publishing mother tongue that all computers may potentially understand. The [b']publishing language[/b] used by the World Wide Web is HTML (from HyperText Markup Language).
Link to comment
Share on other sites

To me, language markup and markup language are two different things.  Yes, it is "officially" called markup language, but IMO clearly it should have been called language markup.


It's not marking up language, it's markup up content. Content doesn't have to be (natural) language (e.g. English). So it could be an image of a bird, a video of a bird eating a worm. It could be the representation of an entity of a third party program as well (e.g. Flash or Silverlight).


HTML has a precisely defined grammar and syntax. It is very specific in what you are and what you are not allowed to do. Parsing it would be done using methods you would learn in any compiler course (lexical analysis, then semantic analysis, etc.). The grammar is defined using another DSL called DTD. HTML is parsed into what's called DOM, and it is given representation by another DSL called CSS.


You are right, it is not a programming language, because you cannot program a computer with it. Your argument (that HTML is not a language of any form) is flawed because you are making the assumption that language = programming language, but that is a false assumption. You cannot conclude anything based on false premises.

Link to comment
Share on other sites

The only thing I'm arguing against is that CV claimed that HTML and CSS aren't any type of language at all.


I concede that in the broadest of terms, it can be classified as "a language," although I maintain that it would be better classified as something else, like fenway's suggested "template".  But in the context that it is used in 99% of the time, that's where I have issues.  The issue being that average Joe does NOT make the distinction between markup language vs. programming language.  My compromise is renaming it to htlm instead of html, in the hopes that people can better understand that it is not a programming language.

Link to comment
Share on other sites

It's not a template though. It only conveys semantic information about content (which is not necessarily language). It's a way of representing structured data that is to be parsed into a tree like data structure known as DOM. Only when you combine it with CSS can you have a template. HTML conveys no presentation or visual information whatsoever (except tags like <b> and <i>, but these are perversions of the language forced into the standard by the industry).


DOM may then contain information from also CSS and Javascript, and that combined is what gives a web page. Each HTML tag has a set of standard CSS attributes associated with it. For instance, <h1> is typically a block level, bold face element that is larger than regular text, and has a vertical margin to separate it from surrounding elements. However, these rules are not defined in HTML, but in CSS.

Link to comment
Share on other sites

HTML conveys no presentation or visual information whatsoever (except tags like <b> and <i>, but these are perversions of the language forced into the standard by the industry).

I couldn't disagree more -- the entire purpose of the markup is to convey presentation information.  That's why everyone is so upset when people use tables for non-tabular data.  Just because the browser displays it better as a <table>, doesn't mean it's a "table".


The fact that CSS and JavaScript can inject additional instructions that modulate the underlying HTML markup is irrelevant.

Link to comment
Share on other sites

The reason why people get upset when other people use table tags as presentational markup is exactly because HTML shouldn't be used for presentation. If your content semantically is tabular, you use the table related tags, but that in itself does not in any way specify how it should look. You'll do that using CSS.


That is the general idea in the concept called "separation of concerns" in regards to web pages; you split the web page up in the layers content (HTML), presentation (CSS) and behavior (Javascript).

Link to comment
Share on other sites

[...] every single HTML tag represents a presentation element.


How so? How does <h1> convey presentational information? It's only because the rendering engines attach certain CSS attributes to it when parsing. And they actually do it differently sometimes and the user may override it.

Link to comment
Share on other sites

when you create a div, where is the presentation markup?


you will see nothing on screen until the div is styled with css


a div is just a doorway for the css to enter, it in itself is not creating any style element.


not true:




There is already markup at work, because they will appear on two separate lines.

Link to comment
Share on other sites

Same goes for H1 -- you don't need any CSS to get to do display differently than non-H1 text.


Regardless, I've been building web pages since 1996, when CSS didn't even exist.  And _before_ CSS came along, everyone was happily creating "presentation markup" with HTML alone.


BTW, the last line of the intro wikipedia article on HTML reads:


The W3C, maintainer of both HTML and CSS standards, encourages the use of CSS over explicit presentational markup.


So even the W3C will concede that HTML allows for "explicit presentation markup".


CSS changes nothing -- it just gives you yet another way to affect the presentation.  The fact that everyone really wants to ignore that HTML still -- and will forever -- let you specify when your text is bold is just silly.  I'm not suggesting that it isn't better to move the presentation layer to CSS -- just that HTML has such elements.

Link to comment
Share on other sites

Same goes for H1 -- you don't need any CSS to get to do display differently than non-H1 text.


Right, but there are no rules in the HTML specification governing how H1 should look. It's completely up to the user agent to apply additional styles to the element. Same thing goes for a multitude of other tags like A, KBD, ACRONYM, STRONG, etc. In section 9.2.1 of the HTML 4.01 specification [1] you'll see:

The presentation of phrase elements depends on the user agent.


I am perfectly free to write a user agent that makes all text within STRONG tags 10 times larger than the normal text and flashing in red. That would provide a strong emphasis after all, and that is all the STRONG tag is supposed to do.


All the places in the HTML 4.01 specification where presentational tags are described, there is a remark saying something along the lines of "but we recommend you use CSS instead".


Nowadays, the preferred way of writing web pages is to not use HTML as a template, but rather as a document describing meaningful semantic information about the various parts of the content.


It's very clear to see that HTML is moving further and further away from being used as presentational markup to being used as semantic markup.


Moreover, in section 11 of the HTML 5 working draft [2] you'll see:

User agents are not required to present HTML documents in any particular way.


This shows that HTML (in version 5) does not in any way convey presentational information. Additionally, in section 11.2 of the same document [3] you'll see:

The CSS rules given in these subsections are, unless otherwise specified, expected to be used as part of the user-agent level style sheet defaults for all documents that contain HTML elements.

That shows it is CSS that is responsible for the visual (or aural) presentation of the content.



[1] http://www.w3.org/TR/1999/REC-html401-19991224/struct/text.html#h-9.2.1

[2] http://www.w3.org/TR/2009/WD-html5-20090825/the-xhtml-syntax.html#rendering

[3] http://www.w3.org/TR/2009/WD-html5-20090825/the-xhtml-syntax.html#introduction-9

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.