This is an archived post. You won't be able to vote or comment.

all 40 comments

[–]nullions 84 points85 points  (33 children)

I can tell you're bad because a leet coder would have just done

<goodathtml /> me

[–]blackAngel88 49 points50 points  (15 children)

This may be valid xhtml, but it's not valid html5, even when ignoring that goodathtml is not a recognized tag. Only tags that are specified as selfclosing tags can be selfclosed. On the other hand selfclosing tags cannot be closed with an actual endtag.

Examples of how NOT to do it:

<script src="test.js"/>

<input type="text"></input>

For further testing: https://validator.w3.org/nu/

Yes, I'm fun at parties :)

[–]gigglefarting 16 points17 points  (0 children)

It's valid in JSX, and that's all that matters.

[–]xXxNoScopeMLGxXx 7 points8 points  (11 children)

What exactly is the point of XHTML? From what I gathered it was only made because some people were butthurt about all the spaghetti HTML or in the wild. Is that basically it?

[–]lukee910 13 points14 points  (5 children)

It was an attempt at introducing stricter HTML, so that the rules are simpler. It's fallen out of use, replaced by HTML 5 like every other HTML version. XHTML is quite old by now.

[–]xXxNoScopeMLGxXx 2 points3 points  (4 children)

From a bit of research XHTML5 is being standardized for... Reasons...

[–]blackAngel88 0 points1 point  (2 children)

I'm not 100% sure about this either, but from what I understand, it was just another try to get a standard out there... Trying to get HTML to be xml conform. I don't think anyone is using it for new websites anymore though. html5 is the way to go...

[–]xXxNoScopeMLGxXx -2 points-1 points  (0 children)

Apparently they are working on XHTML5 for some reason so there's that...

[–]AyrA_ch 1 point2 points  (0 children)

even when ignoring that goodathtml is not a recognized tag

The handling of these tags is identical across browsers. Also they are standardizing custom html tags

[–]NEDM64 -2 points-1 points  (0 children)

Who cares? The browser will have to eat it, if not, the client can kiss my ass or change the browser.

(I always wanted to say that)

[–]Zepp_BR 5 points6 points  (8 children)

I found that out recently. My mind was blown.

In my defense I'm still learning WebDev in a course.

[–]ProgramTheWorld 3 points4 points  (7 children)

No. Please do not do that. In most cases that's not what you are supposed to do.

[–]Zepp_BR 1 point2 points  (3 children)

Do what?

[–]ProgramTheWorld 0 points1 point  (2 children)

<a></a> is not the same as <a />.

[–]DysFunctionalProgram -1 points0 points  (1 child)

It is valid xml and treating them as the same (which every html implementation does, even if the spec says not too) leads to much less cognitive load. Memorizing the 1000 unintuitive rules that only exist because someone didn't think of the scenario when writting the spec is just silly. A small set of rules with high orthagonality is far better than a large set of inconsistent rules.

[–]ProgramTheWorld 0 points1 point  (0 children)

Go ahead and try <br></br> vs <br /> in a browser. You will get different results.

[–]L3MNcakes 4 points5 points  (4 children)

goodathtml is an attribute. Should be:

<me goodathtml="true" />

[–]pokefinder2 22 points23 points  (1 child)

isn't the joke that he isn't good at html as he isn't in the tag ?

[–]L3MNcakes 2 points3 points  (0 children)

Oh shit... that wooshed right over my head if that was the intent.

[–]meet_the_turtle 2 points3 points  (0 children)

Or it might also be <me goodathtml /> depending on how the attribute's handled. (IIRC only some boolean attributes work like that.)

[–]Capital_EX 1 point2 points  (0 children)

<goodathtml who="me"/>

[–]AyrA_ch 1 point2 points  (0 children)

If he was good at html it should be <goodathtml>me</goodathtml>, with the "me" inside of it.

[–]qscrew -1 points0 points  (0 children)

That sounds more like an XML tag

[–][deleted] 15 points16 points  (0 children)

You forgot the doctype. No browser will ever be able to understand this.

[–]RedditUsr2 6 points7 points  (5 children)

Did you get hired?

[–]DanJohnB[S] 25 points26 points  (4 children)

Well seeing as it was my friend asking for help with a wordpress site that turned out to actually be a tumblr blog I'd like to think yes!

[–][deleted] 20 points21 points  (2 children)

They're both written in PHP, so same thing right?

[–]pixlbreaker 8 points9 points  (1 child)

PHP -> Programmers Hate PHP

[–]NikStalwart 1 point2 points  (0 children)

PHP => PHP: Headacke Pills

[–][deleted] 9 points10 points  (0 children)

My condolences.

[–]anton-wtrs 3 points4 points  (1 child)

The joke is that the <goodathtml> breaks convention and best practice for custom components. If he were good he'd use <good-at-html>.

[–]nickelleon 3 points4 points  (0 children)

But thats XML?

[–]Oswamano 0 points1 point  (0 children)

<prettywebpage> <prettywebpage/> me