<img src="catcute.jpg" width="500px" height="400px" ></img>
Width and height must be specified without units (although looks like browsers accept it, probably by ignoring the unit). IMG tags are self-closing, so you can omit </img> <img src="wool.jpg" width="500px" height="400px" ></img>
The dog picture has wrong aspect ratio. The dog is squeezed! It should be 620 × 349 or, if 500 width or 400 height is needed, there's a good mathematical task to calculate the size of the other side. <br/>
No need for / in HTML. unicorn.html
unicorncopy.html
Page for cats is named unicorn.html! and for computers it's unicorncopy!!!PS I don't like that CloudFlare Pages strips .html. Too magical.
Is this code review of HTML written by a 7 year old too hackernews, or just hackernews enough? Who can tell!
When the Trump assassination attempt happened last week and every single post on here was still about computers that's when I realized this place is different
That's why I come here instead of other places.
I wouldn't mind reading about it here in like 2 weeks to a month tbh, but clearly I don't come here to read 'worldly news'.
It’s not a secret HN is not a site for general news. That’s the first item in the guidelines:
https://news.ycombinator.com/newsguidelines.html
It is because you’d hear about that anywhere and everywhere else that it doesn’t belong here. Would you complain that a forum about cooking or sharing wallpapers didn’t cover the news as well?
Though it was submitted and discussed anyway, which always happens. That can be confirmed with your own keywords.
https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...
There do seem to be posts.
I’m not sure of the activity level of HN at the time it occurred.
https://hn.algolia.com/?dateRange=pastWeek&page=0&prefix=fal...
We need our safe space.
Isn’t that kind of on purpose though? I think you will get flagged if you just post general news articles. It looks like political posts are only accepted if they have some relation to technology.
Don’t 7 year olds deserve to learn how to improve too? The comment doesn’t appear to be done aggressively or in bad faith, so what’s the issue? Presumably it will be the parent who’ll read the comment, and they can pass it on or not depending on what they think the kid would prefer and/or would let them grow.
Ironically, I find the most HN comments of all to be the ones who complain about something being too HN.
Which is not to say your comment wasn’t humorous, but let’s not be too quick to cast stones.
Unsolicited critique is almost always unwelcome critique, in my experience. Especially where someone else's 7 year old is concerned.
Respectfully, if you see the comment as critique, that’s on you. It could just as easily be described as “unsolicited advice” or “unsolicited tips”.
The communicator does have responsibility on how their message comes across, thought not all of it. It’s on the receiver to also make an effort to understand what was meant and not take unnecessary offence. The comment reads pretty much neutral, apart from a post scriptum which is explicitly about the author’s preference. It’s up to you to inject the writer’s feelings as either “this code sucks, here’s how you do it” or “congratulations on making something cool, here are a few suggestions”.
My experience is that life is much better if you take the latter approach. Default to empathy.
Consider listening to “This is Water” from David From Wallace.
https://www.youtube.com/watch?v=eC7xzavzEKY
Let's agree to disagree. I most certainly didn't take offense. I just disagreed (and continue to disagree) with the (your) comment that I responded to. I'm sure the parent of the 7 year old in question was aware of the shortcomings of the code. The fact that a (presumed) grown-up read the post/thread and their reaction was to provide a code review is odd to me and more than a little hackernews-ish which the poster you responded to poked fun at and which you seemed to take exception to.
Yes.
I personally prefer having the /> even though it's not necessary, so that I can tell at-a-glance whether a tag is self-closing or not. It doesn't hurt, does it?
(plus I'm just used to it because the book I learned HTML from was confident that XHTML was the future)
I strongly believe that the harm we experienced from XHTML should not be passed down to future generations.
You didn't love the strict and unhelpful generic XML exception you got when you accidentally forgot to close a tag?
I thought the whole point of XML tags coming in named pairs was so you could be helpfully told which tag wasn't closed?
XHTML was a move by Big CMS to make edit-and-FTP error prone. Before that you rarely had to care whether the tag was closed.
Is this a joke? I genuinely can't tell.
Don't blame bad tools on the language.
I've always been completely baffled by the rejection of xhtml. It gave a way to extend html with new elements and a simple, powerful client side templating language with xslt. The "reason" for which I remember it being rejected was that allegedly web devs couldn't wrap their heads around closing tags and explicit attribute values, which seems crazy to me. Then a few years later typescript took off (which is way more complicated) and react gave a pretend way to write xml except now you need a compiler/build pipeline, and everyone loved it.
xhtml still works in modern browsers btw. It's still probably the easiest way to do page templates. XSLT shows its age without the ability to modify the page after load (unless you run it via javascript), but we could've just added that and it'd be almost perfect.
I reckon it does hurt, beyond the negligible cost of the extra transferred and parsed bytes: it teaches something that’s simply incorrect, and doesn’t do what people often think it does.
① The trailing slash doesn’t make a tag self-closing. All it does is get ignored, emitting a parse error (which in common compiler terms is just a warning) if you use it on a non-void tag.
You can’t use <div/>. You can’t use <custom-tag/>. The only tags you’re allowed to use the trailing slash on are the defined void tags like <img> and <br>.
It’s not “not necessary”, it’s “completely useless, by definition”.
I’ve seen people presume they can close tags this way. JSX probably helps cause this, because you can there. But because self-closing tags aren’t a thing in HTML syntax, I think it’s harmful to use the spelling at all in HTML syntax.
② I wouldn’t mind so much if people used it consistently, and I wouldn’t mind at all if it was being used to support both HTML and XML syntax, but if you see sites that use trailing slashes on void tags in their head, practically every time there will be at least one tag that isn’t using it:
③ I also dislike it because it’s fairly common for syntax highlighters or other casual parsers to get it wrong. Most commonly, I’ve seen tools misinterpret an unquoted last attribute, treating <a href=/example/> as <a href="/example" /> rather than <a href="/example/"> before. (Same with the likes of <img src=/example/>, but anchor hrefs are more commonly going to look like that.)IIRC, that's not necessarily true, some parsers "upgrade" html to xhtml and then process the xhtml since its more regular. html in general is a mess due to backwards compatibility requirements so trying to follow these kind of definitions imo is kinda pointless. you can optimize for size if you want but the decrease from these kind of optimizations with modern speeds is rather minimal
I have never heard of anything even vaguely matching your description, and it would be wildly wrong. HTML parsing is exhaustively defined, and the only way of correctly parsing HTML is to use the defined HTML parser.
The concept of "Connection Before Correction" emphasizes creating a positive relationship and safe learning environment before addressing mistakes.
Connection and Correction - pair programming
Connection before Correction - code review
Oh hey, I learnt a new thing today!
It always felt apt to offer a few words of praise for the things that are good, or to establish common ground in code review before offering constructive critique.
Wouldn’t call it a must, but makes putting one’s own ego aside when receiving critique that much easier and lets me focus on improvement, I try to do that for others as well now!
We talked about that, and she thought it looked better that way.
I agree.
And still with all of that it completely serves its purpose
The dog page should be banned in the EU because it doesn’t disclose that the picture has been digitally altered, promoting impossible beauty standards for pets.
Is this code review indicating a 7 year old will be put on a PIP?
While most of th 7 year olds contemporaries are busy consuming content instead of creating it like this?