Where HTML beats C? - Computerphile
Вставка
- Опубліковано 26 тра 2016
- The ultimate example of trouble from digital promiscuity. HTML is more tolerant than C because it has to be. Professor Brailsford explains.
Deep Learning: • Deep Learning - Comput...
Secure Web Browsing: • Secure Web Browsing - ...
AI Game Playing Challenge: • AI's Game Playing Chal...
Convolutional Neural Networks: • CNN: Convolutional Neu...
/ computerphile
/ computer_phile
This video was filmed and edited by Sean Riley.
Computer Science at the University of Nottingham: bit.ly/nottscomputer
Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com
HTML: Works even if you don't follow the rules.
CSS: Doesn't work, even if you follow the rules.
JavaScript: Doesn't tell you the rules to begin with.
Hah, CSS yes. Javascript is apparently very multi-paradigmatic these days; is this perhaps what you allude to? ELSE explain? :D
@@JakeKlineMusic I think Javascript's biggest problem is that it uses keywords that mean similar but different things in other languages. Probably the best example is the 'this' keyword, which has the most people confused. If it was called 'context' it would be obvious to people that it's somehow different to the OOP 'this'. Of course there are other quirks too, but if you do things right you almost never encounter them.
Javascript is driving me insane (I don’t have a lot of experience yet)
@@ngergo6 it's honestly not that hard to understand
@@okie9025 of course it's not, it's just misleading. It's easy to assume that the same keywords do the same thing as in other languages and wonder why they work differently.
C tolerates my mistakes.
Me: go get the 11th element of that array which is of length 2
Python: no
C: cowabunga it is
thats why i love C/C++, you can access things you’re not rly supposed to and its so fun to learn how it works
@@sentfromheaven00 Yeah but it shouldn't be fun, because it can be dangerous.
@@borisjo13 Playing with stuff like this isn't dangerous. It's dangerous if you mess it up in real code, most of the time because you haven't played with said stuff before.
@@themanofiron785 it's dangerous because it's error prone. You sound like someone who also does not test their own code.
I don't think there are many companies left that develop their new software in C anymore.
@@borisjo13 "You sound like someone who also does not test their own code". As I said, it's dangerous if you mess it up in real code. Why would you assume I don't test my code?
"I don't think there are many companies left that develop their new software in C anymore". Wdym? C is the most used language in the world in 2021. Google it.
I want him to explain everything in life to me. I think then it will all make sense
Underrated comment ever.
just try to do what he is saying in your firefox browser
Same :)
His vision is so clear because he's seen it all happen.
he has a render on how to render 42 in print
This man the kind of professor at uni that you’d actually look forward to seeing
The only reason I wouldn't want him as my professor is his soothing voice would lull me to sleep
My takeaway from this video as far as languages goes:
a proper British accent can make any topic easier to listen too 😂
A proper British accent can also sell any product on an infomercial at 4 in the morning.
Next video:
Professor David F. Brailsford vs the world: Why i called HTML a programming language.
I'd love a video that goes into some depth on the definition of a programming language, as well as various other categories.
Hahahahaha!
Well you should take a look at the latest computerphile video then ;)
ElGrecoOB
Already watched it, mate :)
From a computer science perspective it _is_ a computer programming language, it just doesn't allow you to do half of the things other programming languages do.
At the beginning of the book The C Programing Language it says, “C assumes the programmer knows best.” Which is exactly the case here.
and here i am trying to access index[-1]
Have to know what the language is expecting to do based on your input
@@dromedda6810 and it will try to get something, just don't know what it is.
Quite a few years ago, (late 90's) while looking for something else, I came across a very long document by the W3 group which explained, in fairly simple terms, how a web browser should interpret and render html code. It also contained sections defining how to behave when the browser encountered mistakes in html code. The document was aimed at web browser developers. I only scanned the first few pages because it wasn't what i needed at the time but I wish I had kept it because it was so well written even non-programmers could understand it. I have not come across it, or any later version, since then.
Why do Java programmers wear glasses ? They can't C#
OH MY
So you write Java?
LOL
Terrible. I love it!
more like an assembly
What did I understand is that he tried to compare not between HTML and C as markup language as programming language vs programming language but talked about why HTML can be so forgiving, syntax wise and tolerant compared to say, C language.
Exactly. People here are complaining about little details, which are not even tropic of this video.
He clearly says in the end "It is a programming language, it is an executable language" never heard two statements together in Computerphile being so wrong.
+apostolis anastasiou
The quote is "It is a programming language, it is an _execution environment_", just being nitpicky.
***** He clearly said "HTML is a programming language" ... so I suppose that no ... he wasn't comparing Markup Lang with a Prog Lang
He looked at both of them as a formal grammar or contextfree grammar, If you have studied informatics you might remember: Production rules, the symbols devided into startsymbol, alphabet and terminalsymbols and nonterminalsymbols...
You learn this before you learn to build a parser and a compiler.
The tag isn’t picky and doesn’t nest. But is and does. And they are important when you get to JavaScript and CSS and you want to operate on parents and children. You need a hierarchy for that.
While I get what you guys are trying to accomplish here, telling new programmers that HTML is a programming language hurts more than it helps. We draw a distinction between a markup language and a programming language for a reason. HTML doesn't result in a program, a program uses it to generate a view of data. It is input, not code.
Totally agree
They should have just used JavaScript as the example instead.
I don't think this is directed at new programmers? I have been a web developer for a decade+ and found this enlightening.
That would not have worked. I mean: Javascript is more relaxed then C, but this is the bases on why it is a mess to code Javascript. First you write it for "any browser" and then you have to debug it for internet explorer and arcane "makes life easier" non sense in there.
who said this was targeted to new programmers?
>comparing a markup language to a programming language
What is happening, is this really Computerphile?
did you watch it?
Yes. And it does exactly compare a simple markup language to a Turing complete programming language. Apple to oranges.
I know what you're saying but I still found the vid informative
Sometimes it's revealing to compare apples to oranges
Writing HTML is indeed not coding, but the fundamental way that HTML works, the backend if you will, still has to interact with your computer like a normal program does (utilizing networking, showing graphics, browser differences etc.) This is a comparison between how HTML and C choose to deal with ambiguity in regards to your computer.
There's no need to be a baby about code vs. markup languages, especially when you are using it to deliberately overlook something valid.
"those of you who have written a program know that if you interpret it it's not going to try and mend your bad program for you"
This man obviously isn't aware of the horrors of php. Hopefully he remains as lucky for the rest of his life.
I hate it when my html becomes blank because I forgot a $ symbol somewhere in my php
Feel like everyone is missing the point of the video.
I thought it was interesting.
Right, although he limited himself the HTML’s tag. Not all HTML tags are like that. You have to designate closing tags for most other HTML tags or like in programming languages, you’ll get undesired results. While you CAN omit the tag, it won’t pass validators for HTML5.
@@bcbock validators doesnt execute, saying validators wont pass is same as, html source is not written as per standards. But thats not the point of the video.
That should have read "I'm sorry Dave. I'm afraid I can't do that."
Another quirk of HTML is that it is interpreted by the browser, and not all browsers interpret exactly the same. This can cause huge headaches when trying to make a piece of HTML code work on all browsers. It might even be different from one version of the same browser to the next.
I love languages like C++ where everything makes sense, even if it's difficult or you don't know how it works. It all makes sense when you read it. And if you think about what you're doing, it's so clear to write.
HTML is tolerant because it is a markup language and contains no logic and can't evaluate expressions. Therefore it will contain MUCH less possible errors and all of these common errors can be accounted for and pre-fixed on the browser level.
XML with DTDs is very strict.
The important part isn't that HTML can do this, but that it also effectively does this. There are logic-free GUI libraries for C and such, but none that I know of are as robust as HTML engines. The best systems for this of course hang somewhere in between. There are interface builders like for Qt that generate low level code.
HTML isn't entirely logic free. There are ways to determine what browser you're using (mostly used for IE, of course) and whether javascript is enabled. The browser can show different elements based upon this.
Growl wn, it is logic, but it's limited to do exactly that.
Python code is no code as well, I'd say. It's input for the Python interpreter for sure
It's not wonderfull, because when I make a mistake in HTML, I have no way of knowing where it is. So I need to check whether I haven't broken something about every other minute.
you can use XHTML and an XTHML validator. That's like actually reading all the complier warning that a C compiler spits out.
(You would wonder how many programmers ignore C compiler warnings)
sarowie I mean _serious HTML debugging_, come on. There is only one platform that can do that. It's obviously IE.
+OFfic3R1K Ah, the HTML validation methodology of the late nineties and naughties.
There are HTML5 validators, and why are you using something else?
In Firefox you can view the source and mistakes will be shown in bold red.
Two minutes into the video and I'm getting worried ... he'll explain the difference between a programming language and a markup language at some point, won't he?
*looks up what a markup language is*
a markup language IS a programming language
thanks for writing my comment ;-)
It's not. Markup is for defining information. Programming is for defining instructions.
It's the difference between the phrases "A guitar has 6 strings" and "Pluck the B string".
Are instructions not a type of information? This "information" is really just a list of instructions for where and how to display different types of information. Its like the difference between a machine that builds a guitar using a list of instructions and a machine that plays said guitar. I think that is a much more apt metaphor.
Close tag tolerance for things like a paragraph tag is the most minor of HTML's parsing tolerance. Heck, it wouldn't even work for divs. A more interesting thing is how it deals with broken tags, or angle brackets in attribute values. It has a whole bunch of rules, and, naturally, they used to be different between IE and everyone else.
tags can be nested, tags will be sequential within each and tags will be terminated by tags.
I don't know why people are complaining that HTML isn't a programming language. You completely missed the point of the video if that's your take away
I think this video makes it very easy to miss its point. Which is a big problem with a video, especially on an educational channel.
+Tera
I don't think it's missing the point. I think they are trying to fix a big mistake. HTML and C are not in the same ball field. it's like comparing apple and orange.
Rather, it's like comparing an apple to a car.
ui_wizard ***** Seyha Leonhartz
They're not trying to fix a big mistake, they're focusing on the fact that the speaker said "HTML is a programming language". By the common definition of Programming Language, it's not.
The video isn't about that at all! It's comparing HTML to C, which are both LANGUAGES! They are in the same ball field, because they both go through parsers! That's the only common ground that they're being compared on. Yes they're not both Programming Languages, but both have to be parsed. One of them (html) parses unclosed blocks by closing them right before the next block tag (i.e. supposing you meant to sequence the blocks, instead of nesting them), while the other (C) refuses to compile the code if you have unclosed blocks, because it doesn't want to guess, it needs to know exactly where you meant to put the }, as moving it changes the behavior of the code drastically.
(Moving a in html can also alter the rendering of the page a lot, especially is the CSS is quite involved)
I hope that clears it a little! Cheers!
(Moving a in html can also alter the rendering of the page a lot, especially is the CSS is quite involved)
I hope that clears it a little! Cheers!
Salah Eddine H While I agree that this video was mainly based on language parsing, both the title as well as content suggested a comparison between the two, even though it was not the main part of the video.
While some HTML tags like cannot be nested, other tags like can be arbitrarily nested. At that point you can't unambiguously interpret malformed HTML anymore. But the browser will definitely still render something. Since HTML is a markup language, I think the browser figures bad input is "harmless", the worst case scenario is that a page is unreadable.
A programming language which is designed to execute arbitrary expressions can do a lot more damage than an improperly formatted document. Arguably, this is the real reason why 'proper' programming languages will not (generally) attempt to execute or compile invalid syntax while web browsers will happily chug along and render something.
Simple answer: html is not a programmming language
@9:00
HTML is a programming language.
If you're going to say that HTML is a programming language, then you might as well include things such as word documents, as they too are based on ML, or 'Markup Language'. So, no, HTML is a not a programming language. It is called "markup" for that reason.
To say that "HTML is a programming language" is incorrect. First line of the wipedia article...
en.wikipedia.org/wiki/HTML
Expected better from Computerphile.
Expected a better source than Wikipedia -.-
I'm the better source ;p
No mention of how tags are by default block layout elements (according to CSS). That's why they will appear to be in sequence when they are nested.
actually according to the spec a p element is not allowed to have a p element as a child
In the days of XHTML 1.1 (around ten years ago), web standards were actually going in a less permissive direction. The idea was to force HTML pages to be valid XML documents. This also came with built-in strictness. If you made a mistake in your XHTML, the user would see an error message, not a fixed-up document.
However, this behavior would only be enabled if your XHTML was served the the application/xml+xhtml content type, which is very rarely was. In the end, the attempt to XML-ize the web failed and other forces in the industry came up with HTML5, that quickly became the internet standard.
ahw yeah, i remember seeing error codes in xml documents
thanks for sharing this, 'cz i was thinking how could html even show errors, but your mention of xml made me recall that
It is the browser interpreting the html that is tolerant, it isnt html itself... the browser can be programmed to treat nested paragraphs the same as sequential paragraphs or it can be programmed not to or it can even be programmed very strict and just display an error if it isnt strictle adhering to convention. The tolerance is not at all an inherent property of html itself, but a product of the makers of browsers wanting people to install their product, so they want to be as useful as possible with as few errors as possible, which includes error anticipation and handling: browsers didnt use to be this tolerant of errors in the past, which is a clear indication it has nothing to do with html itself. This is all that is: error handling, it isnt "tolerance" by the language itself. Also it isnt a programming language, so why the comparison with C? A programming language has to be rigurous in order to be consistent. The interpreter of a markup language (such as a web browser) can afford to have a lot of ways to treat and "ignore" errors (they dont ignore the errors, they just have a programmed behaviour for what to do when they encounter them).
Hmm, where HTML beats C is that it has a system of rules to try to autocomplete your code for you when you finish it with errors? Sounds like autoAim in video games: Useful until you need to aim at something that's close to a few other things... that it keeps locking onto instead of the thing that you want to aim at.
It ends up not making much of a difference. If mess up and html forgives you, there are great chances that it may interpret it not in the same way you did, leading to the pain of proof reading a lot
Also, no compiling errors. It will execute everything and if it doesn't work, it doesn't work. Unlike many other languages which force you to fix the error before executing
BlackenGames That's kinda neat. I've been doing some things in Java and if something can go wrong, you have to tell it or else it'll crash. It's kinda confusing for a beginner, but I think I'd prefer it crashing than not doing what I thought I told it to and being even more confused.
Now that I've had some experience with Html, I should watch this again!
+greenmumm Agreed, but HTML remains a useful language nonetheless. You can't feasibly make a website without using a markup language, and you can't feasibly make the web browser without the programming language. The two work together, and neither is better than the other.
As all the other people said: HTML is not in the slightest a programming language. But even more important: HTML tags have basically *absolutely* no meaning when you remove the CSS. If sequences or nestet s make a difference depends solely on the CSS.
7:04 damn i love those animations and that professor too
This compares apples an oranges.
tags have specific rules that say they can't be nested, none of the other things compared with do, so the comparison is invalid. Comparing with a tag that could either be nested or not, such as would show similar problems as faced by the C compiler, where the browser is unable to guess at the appropriate output. They will guess, but there is no way to know that the guesses made are valid.
Also, is a much more descriptive tag than a curly brace, which is more general purpose. C could hypothetically be edited to use html-like tag pairs like {func} with {/func}, which would allow compilers to make educated guesses similar to how html interpreters do.
Here is a code block in C without brackets:
if (x) printf("x is true");
The way is handled by the engine is a documented exception and has predictable behavior, just like that C line above.
I get the point of the video but that example was really weak!
ah, but without brackets you can only have 1 statement. so it's still unambiguous, as if you then say print "blah" it will always print blah regardless of whether x is true or not. (also that "print" is invalid syntax in c.)
Sandra Nicole And that's my point! The behavior of oddly nested tags are also unambiguous! It's explicit and well documented.
(and thanks for point out the faulty syntax. I don't touch a C program in a while :x)
In XHTML, the tag is a paragraph separator. In c, the if statement always takes a single statement. A block in c is a collection of statements that can be used where a statement is placed.
In XML you can have tags that don't end, you just have to have them like "" with the slash after the name instead of before it.
***** I meant exception as in “exception to the rule”, not as in “throw exception”. But yeah, you're right! s auto-close when followed by another block tag, and the second is another block tag! that's actually easier then what's said in the video!
My thoughts exactly. The example he gave had no ambiguity at all according to the HTML spec. tags are always closed when followed by another and unmatched closing tags are always silently discarded.
The reason why HTML "knows" (it's really the browser that's correcting your mistakes) that there should be a closing before the new starting tag is because paragraphs are NOT allowed to hold other paragraphs (or block elements in general) by specification. Therefore the browser knows that it must be closed.
And calling HTML a programming language is just wrong.
I get the point you wanted to get across, but I really need to say that this was a pretty bad example.
love this HTML series of videos... can't wait to see one about JavaScript and css
If HTML was a programming language, we wouldn't need JavaScript with it.
If HTML was a programming language (in the common sense), then XML should've been too. If XML was a programming language, then JSON should've been too. HTML is a descriptive markup language.
I'm afraid the Professor is a little bit off this time, since even in the first few minutes he got something completely wrong: "TextText" is different from "TextText". Although they look the same with the Firefox default css applied rules, it doesn't mean they are the same. If the default css applied rules had a "p { padding-left: 10pt }", then the corresponding outputs would look different.
He already made a video explaining what makes HTML a "programming language". In simple terms, HTML is a declarative programming language which defines a document. PostScript is a similar example, only PS is actually Turing complete, unlike HTML.
Stuff like Javascript was added in to make those documents more interactive, but there's no reason raw HTML couldn't have been designed to be turing complete by just adding some if/for tags or something.
@@xAlien95 In HTML the two outputs are the same, with the minor exception that the nested version creates an extra (empty) paragraph due to the last being treated as extra, because the two other are already closed due to HTML's implicit rules… But that's in HTML.
YOU seem to be talking about XHTML, which is different, and more "strict" about end-closing tags. In XHTML's case, yes, the two examples would come out extremely different, because unlike HTML, XHTML doesn't try to "guess" what mistakes you made and will even throw out what amounts to compile errors.
"It (HTML) is a programming language" - Professor Brailsford
😆😆😆😆😆😆😆😆😆
Finlay Mitchell
He said it at 8:59
Whoever this man is, he should definitely not talk about programming languages.
Finlay Mitchell
Maybe he is, but html is definitely not a “programming“ language. It is for sure not turing complete.
This guy is basically coding-gandalf.
As a computer science guy myself, I love it.
I don’t know if I’d agree that this happens because html is not built for nesting and complexity - the entire document structure is rendered as one big n-ary tree. Rather I think the reason why HTML can be so tolerant, at least in the example given, is because of the semantic ideas that are part of the tag. Simple by using the tag, you’ve already given the interpreter a lot of information about what you’re trying to do, in a way that you haven’t if you put one for loop after another without specifying the relationship between them.
I compiled a list of use cases where HTML beats C:
You could've at least ordered your list
What’s missing here is the origin of HTML. It is IBM’s mainframe word processing language. In recent years things have been added to it for video screens like the color codes.
I began using HTML (Hyper Text Markup Language) in the mid 70’s to write documentation manuals on our IBM 360 & 370 mainframes. You’d type the document into a text file and add the various formatting control codes. Paragraphs, line items, ordered (numbered) line items, footnote references, index entry tags, bold type, underline, etc.
If I dig deep enough in the basement I should be able to dig up my copy of the IBM HTML reference manual. Mine had a 1972 copyright date. Probably a 3rd or 4th version.
Remember early personal computer word processors in early 80’s? Word Perfect, AppleWriter, etc? Text files with formatting commands embedded in the text. Welcome to the origins of IBM HTML.
You are confusing HTML and GML/SGML, I'm afraid. While HTML was originally (until HTML 4.01) based on SGML, they're not the same thing. HTML was created ~1991.
The example would work better with . The HTML specification is clear about tags: you cannot nest them. There is a clear reason for the browser making a silent assumption. Edge cases were interpreted differently in different browsers thus causing mayhem when the the html was rendered on screen. In short HTML has the same problems as other markup and programming langauges.
Most intensely addictive channel in UA-cam other than Ben Eater's. I spent hours in UA-cam after finding this channel.
Next video: *Where Sony Vegas beats make*
It's Friday and Professor Brailsford has done a computerphile video, life's good
I love how you explained this! Brilliant! Thank you
This was an incredibly point to make. This video only needed to be 30 seconds long.
Title this video "HTML is more tolerant than C" or something. "HTML beats C" is really ambiguous without specifying that it beats C in specifically syntax tolerance. The general statement "HTML beats C" makes no sense because they are two very different technologies with completely different capabilities and use cases. One is a markup language, the other is a powerful low level programming language.
But that wouldn't draw in as many clicks by being controversial.
I now appreciate that Python syntax for nested and sequential loops looks so dissimilar.
Use whatever language turns you ON. Best programming quote ever.
HTML also make assumption about some stuff, like a paragraph in a paragraph is most likelly to be incorrect, so will just assume that the previous one need to be closed. In fact, many browsers (used to?) ignore the tag and basically replace by , as a new paragraph is basically that: an empty line.
Also, it can also assume some things: in a table, if the line wasn't closed and you start a new line, then since you can't have a line in a line then it must close the previous line.
When it fail to do the proper assumption, it just try to render it as best as it can: you forgot to close a table cell and the remaining of the table? Well, let's fit the rest of the code inside that cell...
So many people missed the point of the video. And maybe a lot of them didn't even finish watching the video
please, explain me the point of the video: I didn't got it. Seriously. I can't see how can HTML and C (or any other programming language) compared.
I would gladly try and explain it, to the best of my understanding:
We CAN compare HTML to C, as they are both Languages, which have to be parsed and "understood" by a compiler or an interpreter. One of them is a Markup Language, being interpreted by a web browser, while the other is a programming language. Sure, one of them consists entirely of markup, while the other consists of instructions. But they have similarities, in that they both get parsed, and both can have nested blocks.
The difference is in the tolerance of the parser. An HTML parser is much nicer, but does more guessing: When faced with blocks without closing tags, it will "auto-close" the first block before beginning the new block, so it guesses that the blocks are sequential instead of nested.
C is not as tolerant, because it wants you to be explicit about what you want. If you open a block but don't close it with a }, the code just won't compile. It wants to know exactly where you ended your block, because moving a } changes drastically the behavior of a C program.
So that's basically it. HTML parsers do guesses which might be wrong, in order to just render the page, while a C compiler doesn't want to guess what you meant.
I hope that makes it clearer! Cheers!
and then there's python where instead of having to deal with forgetting curly brackets you have to deal with adding the right amount of indentation
I love it how people's arguments about why a language is better than another is because how friendly it is to bad programmers, it's no longer about what language is more capable in performance, and functionality, it's about how shitty the programmer can be before anyone notices. The programming category has been swamped with wannabe programmers over the past 15 years thanks to this ideology.
christopher békési by your reasoning I can assume you only work with low-level languages?
@@salmjak Probably only uses machine code
@@TheChrisey the best programming languages are the most productive ones. If you can make money programming in java rather than programming in assembly, then java is better. If you can find experts more easily in a particular language, then that language is better. It's all about how much money you can make in a capitalist society.
Although HTML doesn’t change the way it displays the paragraph it does effect it in CSS. For example look up css :nth-child(#)
The html spec states that p tags cannot be nested within each other. That's how the browser can unambiguously ignore the end tags. The correct behavior, even if you include end tags for the nested case is to un-nest the elements - the f12 tools will show you the re-written document and the DOM will not show the elements as nested.
9:06 I am sorry but did he just say that HTML is a programming language?
Some of these comments are really sad and so are the dislikes. "Where HTML beats C" does not imply that "Overall HTML is better than C" or anything similar. The title just means "Why HTML can do something that even C can't." The video doesn't say anything like "HTML is better than C" so why are people so offended about it? (I am not talking about the people pointing out things that aren't technically correct in the video) C is only given as an example in this context, and from what I understand, he is talking about how the languages are designed to work. He is not talking about how fast or efficiently a program would run based on its language, he is talking about *why* they are designed the way they are. They could make the same points in a video about two esoteric languages.
Because a lot of people on the internet are self centered smug twats that jump at the chance to point out something that they perceive as wrong only to pat themselves on the back. Often, as the case here, without properly looking at the context or what is actually being said.
lessc and tidy are 2 neat command line utilities I use to check my css and html files for syntax errors and whatnot. It can be nice to find errors that way instead of letting the browser fumble over a bad source file
I think the title did this video a great disservice. The professor never said HTML was better or beat C - he only explained how they are different.
Video title makes no sense. Not what Dave really meant in the least.
9:06 When did a markup language morph into a programming language?
Since HTML5...
Caudex With loops and variables and conditional constructs? (I'm not talking about JavaScript.)
RonJohn63
no. my joke was poor. HTML5, even with it's added functionality is still just a markup language. :P
HTML5 with CSS is turing complete
@@RonJohn63 VueJS lol
Thanks for the lesson, Professor X :)
interesting video
Where do they get all the old style printer paper from?
a lot of people missing the point of the video
They really are, getting caught up in semantics. Its a simple video like html, everyone here is all C syntax error checker.
a lot of people ARE missing the point of the video.
everyone here IS LIKE A C syntax error checker.
A lot of people...
Everyone...
ok then, please explain that to me, since it seems I missed it also.
***** There is a follow up video to this one. I have not seen it yet but I guess he makes his point in there.
I personally don't find it a big deal. Whats important is someone knows how to use HTML not to get caught up in details that don't matter in the larger image.
Aside from the Markup VS Programming thing that's already been bought up enough in previous comments, it has been quite peculiar seeing the constant use of the tag as an example of HTML overall, it is by far (I can't stress this enough) the most common tag to remain unclosed in typical HTML documents, and is only one of a few (about 15) tags where you can do that. Including HTML5 there's something around a hundred HTML tags currently valid for use, and you cannot do that with most tags. This is without even bringing up things that might not break your HTML, but will likely deform your website due to your attached CSS.
Basically while I'm not saying that the explanation provided in the video is strictly incorrect, it feels like a quite dated explanation that has not been run past someone with a more modern (And thus applicable) view of things. It is important to remember that this is not an explanation of some legacy system that is deprecated, but rather something that is still evolving and alive today, thus accuracy of information as it applies today should be quite important.
If you use tags you would get an entirely different result. They can be nested as deeply as you want, and to get what you are hoping for, for example 2 smaller divs inside a container div, you must have the closing tags placed correctly, and for the example I just gave, something like this would work:
Some content
Some other content
If you closed the container div before opening the others, it would change the tree structure of the DOM from what you were intending.
I think the most annoying part of HTML is default cascading styles that you have to overwrite with a boilerplate each time you start a new project. I'm not sure how anyone would miss a closing tag unless they have no idea how to write HTML, but even so it's funny it fills that in for you.
Yes C does not tolarate *syntactical* errors by the programmer. (It won't compile)
But it *will* tolarate many *logical* errors. Thats why it's so dangerous.
Just look at Heartbleed...
To be fair, just about any programming language will tolerate logical errors.
But some (most modern ones) do their best to *fail* if the programmer does some unintentional logical error.
Such as using uninitialized structs .
C just tells us: Yeah i'll compile that for you... but you know: That is "Undefined Behaviour"
So it let's us kick ourselfs in the nuts even though it *could* see that something is wrong.
But well: With great power comes great responsibility
Especially when multithreading is involved.
ie: x == x can actually give you false in a multhreaded environment
First off HTML is a markup language, while c is a programming language.. secondly try not closing a tag and expect it to work as a sequence.. HTML will tolerate not closing a couple tags as it doesn't make a sense to nest them(e.g: or )
Well, with specific CSS, the nested p-tags would look like intends.. Curious about this video
Nope. after is treated as if it was . So the last would be a dangling one and be ignored. No nesting happens.
Just try it yourself if you wanna know for sure ;p
I for one thought the comparison was fine and the point made was a valid one. Thank you for many great videos :)
5:14 wait what
You heard the man
HTML is not executed, btw.
Yeah, it's parsed. A big difference.
And then executed? Where do you draw the line for when a programming language is a program language - does it have to be written in 1s and 0s?
No, and then a page is rendered.
We draw the line between programming languages and markup languages.
Like HyperText Markup Language.
Is in it's name.
Even it its able to reference and embed programming languages, it is not a programming language in itself.
When you embed javascript on a HTML page, you are just giving a bunch of code in a different language to be ran by a dedicated virtual machine.
Same for plugins that are ran by the browser.
None of that makes HTML a language where you program.
as a web designer i love to see all the programmers being triggered by this video
Technically, HTML isn't a programming language, as it's only a description of a webpage layout (a "markup language", hence the ML at the end). A lot of the markup languages I've seen, especially HTML and Markdown, are very forgiving, because they KNOW that it's not 100% important to obey the syntax and more important to actually show things. Markdown has a lot less tags than HTML does, obviously, but it's designed to be a simpler HTML, and to "compile", you might say, into HTML. (Hence why heading markers (hash signs in Markdown) are optional, and a new line is assumed to be the end of the heading, forming a tag).
as far as I know, html in an of itself(excluding CSS, JS) isn't Turing complete, it doesn’t even have macro expansion. Calling it a 'programming language' is a misnomer.
Correct, it's not Turing complete.
I don't accept that a language has to be Turing Complete, or "general purpose" to qualify as a programming language! As commenters have said elsewhere, HTML is an interpreted ,declarative, special-purpose programming language. So,you can't calculate your tax bill with it -- and its main purpose is to create displayable Web pages. But it does get executed (by a Web browser) so in my view it's a special-purpose language and creating Web pages by hand is analogous to Assembler programming.
I do not agree that writing web pages by hand is smiler to assembly language as the whole system is at a much higher level, and very much designed to be easy to write by hand, even CISC assembly languages exist at a far lower level. It really isn't comparing apples with apples as the two serve entirely different functions.
+robehickmann really think you nailed it. Can I add, what's the use in the term "programming" if you can say that latex and html documents are "programs"!?
Have you heard of entities?
The L in HTML stands for Lazy.
Hyper Text Markup Lazy is it? :P
thatsthejoke.jpg :)
Yup. I hate the world lol
Perhaps his point is valid for the tag, but it's not so for lots of other tags....lists, for example, are quite analogous to his example and have the same problems. They are only optional when it is clear what they mean, and the definition of means it doesn't have to have one....that's not how you do what *he* thought it should do...he presumed it would indent or something...well, that's not what it is supposed to do, so it is his own error.
The HTML standard has some "block" elements that can't be nested, P is one of them, that's how browsers can implicitly place the end tags.
DIV on the other hand can be nested, and the end tags are required, letting the browsers guess that for themselves is never going to end well.
For the sake of everybody's sanity always use the end tag, it also saves time on the receiving browser as it won't have to run the error correction algorithms.
GuYs fun fact: GTA5 was coded in html
It used Java too.
Which version?
Lol it was a joke right!?
Windows 10 is programmed in LaTeX. MacOS is programmed in brainfuck.
@@rydiaofmist8190 Dude, programming MacOS in Brainf*ck would be an achievement.
I do like the content of this video, however, the title is a bit click baity. The TLDR would be that html tolerates coding mistakes not because it is somehow magical, but because it limits itself to only handling simple behavior. C is more powerful and therefore cannot be ambiguous.
You could argue about which is better, a simple structure, assuming a limited behavior(how much simpler is it really though?), or the ability to easily write complex behavior unambiguously. Personally I would value the latter over the former. That is why the title "Where HTML beats C" seems click baity to me, as I don't see this as feature of HTML that beats C.
The number of people who didn't understand the point of this video is astounding. He wasn't comparing HTML and C to point out which was better or worse. He was simply pointing out that the HTML interpreter is much more fault tolerant than the C compiler. Realistically, there's nothing stopping someone from writing a fault tolerant C compiler, but it really comes down to philosophy. C was designed to break early and often whereas HTML was designed to NEVER break even if it encounters markup it doesn't understand.
If C becomes as you say "more tolerant", then it will eventually be a lot harder for you to debug your program since it's no longer gonna be consistent with the rules and syntax.
I personally think we should make languages as simple to learn as we can, but can't rely on them to correct all of our mistakes just because we're too lazy to learn or to practice.
Isn't HTML a Markup language, not a programming language? Or is there a distinction I'm unaware of?
depending who you ask :/
I don't even like calling it a language. I call it markup code. Officially it's name still calls it a language, but it doesn't follow typical rules of language at all, its just mark-up.
Mshojat it is a language, it has a proper grammar.
Mshojat The thing is you are equating language to intructions. I'm taking a broader meaning for language, in which a language is any way to express something (to a computer in this context) such as layout in this case.
Please note I'm arguing "language" and not "programming language" - I say HTML is - as the same says - a markup language.
technically, it's not acceptable to HTML itself. that's just how the various browsers tolerate the interpretation so they get used by more people.
also HTML is not a programming language
Not sure why people are complaining. This is about HTML parsers being more permissive than C parsers and so result in usable byte-code rather than a compiler/interpreter error. You could substitute HTML with JavaScript, since it has semicolon insertion, making it more permissive than C, causing runnable code with sometimes unintended results; but it's more subtle and he's been talking about SGML, XML, and HTML. What is done with the byte code is up to the interpreter or machine code generator; you could create a new programming language that uses the generated HTML byte code, the DOM tree, to do something other than tag text. HTML5 includes SVG, which can be used to create looping animations.
7:40 For every one "hello sean", you'd get ten "goodbye dave"s
I'm going to use that the next time I have to teach someone nested loops.
Nice comparison, you could make this a series. For one I would like to see where common household items have the edge over C.
HTML should be compiled and throw lots of errors for those lazy programmers who don't use end tags.
Does the nesting-vs-sequencing effect show when you apply independent styles to your paragraphs...
With the jumps from HTML4 to XHTML to HTML5, and with CSS2 to CSS3 and up, they have tried to set rules so all the developers would know how to set up consistently the same, matching process for how to parse things and what to do when there are syntax errors in the tags / markup, the HTML and CSS code. They wanted to make it more consistent across browsers and other rendering agents and programmatic uses.
The Ultimate Answer: HTML is not a Programming Language.
Next up: Where screwdrivers beat lawn mowers.
Stop the clickbait, guys.
There is some stuff you don't need to make explicit though. For example, implicit type conversions, or generic type parameter interpretation... of course, these both have their limits.
The end goal of the page HTML is well known. It describes a page. So you can use this information to help correct and get something to display in the browser. That it describes a page is an inherent specification.
The lowest inherent specification for a file of c code is that it describes a program. "Program" is many orders of magnitude more abstract than "webpage" and this is what makes it hard to correct errors and the simplest way is to flag ALL errors.
Seems like Dave isn't getting the message. Please Dave, shaun is here now can you go?
Really, you consider HTML a programming language? I mean, I love HTML. I use it as a GUI for most of my programs. But it's not a programming language. It's a Mark Up Language. To call HTML a programming language is like calling a doc file a programming language.
Both of you need to get off your high horses.
Have you not watched any of the other videos in this series?
Yes, HTML is not comparable to C, in regards to what you, as an individual can code.
But HTML most definitely is a programming language.
You expose your ignorance by calling it a "Mark Up Language".
Or did you think a "Mark Up Language" has the capability to render video & display dynamic graphics?
It's rather obvious it is a very powerful, but extremely standardized, and regulated programming language.
Now build me something that can do the same.
Lets see if it's still "Mark Up Language".
You're wrong, do some research.
Actually, it can.
And does, what it doesn't do is expose that ability to the end user.
So much is done by HTML, yet somehow people don't even realize.
Hint, you use JavaScript to access these APIs.
Yes, you are simply accessing these pre-existing APIs, but they are definitely doing some heavy lifting.
That comment wasn't directed at you.
Let me say that I was not insulting HTML in any way. I'm not on any high horse. I love HTML, and as I said, I use it as a GUI for almost all of my programs. But, it's not a programming language.
You can't program it to do anything itself. It's not a programming language in anyway.
Kris Occhipinti
I used to think the same.
The internet early days, was not sunshine and rainbows, far from ideal for development.
HTML depends a lot on JS to use many of its APIs. However it wasn't planned. Why even HTML?
But let me ask you this, what language can exist in a vacuum? At some point, there is always a dependency.
Not to mention.
It must run in a browser!
So what, all languages need an engine or interpreter / compiler; unless you are writing in assembly language.
It's a programming language.
Edit: Forgot to mention: With tools like headless browsers and webkit driver it's even less reliant on having a browser.
However, note that if you want nested lists (trees) such as outlines or menus in HTML, you nest the list tags in a way very much like he's showing improperly nested paragraphs. (Paragraphs are not supposed to be nested, as he's pointed out.) So with nested lists, you have:
ul li (text for this li tag) ul li (here's our first nested list, indent the outline one generation) /li li (another list-item) /li ... /ul /li li (more list-items which might contains more nested lists) /li /ul
That's a really abbreviated sketch, but the idea is, you don't really have a convenient wrapper tag for what is essentially a list-heading or a list-item, before you start the nested list within it. So the tagging structure looks too iffy or almost broken, without some sort of tag around the list-item or list-heading that goes prior to the nested list.
HTML and its error tolerance is exactly why we should use XHTML
It's consistent, it allows self-closing tags, and it throws up in your face if you make a mistake. HTML doesn't do either.
XHTML
All tags *MUST* have a closing tag, no exceptions
All tags *MAY* be written as a self-closing tag
If you forget any of those it'll fail horribly, and throw an error at your face
HTML
Some tags have closing tags (), Some tags can't be written without (), some don't have closing tags ()
Self-closing tags are NOT part of the HTML standard, and writing them will just cause the parser to ignore the slash, which is why doesn't work, but does, and why it makes no difference if you write or .
If you forget any of this, it may or may not render correctly; it varies from browser to browser.
HTML is an ungodly mess.
The beautiful upshot of XHTML, is that things like suddenly become legal, which they weren't before, because it simply gets translated to which it *doesn't* in HTML. Another upshot of XHTML is that there are fewer rules to remember. In HTML you got one rule with 3 exceptions, in XHTML you have only one rule and a sub-rule. You don't have to remember which tags the exceptions apply to, because there aren't any.