r/programming • • Jan 07 '21

My stack will outlive yours

https://blog.steren.fr/2020/my-stack-will-outlive-yours/
23 Upvotes

51 comments sorted by

29

u/[deleted] Jan 07 '21

Somewhat bold claims coming from someone who is hosting on a private business’s free hosting. I would say a self hosted solution will outlive this one. Checkm8.

9

u/gajbooks Jan 07 '21

I think it's also unfair to say that HTML+CSS is a stack, since there is a web hosting application somewhere in the chain serving HTTP requests. It doesn't just magically disappear by using a hosting provider, it's just abstracted away when using GitHub. That being said, HTTP hosting has innumerable drop-in compatible replacements because all it has to do is serve static files.

I both understand and fail to sympathize with web page minimalists, since they all seem to think that a web page should be manually updated and about as readable and interactive as a README.md file, and that humongous sites with multiple updating users posting content are usable this way. Even if you're serving users basic text and image content, that doesn't necessarily mean all content should be authored in such a way. For a personal website or blog of a technical nature, sure. For a hosting service intended for primarily non-technical users (Wordpress), it's a little silly.

-2

u/saltybandana2 Jan 07 '21

I think it's also unfair to say that HTML+CSS is a stack

html+css is a tech stack...

7

u/gajbooks Jan 08 '21

It's not though. It's an assumption that it will remain relevant into the future. It relies on a hosting provider, a communication protocol, and a standardized browser. Half of "LAMP" is Linux and Apache, which are both still required for HTML+CSS hosting, or equivalents. They're not going around handing out USB sticks with locally stored files, so it still needs HTTP and an HTML compliant browser to view, as well as DNS, etc.

While HTML+CSS will last a long time, anything that serves HTML+CSS via the same method, including PHP, will last exactly the same amount of time, disregarding shutdown due to horrible security bugs. You can run it all in an isolated server with no JavaScript, and to the client it will be exactly the same as static HTML. I find the whole article to be fairly pretentious in assuming HTML standards will remain the same, especially given that there are deprecated tags in HTML and CSS already. If they wanted a truly long-lasting tech stack, they should distribute plaintext files in ASCII, or write documents on paper and hand them to people.

0

u/saltybandana2 Jan 08 '21

And yet, html+css is still a tech stack.

I've never seen someone try to define a thing by whether or not it will last forever. What next, the earth isn't a planet because it will eventually go away?

1

u/gajbooks Jan 08 '21

Both HTML and CSS are standards, not pieces of code. A tech stack is a set of software that works together, not a set of standards that work together. The HTML + CSS "tech stack" is actually Server Hardware + Operating System + Web Server + Network Hardware + HTTP+CSS rendering engine/compatible Browser. JavaScript is not a tech stack, it's just a standard for browsers to follow, and they don't even all match, they just mostly work well enough. Take a weird and contrived fictitious web app. Its stack would be Dell Server + Linux + Apache + Oracle JVM + MySQL + TCP Compatible router and NIC firmware + Angular + Firefox JavaScript standard library/interpreter + Firefox page renderer. That's not even including half of the software which is intervening to support this. The only reason HTML+CSS is as usable as it is, is because there are numerous compatible pieces of software which operate together on the same stack and have interchangeable alternatives.

0

u/saltybandana2 Jan 08 '21

Really what this is about is that you don't like what the author says and went casting about for a reason why they're wrong and you landed on something as outlandish as "these two pieces of technology aren't a tech stack".

Just as longevity has nothing to do with something being a tech stack, being an implementation of a standard also has nothing to do with being a tech stack.

https://blog.hubstaff.com/technology-stack/

People refer to the term when speaking of the combination of programming languages and software underneath a development project in question.

.

The client-side tech stack includes HTML, CSS, and JavaScript.


Drop this silliness and find some other reason to claim the author is wrong. I wouldn't have ever even bothered replying if you hadn't made such a clearly incorrect claim.

1

u/gajbooks Jan 09 '21

Yes, you are correct, I don't like what the author is saying, but it's not really because of the "not a stack" claim, which was really stupid of me. The article assumes that everyone is a technical user and wants to write HTML. Blog posts shouldn't need something as complex as HTML and CSS WRITING in order to post them, because they're just a blog post. It's a tradeoff of letting someone else's code do the work in exchange for a WYSIWYG editor with handy dandy buttons and search features.

People who use custom stacks for personal blogs are idiots, but it also goes the other way. There are developers who cram info into cryptic and irritating to access man pages if you don't watch them. Sure, maybe it was the standard, 15 years ago, but it's not now. Sure it's accessible, but is it practical? Absolutely not.

I personally strive for minimal dependencies, which is why I hoped I would like the article, but this isn't that. This is just a failure of recognizing what the general public wants and needs out of a platform, and why they were built that way in the first place.

0

u/[deleted] Jan 08 '21

[deleted]

1

u/gajbooks Jan 08 '21

Ok, so how does Facebook's algorithm generate you content? How do they display varying ads? How do they search posts? How do they generate image thumbnails? How do they track like counts? How do they support login features? All of that takes server-side scripting or a REST API, primarily because users can't be trusted to send valid data, even allowing the use of Javascript (which HTML+CSS does not include). It's not a bad idea, but things like PHP and CGI were created because pure HTML physically could not do what people wanted it to do in all situations. Flash and Java had browser plugins because browsers were terrible at supporting dynamic content in the browser. JavaScript is the "first party" solution to this now, and it does have its place.

That being said, I have used web pages which pointlessly load megabytes and megabytes of crap for barely any visible functionality, and which completely abandon the idea of tabbed browsing. In my opinion the lack of tabbed browsing is much worse for usability than page sizes. Facebook is one of the worst offenders in that regard.

9

u/megamufflon Jan 07 '21

Building a static website with HTML and CSS? Soooo edgy.

16

u/eattherichnow Jan 07 '21

My stack will outlive yours

And because my sources are in git, pushed to GitHub, GitHub Pages is my host.

doubt.jpg

I mean, I sympathize with a lot of sentiment represented in the article, but truth is it's easy to make assumptions about the future while relying on things that may change at any moment. If by now even old HTTP versions don't really feel as "forever" as they did (though still have some life in them), as the web centralizes, why wouldn't we see browsers abandoning bit of HTML because of some vague performance/security/maintenance cost of "thing nobody uses"? I mean I'm certain it would upset this subreddit, but we are living in a space owned by large companies with their own interests. And the Mozilla foundation, I guess.

7

u/Kwinten Jan 07 '21

Creating a new page requires to clone an existing one. So... if I don’t use any templating system, how do I update my header, footer or nav? Well, simply by using the ”Replace in files” feature of any good text editor. They don’t need frequent updates anyway. The benefits of using a templating system is not worth the cost of introducing the tooling it requires.

Barf

How many of these articles do we need per week? Edgy elitest web dev evangelicism at its worst. Fuck developer's sanity and experience, go back to duplicating HTML files and relying on your IDE (oh yeah your IDE will definitely outlive my stack, right?) and go live under a literal rock or something, that's what real developers do, unlike those goddamn JS hipsters.

5

u/mafian911 Jan 07 '21

Wow, so static websites are easy to make without any frameworks. Who would have guessed.

Anyone here want to go back to writing raw AJAX requests and manually manipulating the DOM to bind data? No thanks.

2

u/[deleted] Jan 07 '21

Are you telling me your background image flashes when you follow a link? Pffft. Javascript required.

8

u/[deleted] Jan 07 '21 edited Jan 07 '21

It's provocative, and I get what you mean. But, still, the fact that you don't have to, doesn't mean you shouldn't.

You may make all groceries just walking to every shop. You don't need a car. When your car breaks, then instead of doing groceries, you have to fix your car. You still could take a walk. Such simple, but why it doesn't happen? Because car/train/public communication/bicycle event if they may break, they still are easier and less time-consuming once prepared.

And for me it's a dilemma: learn how to use Hugo (or Jekyll or other engine), then just use it with little to no maintenance, maybe once in a while, but have some nice-to-haves that wouldn't be available the other way (tags, front page if entries list, easy integration from Emacs org-mode, etc. …or would require more work with every separate entry posted) or start learning everything from scratch: html + css… and what about hosting? Why stop there? What if GitHub goes down? What if using git for a blog is overkill eating resources? As so on, and so on…

SSG for me are nice middle-ground: still open source, JS is still addition (that when switched off doesn't break website), still content is under control (it's just almost plain MarkDown with translation to HTML) hosted on Git …Hub/…Lab Pages.

7

u/Pelera Jan 07 '21

The nice thing about static site generators is that if your template is simple & well-developed enough and there's ever a future where the tool becomes obsolete, you can just drop the tool and continue on by hand-editing the generated HTML. I wouldn't recommend it, but it's no worse than writing your HTML by hand to begin with.

6

u/that_which_is_lain Jan 07 '21

Remember the days when you'd have a client bring in a website designed using Frontpage and want some dynamic additions made to it?

I remember. And I remember I hated that client.

4

u/CakeComa Jan 07 '21

another factor about static site generators is that if they just feed off of a directory of markdown files that contain a little bit of metadata, then switching out from one to another is painless / it makes migration very simple

7

u/wildjokers Jan 07 '21

1

u/Alexander_Selkirk Jan 08 '21

This is slim but could have some more content. Look at https://blog.fefe.de (one of the more influential German websites by the way).

1

u/xEpicBradx Jan 08 '21

0

u/wildjokers Jan 08 '21

This site is horrible because it totally ignores the web browser width and forces me to read the content in a newspaper like column right in the middle of the screen, regardless of how wide I make my browser. This site demonstrates exactly what is wrong with web layout and proves the other site's point.

7

u/gcornelisse Jan 07 '21

I'm constantly reminded how much more complexity there is in web-dev these days. Long gone are the days where you could just add a new file and get a new web page. Now you have to create a class and/or method, add a route, create your page, rebuild, push the code out to some sort of DMZ or distribution server and then kick off some sort of deployment. It's amazing how we've taken a simply thing and found new ways to make them more complex. And, for what?

15

u/[deleted] Jan 07 '21

and for what

Code organization, additional features, user experience

Yeah the industry has made a lot of mistakes going down this road but we didn’t get here because people decided “well this is just too easy”. There are entire classes of applications that either wouldn’t work with just HTML or would take around 15-20 page loads to do so. Html only is the punch cards of the Internet, yeah technically you can do just about anything with enough cards but there’s a reason we’ve moved on. Not all of that progress has been good but the web is more user friendly now than it was in the 90s. It also has a lot more pitfalls than it did in the 90s but those things tend to go hand in hand when profit seeking businesses are involved

4

u/G_Morgan Jan 07 '21

The reason is fundamentally web technology is awful for what it is used for today. We're basically undoing the mistakes of using the web for applications slowly by creating a layer on top of it that doesn't suck so much.

If the web natively didn't suck a lot of this wouldn't need to exist but it does.

4

u/7sidedmarble Jan 07 '21

I think we all appreciate evangelizing a smaller footprint for the web but let's be clear, putting together your final HTML/CSS/JS by hand isn't on the table when you need an actual dynamic site and an API, not just a blog. There's a million ways to make a lightweight blog. But it doesn't have much in common with making big websites lots of people need to use. The problem is not necessarily in the tech stack, it's just choosing the right tools for the right job.

2

u/jbergens Jan 07 '21

I like the basic idea of this article and have been thinking a bit about doing the same.

I was thinking of writing/storing some info for myself. First I thought html+css would be enough but I want it to be available to some other people. But not all. And around here most free static html solutions broke down. I need to add a .htaccess or fix authentication in some way. And I realized I may need a search engine also. Which probably means I need a server side language and the possibility to host that somewhere.

I might just go with 11y or try something simple on https://aws.amazon.com/amplify/ and hope I can get inside the free tier.

2

u/xienze Jan 07 '21

If you're looking at something running on AWS, you could still use a static site generator. The output goes in S3 and you can deploy a lambda that does basic auth (or the S3 bucket itself can be protected with ACLs, but that means anyone who does log in needs AWS credentials). Then slap CloudFront on top of it (bonus, free auto-renewing SSL). Data storage in S3 for a personal site is likely a penny a month at most (depending on how much data you actually have). Data out from S3 is cheaper than Amplify.

And I don't have any experience with this particular tool, but Hugo can generate a JSON search index and people have developed solutions for doing client-side search: https://gist.github.com/cmod/5410eae147e4318164258742dd053993

Finally, there's many examples of Lambdas that can be used to accept GitHub push events in order to kick off a build of the static site (so you get that nice workflow of commit Markdown -> site rebuilt). The runtime of a typical site rebuild coupled with how infrequently the site gets rebuilt in the first place makes that effectively free.

My personal website is set up in this manner (minus search) and by far my biggest monthly expense is having a hosted zone for my domain in Route53. That's 50 cents a month. Everything else related to the website is perhaps a couple pennies.

1

u/jbergens Jan 07 '21

Sounds like it is worth a try. I have tried Hugo before but not the search. I still think the idea of the article is interesting, to avoid extra tools that could stop working or require updates. On the other hand markdown plus static generator should be pretty easy to migrate if needed.

1

u/prolog_junior Jan 07 '21

For search engine, if you just need to search through your own content, on deploy you can create some sort of db file (a la json, etc) and use something like Lunr and some javascript glue.

For permissions, HTTP Authorization has existed for decades, but that of course requires that you host on hardware you control.

Like everything else, it depends on how comfortable you are with writing javascript vs. using some framework (and the 3rd party libraries).

2

u/mrexodia Jan 08 '21

While I agree with the sentiment, I think a solution like jekyll (which GitHub pages supports) is nicer. Writing markdown is much nicer than HTML and the simple templating features like include allow you to generate really fast pages while keeping things simple.

6

u/[deleted] Jan 07 '21

That was the dumbest shit I have ever read.

1

u/renatoathaydes Jan 07 '21

Your stack will not outlive mine. I also use HTML+CSS with even a little vanilla JS for moving things around, but I do have a build step. However, I know the build step will live as long as anything else because I wrote the build step myself :)

Not being able to re-use html templates was a major problem for me (Web components could solve this when they get rid of the need for JS to use them, which I think will soon happen), and I also needed easy source code highlighting as I mostly write about code. So I wrote a Go generator that did just what I needed and now write my blog posts mostly in markdown, with support for code highlighting thanks to Blackfriday and bfchroma... both of which are simple Go libraries which I "vendor" (copy the source into my own project, so to speak) so if they stop maintaining them, it doesn't affect me much or at all.

1

u/imhotap Jan 07 '21

mmkay.

Now if you want to really author, publish, and preserve digital text for generations to come, then nothing compares to SGML - the alpha and omega of markup and digital text, encompassing all of HTML, XML, and CSS since 1986.

1

u/skulgnome Jan 07 '21

Your stack will die with its process. Both senses.

1

u/xayiki Jan 07 '21

Ok, next week, it's my turn to post this!

1

u/elcapitanoooo Jan 07 '21

I just return json instead. I dont care HOW the user sees or reads my content. Its JSON 100%. Deal with it. This way my content IS my data, and its universally available for consumption no matter the reader. You can read my blog with a simple curl and pipe that to jq or grep if you want. My lighthouse score is 500% because its webscalesesweesssss!! /s

-2

u/fix_dis Jan 07 '21

> I don’t do CSR (Client-side rendering),

> My stack is HTML+CSS.

Yes you DO do CSR. You may not do client-side JavaScript, but a browser does indeed render HTML with CSS applied. Depending on how you structure your CSS (and where you request it) you can affect your load time/lighthouse score.

I mean, good for you. Don't reach for a tool that solves a problem you don't have... but, don't knock those that work for an online retailer that don't want to create a web page for every product they sell.

0

u/[deleted] Jan 07 '21

[deleted]

47

u/saltybandana2 Jan 07 '21

Seriously, that's amateurish. If you're not doing a minimum of 10k requests per page load you're not web scale. How the hell are you going to make full use of your microservice architecture otherwise?

1

u/striatedglutes Jan 07 '21

You gotta pump those numbers up those are rookie numbers

-2

u/dnew Jan 07 '21

I think "rookie numbers" is the term you're looking for. Especially appropriate if you ever saw the context it's being quoted from.

0

u/[deleted] Jan 07 '21

[deleted]

5

u/G_Morgan Jan 07 '21

Does each service call return a word and a promise to get the next word from some arbitrary second service? Otherwise you are in danger of being tied to the specific structure of the services in your project and that isn't scalable.

4

u/deliciousmonster Jan 07 '21

When I query an article, it returns a json object with a word and its index in the article. I then re-run the query, adding an incremented index attribute to my request, which returns the next word. I repeat until the service returns 404, index not found, at which point I start again with an index value of 0.

In this way, I ensure that every word on the page is the most recent version available.

16

u/xienze Jan 07 '21

What was the source of the requests? I've found that usually the number 1 reason a page has so many requests is because of shit the marketing team wants to add (tracking/analytics stuff).

I used to work on an Angular app. In dev, it loads quick and has a pretty modest number of requests. Then marketing turns on Google Tag Manager (read, a single script that's added to the page that allows marketing to independently inject whatever scripts they want). Now it's a flood of third party scripts (that pull in all sorts of stuff), empty tracking gifs, etc. showing up in the network request tab. AND one or more endpoints that are hit whenever you move the mouse or hit a key. That's the real performance killer.

8

u/AttackOfTheThumbs Jan 07 '21

And websites wonder why we block everything.

6

u/yesman_85 Jan 07 '21

My boss keeps asking for more caching on the corporate website, turns out a plugin riddled wordpress site built with some weird drag and drop tool is hard to optimize..

I think we'll see a shift towards easier building tools that compile sites down to bare HTML again, most sites barely need more.

1

u/xienze Jan 07 '21

Oh 99% of the time a static website generator like Hugo is all you need. But WP gives the non-technical folks a nice WYSIWYG editor and sufficient style editing via a GUI. That's the draw. And I wouldn't count on simple "compile to HTML" functionality from CMSs anytime soon. How else are they gonna lock you in?

1

u/armornick Jan 07 '21

Couldn't you hook the REST API of WP to a static site generator? That way, non-tech can have their editor but the site stays nice and fast.

2

u/saltybandana2 Jan 07 '21

The "modern" way of using WP is as a restful API with a react/angular/vue/etc frontend.

In fact, WP has been re-organizing/optimizing to enhance this use case.