20 ms·
How to make websites that will require lots of your time and energy
- epolanski 1y agoOn one hand I agree, one should approach issues as they come, but there's solutions that are hard to ignore such as the need for reusable fragments/components on different pages which already make a cry for dependencies. Even admitting one wants to go with bare bone web components authoring and maintaining them is expensive, requires lit or something. Thus, what's the solution? Some sort of templating? Again, you're bringing on dependencies.
- DocTomoe 1y agoI think the emphasis is in 'indiscriminatly'. The goal is not to have absolutely zero dependencies, just don't depend on dependencies that you could reasonably implement yourself. A classical example might be https://www.npmjs.com/package/is-odd https://www.npmjs.com/package/is-odd
- Phemist 1y agoJavaScript's weak typing and implicit type conversions get in the way of reasonability though: >>> '13' % 2 0 >>> 'nan' % 2 NaN >>> NaN % 2 NaN >>> null % 2 0 this package ensures that you have a sane complement to is-odd, e.g. `!isOdd(someVar)` is always even (in the domain of natural numbers). A naive implementation of is-odd: `(some_var % 2 === 1)`, does not have a sane complement. Anyway, to include this package as a dependency is indeed overkill. I would most likely opt for vendoring this package into the project (including licenses and acknowledgement), as the code is unlikely to change and is MIT licensed.
- johannes1234321 1y agoThe question is: how likely is it that I get the trash input in and do I care about the result if the input is trash? Modulo two works well for a lot of cases where this is needed. (Which probably is size of a container (array) or alternating something in a loop.
- kome 1y ago> but there's solutions that are hard to ignore such as the need for reusable fragments/components on different pages which already make a cry for dependencies. honestly ctrl+c, ctrl+v of hand written html. and i'm cool as a cucumber.
- epolanski 1y agoBeen there, done that. You implement just a header navigation change, now you're copy pasting across 12 different files. But wait, now you want to add an active state to your navigation links, and you're manually changing the `class="active"` in 12 different files... I could go on, it doesn't scale beyond triviality, albeit LLMs do help speeding up.
- johnisgood 1y agoThat is why you can include a header.html, nav.html, and footer.html if you so wish! There are many ways to do this. :P Depends on your use case.
- nottorp 1y agoIf you don't go through two different ORMs - running on separate AWS VMs of course - and then to a third server that has the actual database, it's not professional.
- epolanski 1y agoAnd then you need a dependency to glue them together...And now you want to provide data..And now you want to put content in children. And you went from a simple nginx extension to again full blown software.
- johnisgood 1y agoI said it depends though. You could easily do this or some of it in an nginx config using OpenResty or nginx + Lua extension.
- 1y ago
- ghusto 1y ago> Thus, what's the solution? Some sort of templating? Again, you're bringing on dependencies. If your "dependency" is yourself because you wrote your own template for your specific needs, is that still a dependency? I wrote a templating solution for my own repeated sections and I'm so glad. It does exactly what I need, it's simple for me to understand if ever it grows large and I need a refresher, and easily expandable.
- aDyslecticCrow 1y agoPHP is actually a pretty good HTML preprocessor language. Not sure why it was blasted from this planet. Maybe because people abused it as a "rest" endpoint or backend, and burned themselves out from using the wrong tool for the job (even as php evolved to be pretty good backend for this too) A small amount of PHP as a templater for simple raw HTML and JS segments is pretty nice.
- fragmede 1y agoBecause debugging it is a nightmare. It's really awesome for what it's good at, but inline templating after a certain level of complexity is a recipe for madness. The problem is, projects start off small and un-complex, but by the time it gets too complicated, you're in too deep and porting it something else takes extra time.
- lelanthran 1y ago> On one hand I agree, one should approach issues as they come, but there's solutions that are hard to ignore such as the need for reusable fragments/components on different pages which already make a cry for dependencies. I side-stepped that completely, even on actual production web apps for clients, with this: https://github.com/lelanthran/ZjsComponent https://github.com/lelanthran/ZjsComponent Now, you may argue that that is a dependency, but it doesn't have any of its own, you can make a copy of it, serve it from your primary domain, and you're done.
- card_zero 1y agoI enjoyed the concept of "a complication step". Can't see the results of changes until my code has finished complicating.
- throw-qqqqq 1y agoHaha I’m not sure if the compilation/complication mixup was intentional, but it made me laugh :D
- Towaway69 1y agoAI hallucinations again ;)
- jimniels 1y agoAuthor here: I didn’t realize that misspelling until now. But I like it. Gonna leave it. Thanks for pointing it out ha!
- teddyh 1y agoThe medium is the massage.
- judge123 1y agoThe problem isn't the tool or the dependency—it's the developer's temptation to over-engineer. We grab a framework because we lack the discipline to keep something simple. Is self-control in coding just a lost art now?
- whstl 1y agoI have never seen this as the justification for using a framework. As a rationalization, sure, but never as the reason. They do offer more than coding standards.
- MOARDONGZPLZ 1y agoThis seems to me to be exactly what the post is about.
- johnisgood 1y agoI intentionally avoided using a framework mainly to keep my code simple, and because the framework was too inflexible and I could not achieve what I wanted to.
- cpursley 1y agoSo you then ended up building your own half baked of a … wait for it … framework, without even realizing it. Nothing wrong with that, it can be fun - just depends on if your goals are shipping or playing around.
- johnisgood 1y agoYes I did, but it serves only one purpose, it is not a general framework, and it is much more minimal. The "framework" is not intended to be used by anyone. The project is, but not as a dependency.
- kunley 1y agoCertain tools, or rather: ecosystems encourage overengineering and overhyping more than others.
- crinkly 1y agoWe are good at not even getting that far. Have a platform team and spent a month setting up CI, github repo, onboarding, writing terraform and stuff and not even get around to doing a web site in the first place!
- TheOtherHobbes 1y agoBut only after marketing, management, and other stakeholders have spent six months defining what the site should do and what it should look like, based on vibes and personal preferences. ("I like this one. Make it look like this.")
- sylware 1y agoGacha Web! Finally we have our web 3.0! ...
- bubblyworld 1y agoI don't see the value in posts like this. It's just a random list of things that can go wrong in software projects, with no discussion of trade-offs at all. Where's the engineering?
- MOARDONGZPLZ 1y agoBasically they’re saying implicitly to be principled about adopting frameworks and other dependencies, evaluating whether they’re needed for one’s project before adopting them. It’s a pretty thought provoking post, even if it may be too subtle for some folks.
- hiAndrewQuinn 1y agoWhat about the trade off of being principled in the first place? I was much more principled back when I refused to use any programming language that wasn't based off of the lambda calculus, and I also got a lot less done as a result.
- bubblyworld 1y agoNo need for the random snark? I mean, again, we're in extremely obvious territory here. Just doesn't seem appropriate for hacker news front-page (to me).
- brabel 1y agoYou don’t get to decide that, the people voting on HN do, they did and they disagree with you, just accept you can’t agree with a large set of people all the time.
- bubblyworld 1y agoAbsolutely, everybody gets their say here.
- fragmede 1y agoWhat makes their random snark any better than your original comment though? There was no need for you to come in and say that you don't see any value here. If you don't see any value here, just move on to the next post.
- jwpapi 1y agoIm pretty sure that most packages and frameworks break less than your own code…
- bravesoul2 1y agoI think the issue is API breakage. Does your 5 year old NextJS project still work after npm update? Probably not! What about your simple Go server or FastAPI server. Probably yes.
- victorbjorklund 1y agoSo don't run npm updates because sure then you have the security risks that you have some old code and that is five years old and hasn't been worked on for five years and you also have you missing out on new functions and optimizations. However if you have a five-year-old project that you handwritten everything by yourself you probably have a lot of security issues there too assuming that you are using complicated functions like you would have in Next.js. So then you would have to update a lot more than you would need to bring an old Next.js project up to date. You would need to rewrite all your code from scratch almost.
- bravesoul2 1y agoYes run updates of course. The question is how much of a headache you want. You can: Use Next.js (frequently changing lots of transitive deps, suffers from Node ecosystem churn too) Roll your own framework OR (FANFARE....) Use simpler arguably more professional tools. That 10 year old .NET MVC site. Guess what. Still works. Still secure.
- threetonesun 1y ago10 year old .NET is running on a Windows server that, I hope, you've done some security updates on. Having worked on most web facing stacks out there that might have been the worst one you could have picked as a "future proof" deployment, unless you're comparing them all as something you release once and then never touch again.
- pfoof 1y agoI host my blog using plain HTML and I have a compile step - a Python script that converts markdown to HTML, which minimizes the energy I spend on... wrapping everything in HTML tags?
- zwnow 1y agoIf you have a business website, customers expect a clean site with good visuals and a great user experience. Unless you are as big as Amazon. Sadly overengineering things is a necessary evil nowadays. If I had the choice I wouldn't even build websites mobile friendly but well... got no choice.
- blueflow 1y agoHey, customers are people too, and they can and will say "no", too. "good looking" doesn't do it when it cannot do basic things.
- zwnow 1y agoCustomers will use the thing that feels best, if there's a different tool that offers more but looks bad, most customers won't swap. People will use what they are accustomed to.
- lelanthran 1y ago> I host my blog using plain HTML and I have a compile step - a Python script that converts markdown to HTML, which minimizes the energy I spend on... wrapping everything in HTML tags? Same, except I skipped Python and went with bash (https://gist.github.com/lelanthran/2634fc2508c93a437ba5ca511fafa99d https://gist.github.com/lelanthran/2634fc2508c93a437ba5ca511... if you're curious). If I had to do it again, I'd go with Python, but because it started off as a small 5 line shell script I thought "Why bother with Python?".
- 5350-uiop-1130 1y agoworking at a certain faang made me realise even the most simplest trivial task can become endlessly complicated most of it from my observation is people justifying their own roles, where the real value they bring is arguable imo
- bapak 1y agoI'm the person who automates things. Before making things complicated, people would just copy paste crap from SO and hope it worked. Then came linters and everyone hates me. But you know the codebase is slightly less buggy/shitty thanks to them. The funniest thing to me is people thinking they don't need tests, linters, type checkers, because they're so good at it.
- rckt 1y agoThe post feels more like a rant, like the author has a beef with some sort of a project or a client. Even a static blog is easier to manage with tools rather than writing it in pure HTML. I have my personal website running on svelte. When I decided to have a blog, I quickly came up with a solution to use markdown to html converter and just added a couple of routes to existing setup and voila, the blog is up and running. I don't care that it depends on several packages. Publishing a post takes just a push to my repo.
- 1dom 1y agoYou're clearly a better person than the author then. They said at the start they were going on personal experience. I relate deeply to what they're saying: it's most definitely not a rant/beef against another project/client, it's most definitely the learnings of someone who's been producing personal websites for decades, has kicked themselves a few times in the process and can sarcastically poke fun at their journey in front of others.
- socalgal2 1y agoI have a personal web app that I wrote in react 16 with babel set up by createReactApp directly from the react docs. it’s been stuck with a list of features I want to add in my spare time but all 3 of those have bitrotted out so that in my minor spare time over the last 2 years or so, instead of being able to add some feature, I spend 2 to 3 hours trying to update it to the latest, fail, and no progress is made. my latest attempt was to see if one of the LLMs could do it. nope. I’ve thought about starting from scratch but don’t have the time
- rckt 1y agoYeah. The frontend world is a mess. I also faced similar issue with my personal website. Now I just keep my packages versions up to date and do any breaking changes updates as soon as possible. It's annoying, but it's better this way than having to re-write/refactor the whole thing every time.
- DecoySalamander 1y agoI think you will have a much better time if you generate a new, empty React project with Vite and just drop your existing components into it. I almost suggested not updating at all and keeping your dependencies as they are, but createReactApp was too much of a bloated mess even in its heyday.
- iamsanteri 1y agoI was expecting more like, "translate it into many languages your website users won't keep updating and give them access to edit your site's design freely as they see fit..."
- superasn 1y agoAlways use ORMs and then spend the next year debugging N+1 queries, bloated joins, and mysterious performance issues that only show up in prod. Migrations randomly fail, schema changes are a nightmare, and your team forgets how SQL works. ORMs promise to abstract the database but end up being just another layer you have to fight when things go wrong.
- tossandthrow 1y agoFunny, I use prisma and pothos, with p99 at below 50ms - no N+1 (when it is not lower, then it is because there are sec framework and other fields that might not be mapped directly do the prisma schema)
- porridgeraisin 1y agoDoesn't prisma do many sql features like distinct... In memory?
- dattasmasher 1y agoYes, but you can use the `nativeDistinct` preview feature rely on the DB to perform the operation. You can see the related issue with more info: https://github.com/prisma/prisma/issues/23846 https://github.com/prisma/prisma/issues/23846
- amonith 1y agoThat sounds plausible in theory, but I've been developing big ol' LOB apps for more than 10 years now and it happens very very sporadically. I mean bloated joins is maybe the most common, but never near enough bloated to be an actual problem. And schema changes and migrations? With ORMs those are a breeze, what are you're on about. It's like 80% of the reason why we want to use ORMs. A data type change or a typo would be immediately caught during compilation making refactoring super easy. It's like a free test of all queries in the entire system. I assume that we're talking about decent ORMs where schema is also managed in code and a statically typed language, otherwise what's the point. We're on .NET 8+ and using EF Core.
- anonzzzies 1y agoPro tip to get ahead and get all this and more for free: use nextjs and prisma. Guaranteed pain and misery; because they move fast and break things, you can look forward to weekly vunerabilities and breaking changes!
- shiggaz 1y agoYou forgot to add containers and self host (and configure the server)
- baobabKoodaa 1y agoYes, let's build our website as a completely static SPA and then deploy it on a self hosted Kubernetes cluster.
- donatj 1y agoI always get a kick out of the posts from the people in language communities who post "I'm new to <language>, what framework should I use?" It's like asking "I'm new to driving, what brand of nitros should I be using" Nah dude, get your sea legs first
- LanceH 1y agoDepends on the language. This one is pretty settled in Ruby.
- Towaway69 1y agoDepends on the context. I came from a ruby, nodejs, java, gawk background to Erlang (not elixir). The first question I posed to the Erlang community was exactly that: what are the build tools, what are the unit testing frameworks and how is a project setup. Not because I didn’t know what these tool/concepts did but because I wanted to know what is the state of the art in Erlang tooling. I have my sea legs, including the wooden one, but just not yet in Erlang. Why Erlang? Because it’s completely different to everything else!
- jb1991 1y agoIsn’t using something like the Google closure compiler considered a good thing? This post seems to suggest tools like that in your pipeline should be avoided.
- philipwhiuk 1y agoIf you want a reliable stack step 1 is don’t rely on Google
- donalhunt 1y agoAnything that allows visitors to submit data to the website. Abuse actors will show up sooner or later.
- victorbjorklund 1y agoHonestly, I don't agree with the mindset that frameworks and build steps should be avoided at all costs. Of course, you shouldn't pull in unnecessary NPM dependencies—that's just common sense. But using a compilation step or a framework can save you a lot of time and effort. For example, if you use a framework like Astro, you get a lot of functionality out of the box. If you try to do everything by hand, you end up copy-pasting the same header and footer into every HTML file. Then, when you want to update something, you have to manually change every single page. Trust me I been in that hell many years ago. Frameworks solve these problems efficiently. Sure, some frameworks can be overly complex (I'm personally not a fan of Next.js), but that's a problem with the specific framework, not the idea of using a framework at all. But many frameworks make things much simpler and let you avoid reinventing the wheel. You could write your own scripts (in practice a mini-framework) but eventually you'll hit limitations, especially as your project grows or you start working with others. At that point, you'll probably end up switching to an established framework anyway. If you're already using something like PHP with server-side rendering and templates, that's fine too—you've just chosen a different kind of framework (it is still some kind of framework. Just not a client-side one). I just don't buy into the idea that avoiding all build steps and frameworks is somehow more "pure." It feels a bit like a hipster take: "I'm going to write everything from scratch and avoid all tools just to show that I can."
- Bigpet 1y agoI don't think you're arguing against anything that was said in that post. There was never an "at all cost". The author was hedging even in the headlines ("indiscriminately", "before you know you need one" and "always, always").
- victorbjorklund 1y agoHave a hard time imagine when you would benefit from just html files (unless it is literally a one pager that will never change)
- Bigpet 1y ago
- october8140 1y agoReact-Native
- maelito 1y agoNot using a framework was one of the worst decisions that was taken in a former job.
- jokab 1y agoI work in one now. Somebody decided to write and maintain our own control suite and JS framework.
- deleted 1y ago[deleted]
- jeswin 1y ago> Always, Always Require a Compilation Step And from the linked post on the same website. > if you write vanilla HTML, CSS, and JS, all you have to do is put that code in a web browser and it runs. Very (very, very) few large projects use plain JS (instead of TS) these days. Let's stop acting like all these people don't know what they're doing. This post is probably applicable to selected tiny and small projects. And for some of those, it may be better if there was no JS at all.
- pwdisswordfishz 1y ago> Very (very, very) few large projects use plain JS (instead of TS) these days. Let's stop acting like all these people don't know what they're doing. There are much better arguments to use TypeScript than "five billion flies can't be wrong". Most other popular tech choices are in fact rather silly.
- xg15 1y agoOK, but that's essentially "argument by authority" + "everyone is doing it". They certainly have their reasons and they definitely aren't stupid, but it would be more useful to know what those reasons are and in what scope they are applicable.
- raincole 1y agoIt's better than the OP article. The OP article is "argument by I-says-so".
- jeswin 1y agoWhy types are good (even essential) for large projects has been documented quite extensively. Internet pushed JS to the forefront and as projects increased in scope and ambition, types became unavoidable. More recently, see how there's a strong push towards types in Python. AI/ML is to Python what the internet was for JS. And types are here.
- presentation 1y agoIt’s also mostly applicable to those inexperienced at web development, who write 99% of the posts and comments along these lines.
- timeon 1y agoYou serve html/js just like that? How about Docker here and there?
- pwdisswordfishz 1y agoPut a cryptocurrency miner on it; that will literally require lots of time and energy.
- dtj1123 1y agoIf you took this seriously you'd write everything in assembly to avoid dependancy on a language that will one day break. Picking a set of dependancies that are built on well reasoned, clean abstractions is a far better apporach than rolling your own solution to every problem you encounter.
- pstadler 1y agoI'm struggling to find any meaningful takeaway here. This post has zero value.
- nicman23 1y agoI like php and boostrap.
- fifticon 1y agoI have a good one(?): 1. be multiple developers on the same project. 2. for each developer, use your own tools and techniques, insist on only handling those parts of the site that you did with your tools, and insist on never fully understanding those remaining parts of the site the other devs did. This will allow for all sorts of fun, including: - A multiple inconsistent implementations of the same thing - B even better, those multiple inconsistent implementations affecting and breaking each other! One you have this going, there are some easy bonus pickings: Whenever B happens, "fix" it with weird extra incancations inside your own toolset, cleverly avoiding any attempt at (2) above. If you succeed at this, several developers can, combining these techniques to sabotage and trigger a veritable pinball game of strange breaking effects. Note: CSS is a great place to start this game!
- chilldsgn 1y agoomg. this is what it's currently like at work. and i was told not to bring up coding standards in retrospectives. yes, i am salty AF about this. i'm dying inside.
- npodbielski 1y agoThis is just work. No point in dying over this.
- anonzzzies 1y ago1. do all devops on the side and make sure everything is running complex multi az kubernetes clusters with as many aws buzzword services you managed to read when you asked gpt 'how super secure aws k8s for complex 900 node nextjs microservice setup thanks!'.
- sillycube 1y agoThis js dev trend is toxic. You must choose a framework that requires npm and compilation. Why can't we stay with the PHP way? Upload the code, refresh the page, and everything is updated.
- 1dom 1y agoI feel personally attacked. I love it. Here's some more: - People only visit your personal website knowing they can personally read, understand, audit and approve every single line of code that ever went into it. This means you don't really have a personal website unless you meticulously wrote every single line and every single change is clearly described and accessible on github (and sourcehut, and forgejo, and the rest. What sort of monster uses only Github nowadays?) - Remember to explain every single self-doubting existential thought that went into producing (or not producing) your website: people aren't there for objective, intellectual, educational tech content, they're probably more interested in self-deprecating metacognition.
- rpgbr 1y agoCase in point: https://news.ycombinator.com/item?id=44675053 https://news.ycombinator.com/item?id=44675053
- skinkestek 1y agoHow about spending a month (2 new devs to be fair) setting up Cucumber Selenium without anyone knowing what it will be used for ?
- rf15 1y agoAcquire as much vendor lock-in as possible - everyone pulling in all directions equally means that your position is going to be incredibly stable!
- deleted 1y ago[deleted]
- politelemon 1y agoRun it on nextjs with kubernetes.
- exiguus 1y agoA context is missing.
- burnt-resistor 1y agoBackend version: - Install a rolling release distro by hand - Install stuff without using packages or configuration management by hand without documenting them - Install stuff on bare metal without using containers or a hypervisor. Bonus points for unlabeled spaghetti patch cable rat's nest. - Don't automate deployment or upgrades - Don't have backups of anything - Don't have a plan for patching, DDoS mitigation, or DR/BCP
- lotyrin 1y agoBuy wildcard certificates from a vendor, install them everywhere you find you need them manually, don't write down where you put them or when they're going to expire. Cross your fingers the private key doesn't get leaked. Collect every metric possible and set up arbitrary blanket alerting thresholds and black-box anomaly detection and tune nothing ever. Now you can hire a whole team dedicated just to suffering from alert fatigue. Standardize on a single LTS OS release across all your infrastructure and wait until the absolute last possible second to start trying to switch to the new current LTS release, biting off about a decade of OS changes to everything everywhere all at once.
- jackdawipper 1y agoyea, I dumped react for nextjs, and then dumped nextjs for eleventy. never been happier.
- jay_kyburz 1y agonow go vanilla!
- DecoySalamander 1y agoYou didn't dump React, it's still there in your dependencies.
- jesse__ 1y ago> Always, Always Require a Compilation Step [...] as opposed to, say, writing code as it will be run I have a hard time believing that writing vanilla JS is superior to using a compiled language in any but very simple cases. Seems like bad advice to me.
- Rumudiez 1y agothe nuance of the statement lies in the first word, repeated for emphasis
- labrador 1y agoI think the author meant to say use as many build steps as possible
- austin-cheney 1y agoNode now executes TS directly without a build step. This includes TypeScript that only executes in the browser. Just import the given code file into your Node application and then send the output as a string: my_script.toString(); Boom, strongly typed code with no compile step that executes in both Node and the browser.
- brokegrammer 1y ago1. Dependencies break your project only if added unpinned. Most modern package managers will pin dependencies for you. Now, what if a dependency does break? Well, you can replace it with another dependency, or you can write one from scratch. Using dependencies allows you to save time earlier, and then only spend time writing your own libraries once you hit a roadblock. 2. Frameworks are similar to dependencies. They allow you to save time at the beginning of projects when you're not fully aware of your requirements, and then you're free to write from scratch when you have enough users and resources to do so. 3. Compilation is lightning fast these days because many tools are written in Rust. Projects built using Vite, for example, take a few seconds to build on a 10 year old laptop. To summarize, these things don't result in websites that will require a lot of time and energy to maintain.
- dominicrose 1y agoI fixed my 10 year-old webapp yesterday. There were only a couple of easy-to-fix issues. I could've fixed them without AI but AI does help speed things up. The problem is when looking at it 10 years later I want to rebuild it from scratch because the code and build system look so different than what we do now. I'm not sure yet if it will take a long time though, at least if I accept to keep jquery and avoid typescripting everything.
- brokegrammer 1y agoI could have built an web app in 2015 using C without any frameworks or build system. That doesn't mean I wouldn't want to rewrite it from scratch in 2025. Rewriting things from scratch is something that everyone wants to do as time passes, regardless of the tech stack used initially.
- teddyh 1y agoEvery pinned dependecy is a security vulnerability, sooner or later.
- brokegrammer 1y agoOnce a dependency turns into a security vulnerability, you can either replace it, or write your own library like I suggested. It's more cost effective and time efficient than writing your own libraries from scratch for every project. For example, I'd rather install React Router for routing in a React app instead of writing my own routing library. I guess some people will reply "grrr React, just use static HTML bro". Okay cool.
- deterministic 1y agoDon't use code generators to automate 90% of your code. Hand code everything, including the protocol encoders/decoders, dialogs etc. Use a framework that is brand new and full of shiny new bugs you can spend months of enjoyable time fixing, until the framework is dropped by the developer(s) and you can recode everything to the next new and full of shiny new bugs framework. Repeat infinitely. Also pick a shiny new programming language FooBar, to write both the server and client, that "really soon now!" will have all the libraries and bug fixes you need to use it in production. Spend time writing all the missing libraries and contributed it to the 5 other developers using the language. Spend hours complaining on HN that other developers are too stupid to realise the obvious benefits of rewriting everything in FooBar.