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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: Why web frameworks are becoming so complex?

33 点作者 mr_nobody超过 9 年前
A little about me: I am web-developer with almost 10 years of experience. I&#x27;ve spent lots of time in my life learning about design patterns, frameworks, and going through hundreds of programming blogs. I work mostly with quite big business apps (crm&#x27;s, intranets) but also big frontend websites.<p>Since I started working as developer I can see that every year majority of leading frameworks (at least in PHP, Javascript, Ruby...) for web applications are becoming more and more complex. Instead of writing code in programing language we move into xml&#x2F;yaml direction and hundreds of weird config files. Each frameworks use different syntax for config, often different templating languages, few layers of abstraction with a lot of magic behind the scene, Dependency Injections, ORM&#x27;S, CRUD generators with supposed to make our life easier actually are painful to use...<p>Even small website often requires hundreds of megabytes of dependencies. Sometimes one application can have 2 different build systems e.g. (ant, grunt) and few dependency managers...<p>Micro&#x2F;nano services trend looks optimistic, but I am not sure if it&#x27;s not double-edged sword, and instead of using complex frameworks developer will be forced to use complex communication system to orchestrate communication between them.<p>In few years instead of writing code are we going to write configs files?

15 条评论

cnp超过 9 年前
The answer is simple: Web Applications are becoming <i>Applications</i> in the traditional sense of the word -- and Applications have <i>always</i> been complex. Now we&#x27;re just moving that complexity on to the web.<p>But that said, the Webpack + React + Flux model is the simplest kind of programming I&#x27;ve done in a very long while.
评论 #10107436 未加载
krapp超过 9 年前
&gt;Instead of writing code in programing language we move into xml&#x2F;yaml direction and hundreds of weird config files.<p>Blame this partially on the weird phenomenon of programmers refusing to touch languages they consider aesthetically ugly. Javascript? CSS? Ick. Much better to pile on a build system to compile those languages from another language that looks kind of Ruby. HTML? Ew - no significant whitespace. Let&#x27;s generate HTML from something that looks and acts like Python.<p>But, snark aside, I think it&#x27;s a good thing if a framework can be agnostic about the kind of configuration syntax it uses, although that in and of itself implies some minimal complexity. Whatever choices the developers make about this, of course, amount to personal preference. Heck, I prefer INI files for configuration.<p>&gt;Even small website often requires hundreds of megabytes of dependencies<p>That depends on the language and framework you&#x27;re using. And how small you consider a &quot;small&quot; website.<p>Unfortunately (in my opinion, with which I know others will disagree) frameworks tend to want to do too much, and as such tend to bloat into vast, overly complex attempts at reinventing the wheel, the chassis, the transmission, the bumpers and deciding what kind of air freshener you should want hanging from the mirror. I would prefer a framework not have a templating library or ORM or code generators baked in at all. Those should be implementation specific decisions. Rather, a framework should manage dependencies, routing, global config, responses, have some hooks to allow extensibility - <i>the basics.</i> If I want more, I can pick libraries for that.
评论 #10107385 未加载
lewisl9029超过 9 年前
Innovation always leads to change. The fact that framework complexity has been increasing is only incidental.<p>In fact, I think we&#x27;re starting to see a trend in the other direction. Angular 1 was a massive mess of complexity, but Angular 2, React-based frameworks, and various other frameworks coming out these days tend to be much simpler.<p>Believe it or not, the web has been the platform where most of the innovation in UI development paradigms has been taking place in the past few years. And I don&#x27;t just mean in terms of the sheer number of new things coming out.<p>The web community pioneered UI development paradigms involving functional programming techniques and immutable data, and have brought its benefits to other platforms (through React Native). I personally would never want to go back to the old way of building UIs. And I suspect I&#x27;ll feel the same way about client-centric data fetching when I get to try out Relay&#x2F;GraphQL, Falcor, Om Next, etc in production.<p>If constant change is the price we have to pay for innovation at such a relentless pace, I personally welcome it with open arms.
评论 #10107248 未加载
lollipop25超过 9 年前
&gt; web applications are becoming more and more complex<p>The way I see it, it&#x27;s becoming complex the more you learn. For instance, the first time one learns a programming language, one learns the language and steers clear of frameworks. The deeper you go, you learn tricks and stuff &quot;which this library does&quot; or &quot;this framework does&quot;. Eventually you get exposed to the stuff that does more stuff in less work, away from the programming and more on configuring.<p>&gt; Even small website often requires hundreds of megabytes of dependencies.<p>You wouldn&#x27;t want to write those from scratch.<p>&gt; Sometimes one application can have 2 different build systems<p>One tends to use the build system in the language nearest to the platform. I still have yet to see a person write Grunt on a Java project or Maven on a JS project.<p>&gt; Micro&#x2F;nano services trend looks optimistic, but I am not sure if it&#x27;s not double-edged sword<p>It is double edged. More control but you need to set configurations, set conventions. Do it wrong, and it&#x27;s easily spaghetti.<p>&gt; In few years instead of writing code are we going to write configs files?<p>For all that configuration, your are configuring <i>something</i>. That something is written by someone. So while you&#x27;re configuring here, someone is programming somewhere.
doobiaus超过 9 年前
We&#x27;ve come full circle and have just pulled our stack back from a complex framework (Durandal, akin to Angular) to a simple architecture centred around knockout.js, and everyone is happier for it. The code is cleaner and debugging is a world apart.<p>Backend wise I&#x27;ve taken a liking to Express because it hides nothing. I prefer it over Rails or ASP.NET MVC, where there is so much magic. I would switch if I could but we have too much legacy code.
px1999超过 9 年前
The theory is that a DSL should be better than whatever generalised programming language you&#x27;re using. SQL is a good example - ORMs tend to fuck up querying databases (ie pulling back unnecessary data) almost as much as they fix. SQL, a language designed for querying relational data, is (unsurprisingly) pretty good at doing what you need efficiently.<p>In practice, a lot of frameworks are made by people (who are just people, and don&#x27;t 100% know what they&#x27;re doing at the outset). I&#x27;d say that if you&#x27;re spending too much time in configuration, you&#x27;re not using the right frameworks.<p>No, in a few years those frameworks will be forgotten. From the terms that you&#x27;ve used, it sounds as though you&#x27;re coming from the Java world, which has an inexplicable love of config files - if that&#x27;s the case, it might be a bit longer than a few years, but they&#x27;ll eventually figure out that config files aren&#x27;t a good representation for options.<p>Though the layers of magic and abstraction will continue to increase and grow, at least until simple LOB usecases can be achieved in a couple of lines at most.
kup0超过 9 年前
It&#x27;s annoyingly bad at this point. You know it&#x27;s gotten bad whenever new frameworks are coming out where being &quot;minimal&quot; is a feature.<p>Page loads are very large on some sites now, where they don&#x27;t have to be. Though, advertising can be blamed for a lot of that. There&#x27;s just a lot of extra cruft out there now, without much added to the user experience, in fact, it often detracts from it.<p>What happened to using only what is necessary? Why throw so much unused stuff behind a site, and especially, why load anything you&#x27;re not using? Why complicate things?<p>Maybe I&#x27;m nostalgic for static pages or something, but I miss the days where things were simple in terms of page loads and efficient design, and I think a technologically-advanced but focused (avoiding excessiveness) approach is best going forward.<p>This philosophical approach is one reason I like the Hacker News site itself. It accomplishes its task well, and is almost solely text and minimal css. It&#x27;s running on some stuff built underneath (as dynamic pages require), but it seems pretty minimal in general. It needs nothing extra.
评论 #10107409 未加载
ufmace超过 9 年前
I get where you&#x27;re coming from - when the initial project for the framework you&#x27;re working with has so much stuff that you don&#x27;t understand or need yet, it feels like a huge burden to do the simplest thing in it.<p>You might want to give Ruby Sinatra a whirl. I just helped a friend build a starter site in it. The Hello World for it is 1 file with 4 lines of Ruby, no config files at all. Save that 1 file, run it, and you have a live website.<p>What I think really makes it cool is that there is a decent amount of sophistication to it, but you only see it when you need it. It doesn&#x27;t force any particular way of doing things onto you. It&#x27;s also kind of a cousin of Rails, so if your needs get to that level, you should be able to switch over pretty easily and make use of the enormous ecosystem of gems.<p>I think express.js on Node has kind of the same idea, might be worth a look also.
评论 #10107439 未加载
msie超过 9 年前
I went to a simple website developed probably in the 90&#x27;s with a simplistic comment board that let anyone submit a comment and specify their name. It was one of the best web experiences I had this week. Loaded up quickly and didn&#x27;t have any useless animation. Did its job of letting users communicate with each other. No complex web framework needed.<p>I think complex web frameworks are developed by expert coders to make their lives easier, supposedly. With little concern for other less-expert developers. But it just turns out to be so complex because they are trying to DRY the shit out of everything.
评论 #10106702 未加载
评论 #10106610 未加载
pags超过 9 年前
This sort of &quot;complexity&quot; (DI, ORM, extensive configuration) has existed for a long time, particularly in the Java webapp space.<p>You don&#x27;t need a license to release a framework, and a framework doesn&#x27;t have to be sensical to be adopted.<p>If you learn the fundamentals of the things you&#x27;re working with, particularly HTTP, web browsers, the web in general, and your chosen programming languages, things will become much more clear.
评论 #10106483 未加载
tremols超过 9 年前
Writing config files or filling some template classes instead of actual programming is pretty much the purpose of a framework. As a senior developer it may be your responsability to filter the hype from the real stuff as you can influence which technologies should be used in your projects. Fortunately there is a parallel universe of people developing wonderful libraries that you can combine and use as you wish.
lewiseason超过 9 年前
Arguably it&#x27;s because websites (or more to the point web applications) are becoming more complex<p>In my experience, the widely-used ones tend to be fairly sane for the most part, and can often be used without having to delve too much into the complexity <i>unless you need to</i> - which I think is the important bit
Oras超过 9 年前
Complicated frameworks are pain in the ass, I fully understand but there is a value in following some &quot;market standard&quot; frameworks as they make the team speaks the same language and will make it easier to bring developers in at any time without long learning curve.
评论 #10107445 未加载
segmondy超过 9 年前
Because every new framework is trying to outdo all the previous frameworks, and they figure that by adding one, two or more feature is the key. You don&#x27;t have to consume all the new stuff. You can always choose to stay lean.
gjolund超过 9 年前
I feel like most of the conversations around this topic boil down to:<p>&quot;I don&#x27;t want to have to learn new stuff.&quot;<p>GTFO of this industry then.
评论 #10107495 未加载