News for hackers. Stuff that matters.
Re:The Linux Foundation Unites the JavaScript Community for ... by kowdermeister on Tuesday October 18, 2016 @07:52AM (#12733566)
I don't see the need for this to cherry pick a few project and push them with the Linux brand. The JS landscape is fragmented for a good reason and I don't see that as problem in fact, rather as a feature. With NPM and YARN we already have a good enough package management system and their platform can help me evaluate if a package is community supported enough. I'm talking about the stats that I can just check: number of stars, contributors and open/closed issue ratios.

If someone understood it better than me please add your thoughts.

I also don't see faces here: https://js.foundation/members/ Who runs the show?

Re:The Linux Foundation Unites the JavaScript Community for ... by omegote on Tuesday October 18, 2016 @08:00AM (#12733600)
How can you find the js fragmentation a feature and not a stinking pile of shit? Seriously.
Re:The Linux Foundation Unites the JavaScript Community for ... by kowdermeister on Tuesday October 18, 2016 @08:25AM (#12733719)
First the term. By fragmentation I mean two things: 1) we have many libraries doing the same thing. 2) the implementation is JS is not the same in every environment.

If you are spending most of your time writing other languages which have a standard library, I can understand your opinion.

However, I see fragmentation as:

1) It introduces the opportunity everyone on the planet to give a shot at implementing something that may or may not be better than we consider today the best. For example I used a datepicker in my latest project but in the current it failed and I could replace it in 15 minutes rather than spending hours finding the issue with the "standard one". I'm not really experienced in the C++ world, but I guess people would call me crazy if I proposed a new stdio lib. Maybe there could be better libraries, who knows. It's a settled game there. See jQuery in JS land, it was for many years, "the golden tool". Now we have alternatives for more specialized workflows. Not everybody wears the same hat all the time.

2) EcmaScript is constantly evolving, that causes another fragmentation, but this also allows the dev community to propose changes, implement new features and create a really vibrant feedback loop. If you stick to the latest stable (currently ES5) you are safe to build whatever you like with great stability.

Re:The Linux Foundation Unites the JavaScript Community for ... by inimino on Tuesday October 18, 2016 @08:50AM (#12733868)
The fact that people can contribute is great, the fact that it is impossible to get started in modern JS development without making dozens of seemingly inscrutable choices is not.
Re:The Linux Foundation Unites the JavaScript Community for ... by moron4hire on Tuesday October 18, 2016 @09:54AM (#12734308)
Plain old HTML, CSS, and ES5 still work. You aren't forced to install Node and Gulp and any of those things. So I rather much thing the use of the word "impossible" is way out of line here.
Re:The Linux Foundation Unites the JavaScript Community for ... by inimino on Tuesday October 18, 2016 @10:11AM (#12734465)
They are the foundations, and I recommended them in this very thread. But that's not what most of us would call "modern JS development". The amount of extra stuff between the foundations and current "best practices" is exactly the problem.
Re:The Linux Foundation Unites the JavaScript Community for ... by moron4hire on Tuesday October 18, 2016 @12:24PM (#12736004)
"best practices" is just a phrase. There is no objective proof that what people call "best practices" is at all. Far more often, I've seen it used as a protectionism for not learning or trying new things.

Stuff like minification you probably want a pre-existing tool to do. It's stupidly simple and not that difficulty to integrate into any build process.

But stuff like transpiling is completely optional. ES5 is a really high level language. There isn't anything particularly "wrong" with it, not any more so than most any other language you'll end up using.

Re:The Linux Foundation Unites the JavaScript Community for ... by tracker1 on Tuesday October 18, 2016 @01:24PM (#12736714)
Start with understanding \JS... then understand ES6 and CommonJS style modules. From there, understand that babel is just a tool to let you use new syntax, which has stabilized a tot since ES6, there's a few bits for async still baking, but that's to be expected. Beyond this is the node-style callback, and more about Promises and async.

These are the core of it all... from there, it's a matter of picking the lego pieces you want to use. What I described above is no more complex than the JVM or extended .Net APIs, especially when you pick all the target options there... in fact the footprint is a lot smaller. Yes, it's a little harder to build something with the 2000 piece lego generic pack than it is with the guided here's a pirate ship with all the parts laid out. But that's what engineering is all about.

If you're really stuck, start with a boilerplate or starter generator tool, there's a few of them for whatever direction you are leaning. Don't worry about picking "the right one"... there is no true path. No matter what you pick, you're going to hit a wall that conflicts with your sensibilities. Angular has the biggest adoption of any web framework ever and only has a 44% approval rating for reuse. That means a LOT of people pick wrong. Adapt, learn, grow...

Re:The Linux Foundation Unites the JavaScript Community for ... by 2T1Qka0rEiPr on Tuesday October 18, 2016 @10:27AM (#12734648)
But for significant pieces of work it is still a hurdle which you must cross. Unless you're writing vanilla ES5 without any dependencies, you have to consider package management, build tools, how to load your modules, before even getting onto transpilation, minification etc.

I can see what's so great about the JS community, but the fixed cost to get to actual production-ready development is pretty high. And rolling your own bootstrapping tools seem pretty pointless given the longevity of any particular tool being the one to recommend. #jsfatigue!

Re:The Linux Foundation Unites the JavaScript Community for ... by irrational on Tuesday October 18, 2016 @12:51PM (#12736343)
I disagree. All those things you mention are entirely optional and it is very possible to create high quality code without them. My rule is, don't use them until you run into a problem that the tools solve, then you can use them while understanding exactly what problem the tool is meant to solve.
Re:The Linux Foundation Unites the JavaScript Community for ... by moron4hire on Tuesday October 18, 2016 @12:26PM (#12736038)
I do a lot of JS development and I think most dependencies are highly overrated. ES5 is a very high level language already. I use a package manager, but frankly, I'm considering stopping because there is a lot of value to being able to just keep a local copy and include scripts with a script tag. It forces you to manually update and inspect for regressions. You get a much better sense of your total payload size, too.
Re:The Linux Foundation Unites the JavaScript Community for ... by kowdermeister on Tuesday October 18, 2016 @09:25AM (#12734086)
That's because "modern javascript" is not there yet, it's still in an experimental phase, we need transpilers and other stuff to use features that are not in a finished state. It will get better with time.
Re:The Linux Foundation Unites the JavaScript Community for ... by monocasa on Tuesday October 18, 2016 @11:22AM (#12735341)
So when is Javascript not going to be in an experimental phase? A couple of years ago it would have been 'when browsers support ES6'. Now it's 'when browsers support ES7'. Next year it's going to be 'when browsers support ES8'.
Re:The Linux Foundation Unites the JavaScript Community for ... by irrational on Tuesday October 18, 2016 @12:40PM (#12736202)
To be fair, ES6 was huge. ES7, and probably ES8, are tiny by comparison with only a few new features. Once browser creators get caught up on ES6 it _shouldn't_ be too hard to stay caught up after that point.

But, most of experimentation isn't around the core ECMA features. The experimentation is happening around the toolchain, the libraries, the frameworks, etc. which are separate from stuff like ES6.

Re:The Linux Foundation Unites the JavaScript Community for ... by inimino on Tuesday October 18, 2016 @09:37AM (#12734162)
And that getting better process is what people mean by reducing fragmentation.
Re:The Linux Foundation Unites the JavaScript Community for ... by boggydepot on Tuesday October 18, 2016 @10:39AM (#12734812)
your sentences fit in that blog post about a conversation with someone who wanted to build a simple web app in jquery
Re:The Linux Foundation Unites the JavaScript Community for ... by papyrus23 on Tuesday October 18, 2016 @10:36AM (#12734765)
You're literally contradicting yourself.

"It's not there" i.e its a stinking pile of shit.

Re:The Linux Foundation Unites the JavaScript Community for ... by ldehaan on Tuesday October 18, 2016 @11:11AM (#12735211)
that's not correct, and he did address why it doesn't suck. because it's not standardized. some people do better with more complicated things, it's ok to need directions, not everyone does.
Re:The Linux Foundation Unites the JavaScript Community for ... by radioact1ve on Tuesday October 18, 2016 @09:09AM (#12733973)
Exactly this. All of the upfront choices, will I make the right choice? I've been meaning to jump in and learn. After years of backend development (C#, Python, and some Go), I want to give JS a shot and at least experiment.

It's a daunting process that I keep pushing back as there is no immediate need.

Re:The Linux Foundation Unites the JavaScript Community for ... by inimino on Tuesday October 18, 2016 @09:14AM (#12734005)
The best thing to remember is that if you're doing it for fun and learning, you don't need anything but a plain old HTML5 and a plain old script tag. Once you feel you need something more than that for a particular project (or for work) you'll be better able to evaluate what's out there.

  <script>
  // get started!
  </script>
Re:The Linux Foundation Unites the JavaScript Community for ... by irrational on Tuesday October 18, 2016 @12:47PM (#12736292)
This. Someone starting out should not be using webpack, react, jquery, lodash, etc. etc. etc. You need to first learn vanilla javascript which requires nothing more than a browser and a text editor.
Re:The Linux Foundation Unites the JavaScript Community for ... by pauly on Tuesday October 18, 2016 @11:49AM (#12735613)
even simpler open your browser console and just start typing, I've found new ideas by letting the autocomplete there guide me
Re:The Linux Foundation Unites the JavaScript Community for ... by Klathmon on Tuesday October 18, 2016 @09:24AM (#12734075)
Realistically, you won't make the right choice. But that's okay. Because of the number and size of most packages, they are easily replaceable.

Like the commenter higher up said, it's not like C#, Python, or Go where if you have an issue with a library, it could take days to find and implement a replacement. The vast majority of libraries in JS land are small and single purpose. Think of it as replacing the air-filter in your car vs the whole engine.

Re:The Linux Foundation Unites the JavaScript Community for ... by Klathmon on Tuesday October 18, 2016 @09:21AM (#12734055)
But that can (and is) solved by either just "picking one of the big ones" and moving on, or by using even more tools layered on top to abstract away a lot of those choices (don't know anything about how to start with react? Just use react-create-app and go from there).
Re:The Linux Foundation Unites the JavaScript Community for ... by inimino on Tuesday October 18, 2016 @09:39AM (#12734175)
Then a couple years later you've learned a lot of arcane details about something that has already fallen out of fashion. It's not the end of the world but it's not optimal.
Re:The Linux Foundation Unites the JavaScript Community for ... by tlrobinson on Tuesday October 18, 2016 @11:48AM (#12735597)
Such is life in programming. But feel free to continue using jQuery if you feel all the new stuff isn't worthwhile.

IMHO the sweet spot for picking up new JS tech is about a year or two after it first starts appearing on Hacker News.

Re:The Linux Foundation Unites the JavaScript Community for ... by inimino on Tuesday October 18, 2016 @12:21PM (#12735969)
> Such is life in programming.

Actually no, the technology churn is much higher in JavaScript-land than most anywhere else.

Re:The Linux Foundation Unites the JavaScript Community for ... by tracker1 on Tuesday October 18, 2016 @01:13PM (#12736599)
React is what 3-4yo now... given Redux is less than 2 years, and there was a LOT of churn on flux-like frameworks. But React + Redux will likely not go anywhere for the next 5+ years, it's already pretty well distilled. Similar tooling and alternatives will still be present, but this happens in any vibrant ecosystem. There was a similar burst in the alt.Net space before ASP.Net MVC and razor came out... even then there has been alternatives introduced.

You're not talking about a single application and platform. You're talking about the most flexible set of cross platform rendering engines ever created. How many UI toolkits are there for Windows, Linux and macOS for native apps, now add Android and iOS... The browser targets all of them, and the base app toolkits pretty much target them all, and still being more flexible and capable than what came before. Expand this to the number of tools available. How could this be anything but echoed in the JS sphere.

Given the shear breadth of Web development alone, let alone server-side, IoT, Desktop, embedded, mobile and who knows where else, how can there be anything but a lot of options and diversity.

Re:The Linux Foundation Unites the JavaScript Community for ... by moron4hire on Tuesday October 18, 2016 @12:32PM (#12736106)
That is not true at all. It's also not an issue that is going away. This is The Singularity. It's only going to get worse. Either you learn to adapt or you get left behind. And "adaoting" could mean, "learn to quit being a magpie distracted by evwry shiny new thing."
Re:The Linux Foundation Unites the JavaScript Community for ... by irrational on Tuesday October 18, 2016 @12:44PM (#12736257)
This seems to be true, but I see it as a consequence of how many resources are being devoted to JavaScript by major corporations and legions of developers versus other programming languages. Does Google, MS, Facebook, Apple, etc. ad naseum have entire departments devoted to improving Python, C, Ruby, etc.? Not as far as I know. If there were as many resources being thrown at C as there is at JavaScript I'm sure the churn would be just as high.
Re:The Linux Foundation Unites the JavaScript Community for ... by tracker1 on Tuesday October 18, 2016 @01:05PM (#12736516)
That's what boilerplates, and even generation tooling like yo is there for.
Re:The Linux Foundation Unites the JavaScript Community for ... by heisenbit on Tuesday October 18, 2016 @09:14AM (#12734003)
I concur with your experience that date-picker is a not yet solved problem. I disagree that I can find in 15 minutes an alternative that carries less risk repeating the same experience.

For the building to rise higher the foundations need some solidifying.

Re:The Linux Foundation Unites the JavaScript Community for ... by humanrebar on Tuesday October 18, 2016 @09:26AM (#12734090)
> I'm not really experienced in the C++ world, but I guess people would call me crazy if I proposed a new stdio lib.

Some would. But there are plenty of companies and projects with their own standard libraries. There's also serious (but early-stages) discussion within the C++ standards committee about developing an std2.

Re:The Linux Foundation Unites the JavaScript Community for ... by finchisko on Tuesday October 18, 2016 @08:09AM (#12733634)
What exactly do you mean by js fragmentation? If that, you have power to pick from hundreds of lib/fw and combine them together, then what you call fragmentation is actual real benefit for me. I like to make decisions myself, but if you like the others to take decisions for you, js is probably not for you. The very good example is redux. Redux was once simple state management lib. Take a look at it now https://github.com/xgrommx/awesome-redux. That is real power of js ecosystem.
Re:The Linux Foundation Unites the JavaScript Community for ... by acemarke on Tuesday October 18, 2016 @12:23PM (#12735995)
Obligatory self-plug: the "awesome-redux" list is cluttered and not well organized, and was actually rejected from inclusion in Sindre Sorhus's "awesome-awesome" list because of that ( https://github.com/sindresorhus/awesome/issues/714#issuecomm... ). On the flip side, I keep a list of Redux-related addons and utilities at https://github.com/markerikson/redux-ecosystem-links that is actively maintained and has (hopefully) much better categorization, as well as being a much more comprehensive list of all the useful pieces out there in the Redux ecosystem.

But yes, as I've said in some recent comments: Dan and Andrew found a sweet spot with Redux's design in terms of approach, concepts, and providing building blocks for others, and that's led to an explosion of useful stuff that people have built for their own use cases.

Re:The Linux Foundation Unites the JavaScript Community for ... by onion2k on Tuesday October 18, 2016 @08:11AM (#12733644)
There are two schools of thought. The first is that you should optimise for the platform you're targeting, so a fragmented JS world is a good thing because you optimise for different things depending on where your code is going to run. The second school of thought is that you should optimise for development, and you should have the same language everywhere even if that means slightly less efficient code.

For example, if you write long running services in node then optimising for memory allocation in order to avoid leaks is a good idea. It's less useful for clientside things that generally don't run for nearly as long. Conversely, if you write isomorphic JS that can run in the browser but also needs to run on the server for that first-load advantage, then you'd prefer if things work the same everywhere.

Neither school is 'right' per se. How a language ought to evolve is incredibly subjective.

Re:The Linux Foundation Unites the JavaScript Community for ... by flueedo on Tuesday October 18, 2016 @09:17AM (#12734019)
Yep, and, not that having to learn and become acquainted with shortcomings of new sets of languages/tools every other year isn't a fact of life for many devs that one ought to just accept. But having something run just (or as close as possible to) the same across many platforms make it more likely that that knowledge you acquired will remain among your best options when approaching a wide range of problems for a longer time.
Re:The Linux Foundation Unites the JavaScript Community for ... by tracker1 on Tuesday October 18, 2016 @01:26PM (#12736746)
Java 4 FOREVER!!!! f*ck maven... we like complex Ant configs... Generics can go to hell.

I mean this is a bit of hyperbole, but the point is that languages and platforms evolve, and given that JS has a bigger target surface than anything else in the history of computing, with more resources than anything else ever being poured into it, multiplied by approaches and opinions, how can it not be diverse. The world doesn't have the same houses everywhere either... Oh noes, they're building different styles of roofs over there.. the sky is falling.

Re:The Linux Foundation Unites the JavaScript Community for ... by wrecursion on Tuesday October 18, 2016 @09:16AM (#12734011)
I see it both as one of JS's greatest strengths, and greatest weakness's.

Certainly, at a prototyping/exploratory level, all of the freedom and choices are great!

For me, however, when you just 'need to get sh*t done', all the choices and configuration required to setup a project becomes a nightmare, commonly referred to now days as js fatigue.

I am looking forward to trying out http://www.electrode.io/ on my next project. Other than that, I have been digging into elm as a way to reduce the choices required and the cognitive load involved in setting a project up. It's great to have 'one true way' of doing things.

Re:The Linux Foundation Unites the JavaScript Community for ... by fenomas on Tuesday October 18, 2016 @11:07AM (#12735160)
I've never understood this complaint. JS is used everywhere from browsers to servers to native apps to IoT. Does there really need to be One True Framework/Linter/Build tool/etc?Is it really that big a problem that people have made a lot of different tools and libraries because they're solving a lot of different problems?
Re:The Linux Foundation Unites the JavaScript Community for ... by randall on Tuesday October 18, 2016 @11:15AM (#12735265)
I think the problem is keeping up. It's simple if you can pay attention, but if you're still on angular 1.x because you have other things to worry about, the fragmentation and pace means you can get years behind if you're not careful.

It's not like ruby has another package manager every 6 months.

I agree the many implementations probably are a feature, not a bug, but still induce fatigue. It's too easy to get behind.

Re:The Linux Foundation Unites the JavaScript Community for ... by fenomas on Tuesday October 18, 2016 @11:31AM (#12735427)
Maybe I'm missing something really fundamental, but why try to keep up with everything? It's a huge ecosystem and any given dev/team can only use a tiny bit of it. If a library does everything you need it to, does it matter if you're years behind on it? (modulo e.g. security fixes)

I mean, certainly I agree that trying to keep current on everything would be a nightmare. But surely that's just the result of lots of people sharing lots of libraries, right? If other languages don't have the same problem, isn't that just because people aren't sharing as much code?

Re:The Linux Foundation Unites the JavaScript Community for ... by randall on Tuesday October 18, 2016 @03:16PM (#12737747)
I think this is true, but JS also "sucks" in different ways, so not keeping up means expending seemingly unnecessary effort in maintainability, reliability, etc.

Angular 1 is impossible to maintain compared to Angular 2, for instance. Angular 1 fixed a lot of problems vanilla js faced. It's all improvements.

Re:The Linux Foundation Unites the JavaScript Community for ... by tracker1 on Tuesday October 18, 2016 @01:36PM (#12736841)
I only very loosely followed Node/npm for the first few years, as I was mostly working on windows. 0.8 kind of worked, and 0.10 was the first version that really worked, and npm was finally baked enough. That said, the few binary modules you came across rarely worked in windows, and there were some rough cuts along the way.

I know what the pain/churn was like then... I mean it's overwhelming, build chains, task runners, configuration files, tools changing left and right, exponential (for a while) growth... Not to mention more functional approaches clashing paradigms, the detour of bower, less vs sass vs whatever... It was a huge shift. But the backdrop has settled a lot... Yes, there are new options out every other day, but it's not like it was for a long while.

Node 0.12 through current is mainly about bringing in new JS engines and performance improvements and less about introducing sweeping changes. Webpack and Babel are now staples... ES6 modules will shake up the npm ecosystem a bit for the next while, but if you're using Webpack + Babel, you'll probably notice it less.

There's still growth, but the churn isn't quite as massive if you just concentrate on the core (JS, npm, webpack, babel) and less about specific modules (lego blocks) until you need a given brick.

Re:The Linux Foundation Unites the JavaScript Community for ... by z3t4 on Tuesday October 18, 2016 @01:45PM (#12736918)
things evolve until they reach perfection. Then they die.
Re:The Linux Foundation Unites the JavaScript Community for ... by qaq on Tuesday October 18, 2016 @08:03AM (#12733614)
It creates jobs :)
Re:The Linux Foundation Unites the JavaScript Community for ... by mugsie on Tuesday October 18, 2016 @08:13AM (#12733654)
> I also don't see faces here: https://js.foundation/members/ Who runs the show?

https://js.foundation/governance/ seems to have placeholders

Re:The Linux Foundation Unites the JavaScript Community for ... by Noseshine on Tuesday October 18, 2016 @09:05AM (#12733951)
The member list is amazingly small. The only well-known names and the only "platinum" names are IBM and Samsung, personally I never heard of any of the rest of the members before. I say "amazingly" for the amount of attention this gets (I first saw it on reddit and a number of other websites). I would expect to see at least Google and Microsoft and possibly Mozilla on there, and whoever represents node.js (the foundation itself, or someone).

The way this usually works AFAIK is that you try to get as much "buy-in" from as many important parties as possible before making the first big public announcement. It seems that in this case that didn't quite work out, and they instead hope to let the announcement itself be what starts the ball rolling to get more members on board.

Re:The Linux Foundation Unites the JavaScript Community for ... by inimino on Tuesday October 18, 2016 @08:47AM (#12733851)
This doesn't look like an attempt to pick winners, but to support the participating projects. Do you see anything about reducing fragmentation? (Not that that would be bad.)
Re:The Linux Foundation Unites the JavaScript Community for ... by languagewars on Tuesday October 18, 2016 @09:25AM (#12734087)
It seems like it is promoting things that might be expanding JS' reach to other device running the Linux kernel rather than cherry picking projects in the existing common use cases. For example, sponsoring the only node server I've heard of that targets running on mobile devices, and an IoT appropriate interpreter are not like the net zero action of picking a winner among react/angular/ember/etc.
Re:The Linux Foundation Unites the JavaScript Community for ... by _RPM on Tuesday October 18, 2016 @09:19AM (#12734044)
Yarn is brand new but NPM is not. To you they are equvilent.