TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

A Rant about Front-end Development

125 点作者 xlinux11 个月前

45 条评论

tazu11 个月前
This is the blog equivalent of fast-food. Sure, it&#x27;s technically &quot;food&quot;, and most people will agree with the content, but it&#x27;s essentially empty and does nothing good for your health (nothing to change things).<p>I would love to see a list of projects that do less of the front-end garbage. Someone mentioned the levels.io guy. I also like HTMX. Personally, I&#x27;ve seen great success using 95% server-side rendered sites with 5% Alpine JS sprinkled on top.
评论 #40746336 未加载
评论 #40746467 未加载
评论 #40746481 未加载
评论 #40746296 未加载
评论 #40746509 未加载
hliyan11 个月前
While I don&#x27;t agree with the tone of the author, I do have to admit, there seems to be something foundationally wrong with front-end development. Yes, it&#x27;s more complicated than server development in that it is a real-time, multi-point input, multi-output (rendered elements on screen) environment with synchronisation and concurrency needs.<p>But I used to write front end applications with MFC (Microsoft Foundation Classes, which is C++) using Visual Studio circa 2005, and it was never as complex as an SPA today. There is something wrong somewhere, and I don&#x27;t think it&#x27;s JavaScript or the DOM. The flaw seems to be paradigmatic.
评论 #40746337 未加载
评论 #40746390 未加载
评论 #40747915 未加载
评论 #40746423 未加载
评论 #40746574 未加载
surfingdino11 个月前
I was recently on a project where the backend was written in Python and finished in two months. The frontend guys are still dicking around with React components eight months after the project started. The front end on this project is child&#x27;s compared to the backend. It&#x27;s frustrating.<p>There was a point in the history of front-end dev when they all started calling themselves &quot;rock stars&quot; and became convinced that they are the future of software development. The SPA trend gave frontend devs an excuse to write unmaintainable code, gave designers an excuse to call themselves software developers, and then they all told the world they are doing &quot;full-stack development&quot; when Node appeared. Meanwhile they never bothered to learn pre-SPA UI, UX, or content design principles.<p>Thing is, working on front end never gives you a chance to work on problems that backend has to deal with. I never let JS guys work on backend code, because they are lost if they cannot find a module online that does what they are asked to do, or is missing half of the features from the spec it promised to implement (always the hard ones). We then have to pick up the mess and rewrite it in Python or Golang, which is wast of time and money. I once quit when when the client showed me the Python code written by a JS dev. My devs refused to touch that shit and we went to work for another client.
评论 #40752091 未加载
评论 #40747015 未加载
评论 #40748677 未加载
tflinton11 个月前
I literally left front end development because of stuff like this. It felt like insanity. Throwing out the door debuggers, linters, all the tooling so we could express objects as attributes?… and enforce managing state better?..<p>It felt like a flood of junior programmers in an echo chamber set off by an opportunistic engineers at Facebook who were more interested in creating their own job security then work to evolve an existing standard.<p>Seriously who honestly thinks that the authors and governing board of HTML and CSS didn’t closely consider the features in react?<p>What kind of arrogance does it take to say they’re fucking dumb let’s reinvent EVERY tool on front end because we know better.<p>But I digress…
ramesh3111 个月前
&gt;CSS is fine; you’re the problem<p>This one really gets me. Being looked at like an alien from mars when talking to people about styling a page with a few classes here and there rather than pulling in 6 different dependencies of Tailwind et. al is maddening. We are web developers. We get paid to know these things, not to complain about them being annoying and try to find hacky workarounds. And now I get to sift through your utility soup and hope to god there&#x27;s a class in whatever framework you GPT&#x27;d some boilerplate for that does exactly what the designer wants.
评论 #40746584 未加载
throw15675422811 个月前
Thank you. I&#x27;m at a css in js company and everything you wrote about it is The Truth. We&#x27;ve got nav menus written in reams of javascript. Stuff that could be done with zero js, or a couple of lines of glue. In a previous role I used Ant Design which were on the SASS train, trying to override the specificity of their stupidly long selectors was painful.<p>React is too loose, it just enforces no abstraction or discipline. JSX ends up an ugly nightmare of angle brackets, ampersands and question marks. You often have to piece together how the component works by staring at all the event handler code for minutes hours days. Most of my colleagues writing it would stare blankly if I mentioned MVC. I think I would come down on the side of Angular, it&#x27;s opinionated, but at least they attempted to separate the template from the controller, and logic in the services.
hardwaregeek11 个月前
There’s a lot I disagree with but I’ll point out one in particular.<p>&gt; how do we make content presentable as easily as possible, with as little duplication as possible, and with as few negative impacts to the user as possible.<p>Why is this the priority? If I wrote a language that was solely focused on removing duplicate code, and doing the minimum to appear decent, that would be a pretty bad language. I care a lot more about composability and readability than de-duplication and floor raising. Let’s face it. CSS comes from a fundamentally different situation than the modern web. I’m talking about optional styles that do not affect the content, that are written by one or two people, and likely total at most a few hundred lines. That is nowhere close to modern websites. Bemoan that all you like, it doesn’t change the reality.
评论 #40747478 未加载
tjpnz11 个月前
I fear that so much about what the web is has been forgotten. I&#x27;ve had some surreal discussions with frontend devs that don&#x27;t have a fully formed concept of what a URL is. Their solution to &quot;sharing&quot; is to either have their users instruct each other using words on how to find a particular page, or to propose some overengineered URL shortening scheme to encapsulate state which belongs on the path or query string. It really feels as though usability is being treated as an afterthought.
teaearlgraycold11 个月前
Most app’s code sucks but it’s honestly not the fault of React or styled components or server side rendering etc. It’s the fault of people treating front end like it’s easy and can have any old fool thrown at it. The truth is self-contained pages allow for more errors per line of code with fewer crashed sessions than a comparably bad backend with highly coupled modules. So hiring managers and bootcamps throw inexperienced devs at front ends until the tickets get closed.<p>I’ve been doing this as a hobby since 2003, writing all caps &lt;HEAD&gt; tags and FTPing .htm files to a web host. I know a bit about how we got here. If you’re really this pissed off you should get a new job and build everything how you want it. I’ve work on greenfield projects almost exclusively for my entire career. It can be done.
Erem11 个月前
I built a fairly successful vc funded startup with a front end lead that thought this way about frontend frameworks. For a suitably complex application what happens is that you end up organically building your own framework in order to manage the mess of application state that is the screen. Now in order to spin up, new engineers need to learn this unusual organic framework to get things done rather than just use the excellently documented React that they likely already know.
评论 #40746587 未加载
评论 #40754408 未加载
onion2k11 个月前
When I started building websites professionally (in 1998) we had an adage that people used all the time to talk about how to get traffic to your website: &quot;content is king!&quot; It was a play on the &quot;cash is king&quot; motto of small businesses I think. It was very accurate too; if you wanted traffic then you had to build a site people shared. Search engines were not as effective as they are today.<p>Then the web changed a bit. In 2005 to 2015 (ish) people transitioned from being consumers of web content to creators of that content. We called it &quot;Web 2.0&quot;. Content was still king because people went to their favorite sites to create things that other people would read. But anyone with half a brain could see what was coming next.<p>Around 2015 people stopped making content for other people to spend time consuming and instead shifted to making content that was seen for as little time as was necessary for them to hit a &#x27;like&#x27; button. &#x27;Content&#x27; in any meaningful sense died. It became a sentence on Twitter, or a photo on Instagram, or a really short video on TikTok.<p>The entire premise that users go to websites for the content is nostalgia. That side of the internet is effectively dead (despite some noble and awesome attempts to keep it going, HN being an example). Today very few people get paid to build static content sites. If you&#x27;re a web dev you&#x27;re paid to build an app that enables people to do things in a browser - and yes, that means working with something like React. All web devs try to crowbar React into everything simply because that&#x27;s what they&#x27;re paid to do, and they&#x27;re paid to do that because that&#x27;s what users want to do. Railing against it is a waste of time. The Internet today is not same as the Internet of 25 years ago.
评论 #40878822 未加载
评论 #40746556 未加载
评论 #40746871 未加载
smj-edison11 个月前
It seems he certainly hit a nerve here, regardless of people&#x27;s position on the subject...
shepherdjerred11 个月前
The problem isn&#x27;t React.<p>You can write a good website with React. You can write a good website with htmx. You can write a good website with HTML&#x2F;CSS&#x2F;vanilla JS.<p>The average developer who cares enough to learn and use htmx&#x2F;vanilla JS is going to write a superior product simply because they care more about performance and&#x2F;or because they are better than the average developer.<p>---<p>I&#x27;ll plug my favorite way to build a site: Astro [0]. It allows you to write JSX that compiles to static HTML. You can use React&#x2F;Vue&#x2F;whatever as well for anything that actually needs to be dynamic.<p>I&#x27;m not affiliated in any way, but I did build my personal site [1] with it.<p>[0]: <a href="https:&#x2F;&#x2F;astro.build" rel="nofollow">https:&#x2F;&#x2F;astro.build</a><p>[1]: <a href="https:&#x2F;&#x2F;sjer.red" rel="nofollow">https:&#x2F;&#x2F;sjer.red</a>
miffy90011 个月前
The entire article itself presents incredibly poor reasoning or no reasoning at all for its points.<p>It&#x27;s really hard to appreciate it now because CSS (along with JS+HTML) has been extended and upgraded gradually over the years, but CSS is incredibly good for styling and formatting DOCUMENTS - which have a very specific definition, especially back in the 90&#x27;s when it was first conceived. This is what is was originally designed for.<p>In that sense the complaints about CSS are perfectly reasonable: why are we using a document styling language for building arbitrarily sophisticated web applications when it was clearly not originally designed for that? You could say the same with HTML and JS really.<p>&gt; Quit acting like CSS is some giant-ass mistake that needs fixing. A group of people who were collectively smarter than us wrote those specs. They didn’t make mistakes. Assume you are making the mistake, not them.<p>So what year again was the CSS standard was first published? <i>Checks google quickly</i> -- oh it was back in...1996. HTML was...1991. And JavaScript in...1995.<p>Yes, it&#x27;s well known that people in the 1990&#x27;s were much smarter than people in the 2020&#x27;s! It&#x27;s not like there&#x27;s been decades of progress since then! CSS is utterly fit for purose and bereft of any flaw or defect! Absolutely nothing new needs to be invented or discovered about front-end web development in 2024! There&#x27;s no point in trying to improve things!<p>OK, it&#x27;s hilarious the author rails against things like SASS, and CSS is now being updated to incorporate many of the same features that SASS introduced:<p>- CSS nesting: <a href="https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;css-nesting-1&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;css-nesting-1&#x2F;</a><p>- Scoping (no more global): <a href="https:&#x2F;&#x2F;developer.chrome.com&#x2F;docs&#x2F;css-ui&#x2F;at-scope" rel="nofollow">https:&#x2F;&#x2F;developer.chrome.com&#x2F;docs&#x2F;css-ui&#x2F;at-scope</a><p>- Not to mention things like CSS variables, calc() etc.<p>Usually people whine about the status quo or things staying the same for too long and in response, try to improve things. This article almost seems like a big whinge about how things should stop changing and regress or go back in time? That&#x27;s not happening. If people had the author&#x27;s sensibilities or attitude back in the 2000&#x27;s we&#x27;d never move past `float: left` for positioning or tables for multi-columnar layouts. Utterly bizarre.
renewiltord11 个月前
The thing about software is that you can always just write better software. The levels.io guy makes $2m&#x2F;yr just being better by being simpler.<p>So it&#x27;s possible. What&#x27;s the point of a rant without the code to back it.
评论 #40746249 未加载
评论 #40746356 未加载
kristopolous11 个月前
I had been programming for about 30 years, I loved it and was excited by it. After work I would go home and work on side projects.<p>React single-handily killed it. It encouraged, usually required, all of the awful design patterns I used to chase all the junior engineers and interns about. This has become endemic in the JS world.<p>Here&#x27;s an example: did you know that the uuid npm used Math.random up through 2020 (v.7)? Cryptographically secure random number generation had been available in basically all browsers since 2011. 9 years. If I had an engineer submit that code, I&#x27;d rake them over the coals.<p>Speaking of that, I&#x27;d usually need a half-time engineer on larger projects <i>just for the management of the complexity</i>. All of the various frameworks and updates and breaking changes. It was a 20&#x2F;hour a week job just to stay on top of things. For instance, koajs.<p>It&#x27;s a bunch of dependency code of quality I would never let fly, but now I have to use it and grow my team, increase budget, push back deadlines - all to manage the piles. No thanks.<p>I left that job, quit the industry entirely about 2 1&#x2F;2 years ago. Reactjs was such atrocious self-aggrandizing bullshit, it made me quit programming. It&#x27;s fragile, over-engineered, mostly broken, confused poorly defined amorphous concepts that poorly solve mostly imagined problems and the entire industry of front-end is eating up that mode of design like it&#x27;s some sacred text.<p>They&#x27;ll use abstract buzzword concepts that have different conflicting definitions in basically every text you pick up, and they&#x27;ll never concretely define them but continue to use them as abstract amorphous blobs.<p>I&#x27;ve got very popular front-end projects. I&#x27;ve been at the C-level of more than one company that sold based on front-end design. The first professional javascript based web app I did was in 1997. I deployed Server Side JavaScript (SSJS)&#x2F;LiveWire in the 90s, a decade before Node ever existed. I&#x27;ve been at this for a long, long time.<p>After dealing with react, I never want to touch that stuff again.
评论 #40746402 未加载
评论 #40750783 未加载
评论 #40746533 未加载
评论 #40746437 未加载
评论 #40746570 未加载
STRiDEX11 个月前
I have to do &quot;real&quot; ssr every once in a while via the django jinja html files we have to send emails. It makes me want to die coming from our nice typescript react SPA frontend. Every object is a mystery and jinja syntax is functional but terrible to maintain and of course you&#x27;re suddenly using tables because it&#x27;s an email.<p>I&#x27;d rather every element be a div than do one minute of editing those stupid jinja files.
评论 #40746354 未加载
评论 #40746364 未加载
评论 #40746410 未加载
Too11 个月前
This rant is missing the WHY in every section. While it has some valid points, it will unfortunately only satisfy those who are already in the same boat.<p>The rest of us will keep wondering why he implicitly assumes that backend generated with js is sooo much worse than if was generated with anything else. I&#x27;ve also written my fair share of PHP before AJAX was even a word, plus lots of ASP.NET, Java and Python backends. Honestly, their templating languages all suck, compared to React components that are type safe and infinitely easier to compose and refactor (jinja anyone?). While their languages and ecosystems are a lot more powerful, JS these days isn&#x27;t that terrible as a language, just keep a tight grip on your package.json.<p>It is correct that there is something wrong with the culture of the front-end development, in that there seem to be no brakes on just piling crap on the next shiny thing and then building even more packages and abstractions around it, instead of fixing the underlying crap in the first place.
rado11 个月前
He is right to rant about semantic HTML being replaced by framework div soup. It&#x27;s awful for accessibility etc.
mmcnl11 个月前
Ranting is easy. It&#x27;s nice to vent once in a while, but then what? All that remains is that the author is fed up with tools that don&#x27;t solve his problems. Ok?<p>The key difference between the web and any other type of development, is that you can distribute almost any type of application with the push of a button to billions of people, without the need to install anything. This is a superpower which _ofcourse_ comes with some complexity. Sometimes when you don&#x27;t need that superpower and you have to navigate the complexity anyways it will be a frustrating experience, but that doesn&#x27;t mean there is something fundamentally wrong or anything.
csomar11 个月前
The author makes a few good points but on average sounds like an old man complaining about everything. There is a reason React took off, and there is a reason people choose React.<p>Sure, if you are building a simple content heavy front-end, it doesn&#x27;t make sense to chose a React framework or React at all. But many apps today come with heavy front-end interactions and have to sync with their back-end in real time. Good luck doing that with jQuery Ajax.<p>And you can&#x27;t blame the bootcampers. They were promised riches after a 6 months bootcamp. They were taught React and had little interactions with HTML. So they are doing what anyone else in their position will have done. So when they were out in the market, then React is was. Suddenly, everything became a React component; and if you made a website today, you&#x27;d better off start with React.<p>In defense of React&#x2F;NextJs: I have been blogging for 10+ years. I started by using WordPress. I have constantly failed to maintain a server up and running for more than a year. There is always something that comes up. A bad WordPress update, DB goes wrong, a failed payment, a bad WordPress plugin update, Server goes down because?, etc...<p>5 years ago, I switched to NextJS. It&#x27;s a spaghetti of NPM modules just to build a very static website for very simple content. Sure. But 5 years later, the very same site is still up. There is no maintenance involved as the site is hosted in Github. Not sure I&#x27;d say the same about WordPress.
评论 #40746696 未加载
评论 #40746906 未加载
评论 #40751686 未加载
nojvek11 个月前
For more than a decade, worked with many large Single page applications (SPAs) across startups and large companies.<p>He has some good points regarding SASS. Other bits were about ranting.<p>The issue with frontend dev is there is a gajillion bootcamps promoting it so we have a bell curve weighted heavily weighted towards juniors.<p>Add in browser compatibility issues, framework churn and other headaches, there are fewer highly experienced FE devs who understand the browser in a deep way.<p>FE code also tends to be highly stateful. Managing state well is one of the harder FE problems that few folks talk about.<p>Add in the mix that some are apps and some are websites. There is no one right answer.
sebazzz11 个月前
If you want to reduce maintenance costs, reduce the amount of Javascript code and tooling.<p>NPM-Javascript is a shitshow of constant breaking changes left and right, whether it is in your runtime framework, or your build system like gulp or more prominently webpack.<p>Try maintaining 10 projects with these frameworks. You&#x27;ll quickly look for something that is not as maintenance intensive.<p>Example: No, you can&#x27;t stay on Webpack version X, because (real example) it turned out that version of webpack relied on md5 which wouldn&#x27;t work in newer node.js versions.
jamil711 个月前
Maybe it’s time the author started doing something other than frontend dev?
noduerme11 个月前
Arguably, for SPAs it doesn&#x27;t matter what tags you use at all. Whatever you do is going to be inaccessible. Make everything a div. Who cares? We used to write all the UI components ourselves in Flash or Java.<p>Sure, yes, understand the content that you&#x27;re writing your UI around, and make the UI serve the content. That just begs the question of why one would get anal about which HTML5 tags are used for headers or navs or buttons.
koonsolo11 个月前
Here is the main problem: front-end can mean &quot;blog&quot; on one end, and &quot;photoshop replacement&quot; on another.
评论 #40750904 未加载
nate-sys11 个月前
difficult to believe that many are disagreeing in the comments. this is really one of the better &quot;rant&quot; posts.
acosmism11 个月前
i cant count the number of times i&#x27;ve had to generate boilerplate + interfaces etc etc for something that would be as simple as an onclick (onClick?) handler would have done. i have yet to actualize the serious promises of this ecosystem in any meaningful way and it doesn&#x27;t seem to get better. also jsx is ugly.
评论 #40746440 未加载
aaronbrethorst11 个月前
I agree with a lot of this rant, but life is too short to care about `&lt;section&gt;`, `&lt;header&gt;`, and most other tags. If your content is highly legible to users—especially if they use assistive technologies—then it simply should not matter. The CSS Zen Garden is dead and it&#x27;s time to till it and start over.
评论 #40746483 未加载
评论 #40746693 未加载
评论 #40746304 未加载
评论 #40746269 未加载
评论 #40746375 未加载
评论 #40746280 未加载
joseferben11 个月前
i mostly agree with the rant, except for styling, i think tailwind is great.<p>nowadays i default to htmx, alpine, sqlite and typescript, recently i’ve been working on a framework&#x2F;starter using these tools: <a href="https:&#x2F;&#x2F;www.plainweb.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.plainweb.dev&#x2F;</a>
throwaway4good11 个月前
What a silly rant. There is a huge world of different approaches to front-end and lots of them do cool and interesting things that would both up your productivity and give you completely new opportunities ... if you bothered instead of just being an old fart.
评论 #40746580 未加载
darepublic11 个月前
I just want to say I like pre-rendering &gt; server side. Because you get a lot of performance benefits while still writing in a client side style. It is a low hanging fruit though I suppose a combination with ssr would be better.
bartimus11 个月前
I agree with many things. But:<p>&gt; Maybe it’s because Angular was no one’s first choice — even though it came first.<p>Actually ExtJS was the first real framework. Angular was just one of the new kids on the block.
Arainach11 个月前
This article could use a LOT of source links. Not because I believe points are wrong, but because if the author wants to rant that no one knows&#x2F;has heard of things, why would anyone know what they&#x27;re talking about?<p>&gt;The number of times I’ve seen numbers written inside of a &lt;li&gt; that’s inside of a &lt;ul&gt; — instead of just using an &lt;ol&gt; — is deeply disturbing.<p>I&#x27;ve been reading and writing HTML since the 90s and off the top of my head can&#x27;t recall ever seeing &lt;ol&gt;. Why is it better? For screen readers? A sentence to illustrate goes a long way.
评论 #40746361 未加载
评论 #40746313 未加载
评论 #40746262 未加载
评论 #40746346 未加载
评论 #40746558 未加载
评论 #40746427 未加载
tobyhinloopen11 个月前
I’m with OP but we’re a rare breed.
bottlepalm11 个月前
Yea I&#x27;ve been coding every framework under the sun since the 90s and I&#x27;m pretty happy with Next.js at the moment. It can render on the server and re-render on the client with the same framework, same language, same functions. Statically typed server to client and back to server. JSX&#x2F;TSX has no strange template syntax and again static type checking. Compiling automatically tree shakes, bundles, code splits per route. I can do SSG, SSR, CSR, ISR. I can specify per route&#x2F;api caching strategies. I can host serverless or self host. I&#x27;m knocking websites out left and right.<p>It feels like I&#x27;m building a single application not two separate frontend&#x2F;backend applications; managing overhead rendering and communicating between them. Next.js, Nuxt, Remix, SvelteKit - are all part of this next generation batteries included frameworks that can seamlessly transition from server side rendering to client side interactivity.<p><pre><code> $(&#x27;.getResults&#x27;).on(&#x27;click&#x27;, () =&gt; { $.ajax({ url: &#x27;&#x2F;api&#x2F;results&#x27;, data: { foo: &#x27;bar&#x27; }, success: function (result) { $(&#x27;.results&#x27;).html(result); } }); }); </code></pre> I mean look at this unmanageable bug prone code from the blog post. Nothing here is safe, no way to validate the classes where the data is coming from&#x2F;going to. No validation of the api or its parameters. If you scaled this example you&#x27;d end up with nightmare level code. Yea I&#x27;ve been there already, I&#x27;m not going back.
评论 #40746484 未加载
tflinton11 个月前
Why didn’t he mentioned rewriting or adding to browser history?!
dmalik11 个月前
I agree with some of what the author is saying but add about 10 years of experience. Been coding sites since I was a kid in the mid 90s (I was a web master). I have 10 years working on brochure sites but have spent the last 10 working on major SaaS.<p>Few things I disagree with:<p>- The content rant was weird. I&#x27;ve always worked with content designers, instructional designers, or good marketing copy people. Was that about semantics? Sure ya, SEO and a11y.<p>- Cascading CSS is great until you write a million+ line SaaS app and have 1000 devs working on the code. Then you need scope. The rant is specific to brochure sites.<p>- SSR. Weird. Do devs really think that? I guess I&#x27;m out of touch or my colleagues are better than most.<p>- A lot of rants seem to be ripping of jr devs. Show them the way! Very yells at cloud.<p>- CSS nesting I really like. Example of nesting elements inside a class is a hack that should not be done. Nesting is easier to read if done properly.
est11 个月前
SPA shouldn&#x27;t be used for content heavy web pages anyway. SPAs today especially React were basically like Facebook&#x27;s engineers decided to write js&#x2F;css&#x2F;html in the style of php.
robertoandred11 个月前
Yawn, another case of “new is bad because I don’t understand it.” Being nostalgic for jQuery? Really?
andreyvit11 个月前
Here’s practical experience from me running the tech side of a startup while sharing the author’s values.<p>Server-side rendering (the normal kind from 1990s):<p>1. It is glorious. Everything that 37signals has to say about it is true.<p>2. However. I really miss React-style components as an abstraction. There are many ways around it that we use depending on the case (plain CSS classes, our own tiny Go&#x2F;HTML component library, HTML custom tags), but we’re yet to produce something as ergonomic for more complex compositions.<p>3. We’ve added Hotwired Turbo for smoother page updates. I find it’s a lot more orderly than htmx, but we do miss some things that htmx would offer.<p>CSS:<p>1. We started out with just plain CSS, using BEM and CUBE to structure it and manage complexity.<p>2. That still got us questioning the DIY nature of the U (utilities) part of CUBE — it got increasingly complex and random, and really just like every program grows a broken LISP interpreter inside, every custom CSS utilities library grows a broken copy of Tailwind inside. So we adopted the actual Tailwind for utilities. Tailwind is truly glorious, both for sheer productivity of writing the code, but also as a language for describing styling at just the right amount of detail — more powerful than CSS properties alone (hover:color-red-700, disabled:cursor-default), but more constrained than full CSS.<p>3. Tailwind introduces a build step, though, which sucks (and slows down the build by the whole second! My m2 Air can probably do a 60s supercomputer-level nuclear explosion simulation during that time.) Thankfully, part of our startup is doing custom themes for each client, for which actual Tailwind sucks even more (themes are edited at runtime, and you wouldn’t want to run actual Tailwind with its million Node dependencies on your server), so we’ve implemented a subset of Tailwind in Go, just the things we actually used, and it runs at runtime, eliminating any build steps for themes.<p>4. Bottom line: Tailwind is absolutely glorious as a shared design vocabulary. Non-tech people were able to adopt it and handle theming thanks to it. The actual implementation of Tailwind seems unacceptably slow, but I hear a Rust compiler is coming.<p>JavaScript:<p>1. Plain old JavaScript is great, but needs some structure. We found that structure in Hotwired Stimulus, which we absolutely love.<p>2. But again, I do feel the desire for React-style rendering occasionally. We embed our widgets on customers’ e-commerce sites, and a chunk of HTML rendered based purely on data coming from an API with live updates is a perfect case for React.<p>3. Needless to say, running code on other people’s e-commerce sites is where I would never dare use a React-based stack, because I’d spend the rest of my life doing due diligence on the dependencies. (Our competitors are much less responsible about this, and it works out for them too, so this is more of a principles thing.)<p>4. This is probably the case where an in-house 500-line implementation of React-style rendering would be preferable to anything else. We already have a 100-line version, but it lacks many desirable features.<p>Bottom line: Yes, you can (and should) run a modern startup based on a pragmatic server-side rendered stack, but you definitely want to add just a few modern things: something like Hotwired, something like Tailwind, some solution for more powerful components in your templates, and something like Preact for certain use cases.
brigadier13211 个月前
I hate this style of writing.
评论 #40746448 未加载
评论 #40746389 未加载
评论 #40746369 未加载
t1c11 个月前
This screams &quot;old man yells at cloud&quot;. Boo hoo, someone used an unordered list for numbered content? Who cares.
评论 #40746363 未加载
评论 #40746372 未加载
graftak11 个月前
In 2001 the EU switched (mostly) from a local currency to the euro. For years people would calculate prices back to the currency of old. If you do it nowadays, over 2 decades later, people look at you funny.<p>People who still rant about the simplicity of jQuery are of the same cloth.
评论 #40746728 未加载
lmm11 个月前
Wow, I think this is the first time I&#x27;ve seen a page be wrong about so many things at once. No, the difference between header and section or p and div is not important (after you started off so promisingly by saying that content is what&#x27;s important - the difference between a p and a div is not content). No, CSS really is the problem. No, you can&#x27;t actually do server-side rendering in a different technology stack if you want the term &quot;rendering&quot; to mean anything (as much as semantic arguments are pointless in any case). Yes, JavaScript is actually the least-bad solution to every problem in web space; it&#x27;s not ideal but it&#x27;s a proper programming language that isn&#x27;t completely nutso (just mostly nutso), which is more than you can say about CSS or HTML.<p>If you actually want your life to be simpler, use React for everything, like everyone else. Stop worrying about how many dependencies you have and wasting your time reimplementing them worse.
评论 #40746408 未加载
评论 #40746436 未加载
评论 #40746541 未加载
评论 #40746446 未加载