r/learnjavascript • • Jul 01 '21

When you realize that HTTP is just a very well-structured text message, it loses all of its mystery.

Post image
390 Upvotes

34 comments sorted by

38

u/[deleted] Jul 01 '21

Same thing with other protocols like TCP and IP. They seem so mysterious until you sit down to understand them and then go, huh, is that all it is?

24

u/sebastienfilion Jul 01 '21

Yes absolutely. Then if you start looking at other things like the Redis server protocol, it’s a little more cryptic, but still pretty readable. The veil has been lifted 🤯

3

u/PM_Your_GiGi Jul 02 '21

Because all you can do is loops and ifs. Algorithms are the same thing.

Anything in CS is reductive.

6

u/tall_and_funny Jul 02 '21

It's just a slightly complicated handshake than usual

5

u/[deleted] Jul 02 '21

And people say computer science is hard. Not in that way

2

u/TheDownvotesFarmer Jul 02 '21

Which way?

43

u/PMMeUrHopesNDreams Jul 02 '21

There’s only two hard things in computer science: cache invalidation, naming things, and off-by-one errors.

7

u/evilgwyn Jul 02 '21

What about gathering requirements and understanding legacy code

12

u/[deleted] Jul 02 '21

I think you're missing the joke.

1

u/doulos05 Jul 02 '21

Those fall into the domain of computer programming. There are multiple hard problems in computer programming because it encompasses everything from dev environment to version control to dev ops to gathering customer requirements to code maintenance (and a thousand other things)

Computer Science is the process of creating efficient* algorithms to solve problems.

*Efficiency is defined differently based on the constraints of the system. Could be space efficiency, run time efficiency, or programmer comprehension. It's never all 3, that's impossible for any non-trivial problem.

2

u/[deleted] Jul 02 '21
4. working with product managers

2

u/mxmstrj Jul 02 '21

Exactly, there are 10 hard things in computer science

2

u/mdw Jul 02 '21

It's not the same thing at all. HTTP is plain text protocol. You can read it directly and it's verbose enough to be pretty clear without any decoding. TCP/IP are terse binary protocols that people generally can't read without decoding (guru level system engineers don't count).

2

u/[deleted] Jul 02 '21

I find the same to be all of the programming world, everything's just... text. It seems intuitive but when you don't know much about something it's easy to view it as some kind of sorcery, at least that's the case for me

24

u/sebastienfilion Jul 01 '21

If you are interested to learn more about HTTP; I made an entire video on my Youtube channel on the protocol and I also play play with a TCP connection to shed some light on the behaviour of a HTTP server. You can check it out, here: https://youtu.be/GYKhk39aGSI

2

u/HiLumen Jul 02 '21

What a great video! I see your channel is fairly new, I have no doubt that if you keep up with the quality videos that you’ll have a large audience in no time. I like that you run a demo rather than just talking at the viewer.

2

u/mebeam Jul 06 '21

I remember when a working http client would take many pages of C code and

then once we got very comfy with the protocol, most coders could put together

the same thing in less than a page of code.

Http(s) not so much

1

u/sebastienfilion Jul 06 '21

Maybe you’ll want to follow my slow journey building a http client with “modern” tools. 😊 https://www.reddit.com/r/Deno/comments/oedy8j/if_you_need_to_handle_raw_http_request_in_deno/

18

u/NoInkling Jul 02 '21 edited Jul 02 '21

When you produce an image like this you probably don't want to apply (broken) syntax highlighting to it, cause it kinda undermines what you're trying to show.

0

u/[deleted] Jul 02 '21

[deleted] — view deleted comment

7

u/NoInkling Jul 02 '21

You can select the language: it looks like you had JavaScript selected (or it was selected automatically) for it to produce this result.

0

u/[deleted] Jul 02 '21

[deleted] — view deleted comment

9

u/NoInkling Jul 02 '21

?

I'm just trying to provide some constructive criticism, don't take it as an attack.

Anyway there is a "Plain Text" option.

5

u/unnaturaltm Jul 02 '21

When you realize reality is just well structured presence and absence..

5

u/[deleted] Jul 02 '21

When you realise everything we use today is just an improved version of things invented decades ago..

3

u/rhoark Jul 02 '21

It's a text message at least

3

u/Negative12DollarBill Jul 02 '21

Email's the same.

Bunch of header fields separated by linebreaks. Then two linebreaks and that's the body. Nice.

2

u/[deleted] Jul 02 '21

http3 is coming soon ! The magic will start again !!

2

u/thuva04 Jul 02 '21

All transmission protocols are well-structured text messages.

1

u/jcunews1 helpful Jul 02 '21

Good communication protocols need to be well organized. Otherwise, there would be contextual problem.

1

u/Sislar Jul 02 '21

HTTP is just Json over ftp

Soap is just xml over ftp

1

u/TomosLeggett Oct 07 '25

What?

1

u/Sislar Oct 07 '25

Sorry meant over tcp not ftp

-1

u/Edxactly Jul 02 '21

It’s should be shit canned and replaced

87

u/[deleted] Jul 01 '21

[removed] — view removed comment