News for hackers. Stuff that matters.
Re:We have used too many levels of abstractions and now the ... by josephg on Saturday October 21, 2023 @08:47AM (#37966389)
> they have never seen a dump of an HTTP message, headers and verbs are abstract things to them.

When I was teaching programming, I had a fun party trick whenever we got to HTTP. I'd fire up netcat (in listen mode), then connect from a web browser and "serve" a website by hand. I'd show the students the HTTP request that came in, and just manually type out a simple HTTP response and they'd see it appear live in the browser. Its pretty magical.

And once I'd shown them that, I'd write (by hand) an HTTP request to wikipedia or something to show them how its symmetrical.

Of course, real websites increasingly do HTTP2 over TLS or something. So unfortunately its not as "real" as it once was. But if wide eyed look on my students faces is anything to go by, it was a great lesson.

Re:We have used too many levels of abstractions and now the ... by fatnoah on Saturday October 21, 2023 @08:53AM (#37966427)
Not quite the same, but I remember sending emails via telnet. I showed that to a younger dev who was somewhat blown away by the fact it wasn't via some REST API.
Re:We have used too many levels of abstractions and now the ... by hotpotamus on Saturday October 21, 2023 @09:09AM (#37966533)
Yes, I actually remember another tech showing me how to type "get / http(whatever)" into telnet to check a browser and that is when a lot of things clicked into place. Basically it was the realization that computers are just sending text back and forth at blindingly fast speeds. Obviously I had some sense of what was going on before, but that was the demo that did it, and I had to learn it on the job because no one at school ever did that, which I find sort of backwards - school should be where you play with that sort of thing, but I suppose we all learn differently.

The email telnet thing was also a good learning experience. Gmail's servers are fun because you can see the designer's cute messages; if you forget your EHLO, they'll throw an error (or at least they did years ago) that it's polite to say hello first.

Re:We have used too many levels of abstractions and now the ... by user3939382 on Saturday October 21, 2023 @10:08AM (#37966893)
HELO
Re:We have used too many levels of abstractions and now the ... by Winsaucerer on Saturday October 21, 2023 @10:46AM (#37967211)
EHLO
Re:We have used too many levels of abstractions and now the ... by mathgeek on Saturday October 21, 2023 @10:34AM (#37967099)
When I was at Fog Creek, we still had that as an interview question (with googling allowed). It was a good judge of how most folks approached something they used but didn’t necessarily understand. If the applicant already knew how to do it, that was a different signal as well.
Re:We have used too many levels of abstractions and now the ... by sillysaurusx on Saturday October 21, 2023 @10:50AM (#37967248)
Think ChatGPT would be allowed nowadays? It’d be my source for something so esoteric. I haven’t bothered to learn mail protocols because any message you send will be marked as spam unless it’s from a major provider.
Re:We have used too many levels of abstractions and now the ... by raddan on Saturday October 21, 2023 @11:21AM (#37967537)
> any message you send will be marked as spam

This is not true. I run a mail server for myself and some friends. It started as an old desktop running under the desk at a university, transitioned to the back corner of a server room when I was working as a network engineer, and now it runs on a Raspberry Pi in a closet of my house. I had to pay extra to get a static IP at home, but everything has been off the shelf and DIY. My current Raspberry Pi has been running for nearly ten years, with only one interruption (the SD card failed). The idea that you can’t run your own mail server is a myth, and I think more people should do it. It is not hard, and you will learn a ton.

(I used to run mail for a large corporation, so yeah, I know a lot. But I learned how to do it by running a mail server out of my dorm room.)

Re:We have used too many levels of abstractions and now the ... by sillysaurusx on Saturday October 21, 2023 @11:42AM (#37967722)
Happy to hear that; thanks for correcting me. I was going off of what other people said, which I should have mentioned. It’s nice to know that it’s still possible to run a mail server.
Re:We have used too many levels of abstractions and now the ... by mathgeek on Saturday October 21, 2023 @12:30PM (#37968228)
No idea, but if it was available back then, we’d have been looking for whether you are critical about what it tells you and how you verified it was correct. That was a main idea behind the interview.
Re:We have used too many levels of abstractions and now the ... by brabel on Saturday October 21, 2023 @10:02AM (#37966851)
You can probably still do that by having a local proxy and communicate with it via good old HTTP/1.1 and let TLS and HTTP 2 and 3 be handled by the proxy.
Re:We have used too many levels of abstractions and now the ... by jsn on Saturday October 21, 2023 @10:25AM (#37967015)
You can just `openssl s_client en.wikipedia.org:443`.
Re:We have used too many levels of abstractions and now the ... by akavel on Saturday October 21, 2023 @11:56AM (#37967875)
This reminds me of when I was a kid, and learning to write some C to "create games". At that time, things like functions were some vague and "magical" mechanisms that I had to adhere to because that is how things are. I didn't even think more about them, taking them as "holy"; except only the one weird thing that were varargs functions, which seemed to do something strange and confusing, putting a disturbing crack into that perfect picture, that I had trouble wrapping my head around. It was only when this kid started learning assembly, by virtue of a book with an amazingly baiting title "How to write computer viruses", that things fell into place, and suddenly understanding the stack made everything clear and straightforward (if no less amazing, through appreciating the brilliant genius of the procedure call protocols!).

And indeed, the first time opening a POP3 session to an email provider through telnet was also an amazing feeling; maybe even more visceral thanks to its "live coding"/immediate feedback aspect; but personally just a small bit less foundational. So, anyway, through this whole story, what I really wanted to say is - thank you for your service and approaching your teacher's post in a great way!

Re:We have used too many levels of abstractions and now the ... by zeven7 on Saturday October 21, 2023 @12:32PM (#37968258)
Yeah I used to occasionally debug and test some things by writing manual HTTP requests over telnet, and it is something I’ve noticed new devs often just don’t get how approachable HTTP/1.1 is. Even if they have worked with headers and methods, there still seems to be a lot of magic happening in their minds.

Unfortunately chrome has stopped showing cookie headers in the network tab. You have to look somewhere else for those, and I think at that point you’re just seeing the current cookies, not the raw headers. Maybe there’s a security reason for that, but it is a further abstraction layer of “we’ll present the information a certain way” rather than “we’ll just show you all the information that the server sent back” that I expect will grow into other headers (maybe already has) and further remove us from seeing the raw details and having a clear understanding of what’s happening under the hood.

(You know it’s possible HTTP/3 cookies are even passed in a different way under the hood from other response headers, and that could be part of why they’ve separated them out. I hadn’t considered that possibility.)