9 ms·
I think your use of "minimum" is wrong here. If you're using React running on Node and Webpack as your task-runner you just need Javascript and that's it. Node
by 9point6 10y ago
I think your use of "minimum" is wrong here. If you're using React running on Node and Webpack as your task-runner you just need Javascript and that's it.
Node allows you to run isomorphic JavaScript that runs on both your server side and client side (to ensure you don't end up with the Angular-style skeleton pages coming from the server), You can pick a nice ORM (like sequelize) to abstract away SQL, and Webpack allows modules to specify their styles in JavaScript to allow compossible CSS for each given page.
Yes this is still using a couple of frameworks, but I personally prefer the approach of a lightweight standard library to the everything-and-the-kitchen-sink approach that other languages have.
- meredydd 10y agoI still count three frameworks :) (React, Node, sequelize, I'm not counting webpack but I probably would if it's anything like as much of a pain as Grunt or Gulp or... And as you say, this is the lightweight version.)
- 9point6 10y agoAh I wouldn't count Node as a framework as I'd equate it to the JVM in Java world. But you are right, I'd probably lump webpack in there as it does have a fair bit of depth to it if you want to get the most out of it.
- aclsid 10y agoYou still need to use Express or something similar on the server side for Javascript, I mean, if we are talking about standard procedures here. Plus with React, you are still doing that Javascript/CSS thingy and HTML of course at some point, so there is no avoiding that, and clearfixes, polyfills, etc, etc.
- tracker1 10y agoBut all of these things you're bitching about combined are far smaller than even ASP.Net without including anything client-side.
- frostymarvelous 10y agoAnd how many frameworks can you count in a win forms or wpf application? If we're going to count frameworks, there'd be no end it. As I once said, programming is abstraction upon abstraction. Like an onion, a Russia doll or better still, inception. Frameworks abound everywhere, at every layer. You just need to adjust your scope as you see fit, to find them.
- soundwave106 10y agoHonestly from the programmer's perspective, it's really just one framework: .NET. I know that .NET abstracts away other frameworks such as the Win32 API, but generally you don't need to know any Win32 API etc. to make a Winforms / WPF / etc. application. With modern "web application" style development, it seems these days you need to know multiple frameworks by default, for better or for worse. More to the point, .NET was designed from the get go as an enterprise programming language. The web was not designed from the beginning to be a universal application platform, it was designed to display formatted hyperlinked text. Much of the hack-y feel of today's web development -- as well as other aspects such as the rather poor security -- springs from this. If the web were designed from the get-go to be a universal sandboxed application platform, I feel that many things (ranging from the scripting language choice to the DOM model) would have looked a lot different today. Standard, non interactive HTML + CSS (what the web was designed for) certainly doesn't feel too hacky after all.
- atoko 10y agoYou are confusing .Net, C# and WP* frameworks. .Net is closer to the JVM, C# is the language and WP* are libraries that interact with w32 apis
- Fire-Dragon-DoL 10y agoAs rpeden pointed out, it's you that are confusing the things. CLR is what JVM is for C#, while all the stuff I mentioned are inside the .net framework
- rpeden 10y ago
- tracker1 10y agoNode is a runtime, not a framework/language, and if you use a JS friendly DB (there are many with transparent APIs available (rethinkdb, mongo, etc) then it's all just JS.
- tempodox 10y ago> ... to abstract away SQL SQL already is an abstraction, why would I want to abstract it away? Why not abstract JS away instead?
- frostymarvelous 10y agoWell, everything is an abstraction, down to zeroes and ones.
- dooptroop 10y agoOh, it goes so much further down than that.
- jethro_tell 10y agoTurtles all the way down.
- tracker1 10y agoUntil you're working on a project where the turtles eat the errors... Funny story, that's how I've been describing the issue with how errors have been handled on the project I'm working on, where there are SO many areas where errors are just ignored... so they don't propagate up the chain/stack... doubly annoying in a node environment where it's all supposed to be error first (as in the first thing you think about and check for).
- tracker1 10y agoI was describing the problem as "turtles all the way down, except the turtles are eating all the errors, and the rabbits can't find them"
- goatlover 10y agoIt's all just fluctuating fields in the vacuum?
- 10y ago
- zeveb 10y ago> Node allows you to run isomorphic JavaScript that runs on both your server side and client side But then you're writing JavaScript on the server side, and I think I'd rather shove live weasels down my trousers than write one line more of JavaScript than I absolutely must.
- eyelidlessness 10y agoYou could of course write something that compiles to JavaScript. There's a ton of options, some are even pretty nice (I like ClojureScript; want to try out Elm).
- jensvdh 10y agoThis is where Typescript comes in. It's beautiful.
- dandv 10y agoJavaScript sucked indeed. ES6 though, has brought many improvements, and the language now is quite decent. With the advent of async/await in ES7 (which is available now if you transpile with Babel), the callback hell is completely gone, and the language is actually beautiful, powerful, and concise.
- d_rezzer 10y agoIsomorphic Javascript. A shitty idea with a fancy hipster name. Ohh but it minimizes the context switching and congnitive overhead of blah blah fucking blah shut the fuck up. Javascript was a language miraculously invented in 10 days by the great Brendan Eich and 20+ years later it's still basically the same hack of a language. ORM. an even worse idea. Let's make data access slow except for the most brain dead example code while removing the important aspect of understanding the basics of a database. Awesome. Webpack. Only seems like a good idea because every thing else before it is so much shittier. It's still an over-complicated hack. Forcing JS on the server so that front end people can write crappy backend end code with a shitty SQL abstraction layer! It still doesn't solve the problem that the web is a system of hacks. It only adds to it! The backend was the one fucking place that was doing just fine without javascript. Christ, if that's the best choice then we're all fucked. /rant Who knows, maybe WebAssembly will turn out to be something.
- nameless912 10y agoI would argue that React is different enough so as to almost be called its own language. After all, it does use "JSX", whatever the hell that means ;-)
- bschwindHN 10y ago> You can pick a nice ORM (like sequelize) I'm gonna stop you right there. Node is a helpful tool and I enjoy using it, but Sequelize was nothing but pure pain when I used it. You're much better off running raw SQL, or using a query builder like KnexJS. I would never use Sequelize for more than a 1-table read or update.
- tracker1 10y agohonestly, in JS/Node, I find it easiest to use a SQL adapter that can handle template strings as parameterized queries... const results = await sql.query` SELECT ... WHERE foo = ${bar} `; if (!results && results.length) return; await myQueue.add(results); Which works unbelievably well... There's not nearly as much need for boilerplate/translation layers in what is already a dynamic environment. I wrote a wrapper for ms-sql when migrating data, it took 2-3 days to get it done, but writing queries as above was so easy to work with it was incredibly nice. I'd rather work with a db that has a friendlier API to work with or abstract around... but writing a little template driven sql is often better than layers of boilerplate like an ORM.. and I still don't really get mongoose.
- tonyarkles 10y agoMaybe I'm missing something, but that looks like SQL Injection ready to happen.
- tracker1 10y agosql.query is a function that will receive two arrays, one is the strings part, the other is the injected values... the template processor takes those arrays and turns it into a parameterized query to the database.
- tonyarkles 10y agoVery cool! In that example though... where's the array? And don't backticks do string interpolation?
- gjolund 10y ago"thats it" 250mb worth of dependecies later...