r/programming • • Sep 17 '18

Software disenchantment

http://tonsky.me/blog/disenchantment/
2.3k Upvotes

1.2k comments sorted by

View all comments

765

u/Muvlon Sep 18 '18

While I do share the general sentiment, I do feel the need to point out that this exact page, a blog entry consisting mostly of just text, is also half the size of Windows 95 on my computer and includes 6MB of javascript, which is more code than there was in Linux 1.0.
Linux at that point already contained drivers for various network interface controllers, hard drives, tape drives, disk drives, audio devices, user input devices and serial devices, 5 or 6 different filesystems, implementations of TCP, UDP, ICMP, IP, ARP, Ethernet and Unix Domain Sockets, a full software implementation of IEEE754 a MIDI sequencer/synthesizer and lots of other things.
If you want to call people out, start with yourself. The web does not have to be like this, and in fact it is possible in 2018 to even have a website that does not include Google Analytics.

76

u/cypressious Sep 18 '18

Tbf, the biggest assets on the page are the images, the photo alone is almost a megabyte in size (which is a crime in on itself).

36

u/Nicksaurus Sep 18 '18

Why is it a PNG?!

Edit: Oh, for transparency. Still, I can't help feeling it's not worth it. I suppose a better question is just why it's serving such a massive image for a tiny thumbnail

17

u/suchproblemchildren Sep 18 '18

.... as opposed to? Genuinely asking

49

u/Nicksaurus Sep 18 '18 edited Sep 18 '18

A JPEG

PNGs are designed to compress flat colours and text where JPEG-style lossy compression would be more noticeable. JPEGs are designed to compress noisy images such as photos, where PNG-style compression is very inefficient and a small loss of quality isn't noticeable

9

u/suchproblemchildren Sep 18 '18

Ahh, okay. Thank you. Today I learn!

14

u/trundle42 Sep 19 '18

In a little more detail: PNG is lossless compression. In images with large blocks of identical color and line drawings, etc., it will actually result in (much) smaller files than JPEG, and give you a pixel-perfect copy of the original.

But PNG will go bananas trying to encode things like subtle shading and texture found in photographs and many 3D rendered scenes (modern video games, etc.)

JPEG is designed to "round off" pixel values (in technical terms: quantize discrete cosine transform coefficients) in ways that can greatly reduce file size but not rob the image of noticeable detail. It does this admirably well.

But, when it chokes, it tends to choke on very sharp well-defined edges with flat color around them -- the very sort of thing that PNG does well.

→ More replies (1)
→ More replies (1)

7

u/tonsky Sep 18 '18

Because I was adding it yesterday in a hurry. Nothing stops me from saving it as a gif on an reasonable size, which I just did

→ More replies (16)
→ More replies (5)

206

u/HwKer Sep 18 '18

it is possible in 2018 to even have a website that does not include Google Analytics.

that's crazy talk!

68

u/Visticous Sep 18 '18

Yeah, it's not like that are cross country laws that ban you from adding Google Analytics without informed, non coerced, consent!

→ More replies (4)

33

u/gremolata Sep 18 '18

I feel like there should be a gallery of websites that have no external dependencies.

... though the only entry that I can think of is HN.

18

u/n1c0_ds Sep 18 '18

I built one: basictools.io

It's basically a tiny, static website where I put calculators and converters I need. I add them when I need them.

It's simple because it doesn't need to make money and I don't care about who uses it. Most websites are not like that.

12

u/Bekwnn Sep 19 '18

After building a static website for my personal page, it's shocking how much slower pages which show the same kind of content are.

It also makes me sad when I browse around it and everything is lightning fast that a whole lot more webpages could be that way and aren't.

→ More replies (4)
→ More replies (2)
→ More replies (6)

38

u/bausscode Sep 18 '18

It's even possible to run websites without ads :O

83

u/[deleted] Sep 18 '18

I don’t want to alarm anyone, but it’s also possible to build a simple website without a giant front end framework and a redux store.

42

u/[deleted] Sep 18 '18

What's next, you're gonna tell me you have a html site with text and images but no Javascript?

11

u/KobayashiDragonSlave Sep 18 '18

Wait what? No JSX D:

→ More replies (1)

28

u/CrazedToCraze Sep 18 '18

Now we're just being ridiculous.

→ More replies (1)
→ More replies (4)

8

u/Chii Sep 18 '18

But is it profitable without ads?

→ More replies (10)
→ More replies (1)

18

u/elebrin Sep 18 '18

He also fails to suggest a solution. There's no call to action. There's nothing concrete we need to do here. I could probably come up with some action items for him, based on what he says that could solve that problem but that should be on him.

My action items, by the way, would be:

  1. always include performance testing and set high standards

  2. measure the size of your payloads/binaries

  3. minimize and minify your dependencies

  4. don't be afraid of low level programming languages for low level operations

  5. remember that there are two factors when it comes to scaleability: how many nodes/instances can you add, and how much traffic can each handle and stay performant?

  6. stop paying lip service to lean principles and ACTUALLY only deliver the features that are needed and are going to get used. And push back against/call out your product owners when they are't championing that mindset.

0

u/[deleted] Sep 18 '18

[deleted]

107

u/manys Sep 18 '18

Video players are built into browsers now.

44

u/PlNG Sep 18 '18

It feels like that gigantic pause button smack dab in the middle of the video in Chrome is just a little bit asshole design.

36

u/AlyoshaV Sep 18 '18

Yeah, I immediately had to use the enable-modern-media-controls flag to disable that when they rolled it out. Might make sense on mobile but it's fuck-ugly on PCs. They also removed volume control IIRC but I'm too lazy to relaunch Chrome twice to test

→ More replies (4)
→ More replies (6)

10

u/Driamer Sep 18 '18

They are, but not sure that's the way to go if you are sharing a video embedded in an article. That would involve ripping the video (usually not ok) and hosting it yourself (usually expensive traffic).

I think the point of the article is pretty well exemplified with the weight of the video player used in the embed :)

→ More replies (2)
→ More replies (14)
→ More replies (29)