News for hackers. Stuff that matters.
Re:Javascript is a buffet, not the enemy [video] by sidlls on Friday April 28, 2017 @09:14PM (#14224422)
When I look at what the front-end developers at the company I work for have had to go through with respect to package and dependency management to get an Angular application going, I cringe.

The problem isn't that JavaScript is a bad language (that's purely subjective), it's that it has a terrible ecosystem and a community that, apparently, is willing to accept very low standards in library and package management.

Re:Javascript is a buffet, not the enemy [video] by CharlesW on Friday April 28, 2017 @11:17PM (#14224849)
> …it's that it has a terrible ecosystem…

Two follow-ups if you don't mind: (1) "terrible" in what kinds of ways, and (2) compared to what, specifically? (Genuinely curious.)

Re:Javascript is a buffet, not the enemy [video] by krzyk on Saturday April 29, 2017 @02:14AM (#14225299)
For me it is a mix of zillions of libraries with broken package management (npm + gulp).

Compare to maven in java. Yes, you need to write XML, but it is not that hard, you mostly add <dependency>. And then it just works.

And with npm, I get - this doesn't work with that version of npm (which BTW has a funny versioning that is almost exponential, there are 0.x and x.x versions), but it doesn't say that the version is wrong, it just does not work and you are to figure out why.

More over, npm package locations, you can have three places, in project directory, in home directory and system wide. And to make matters worse you switch between those by using a command line switch. And it breaks, because once you downloaded a package into home dir (accident) and then your packages in current dir don't work, just because - build breaks and you are out of luck. I don't even count how many times I had to remove all npm directories to get rid of some package that was downloaded.

With maven you have simple system, that is constraint and because of that you have much fewer places where it will shoot you in the foot.

With npm (+gulp) you get wild west of package management, just like it was with ant days of java.

And don't get me started on the AngularJS - I thought that I won't see anything that complicated since the days of EJB < 3.

Re:Javascript is a buffet, not the enemy [video] by mercer on Saturday April 29, 2017 @02:39AM (#14225343)
Yarn might solve a bunch of those problems. And at least here on HN there seems to be consensus (or at least a very large group) that considers AngularJS a particularly bad idea.

I don't disagree with you though; just saying.

Re:Javascript is a buffet, not the enemy [video] by weego on Saturday April 29, 2017 @01:24AM (#14225185)
Fragmentation, wheel reinvention, people using dependencies that are long-term unmaintained and or deprecated are a few that immediately spring to mind
Re:Javascript is a buffet, not the enemy [video] by haburka on Saturday April 29, 2017 @09:19AM (#14226434)
Keep in mind that angular is not made for small, simple apps. It's designed to support large web applications and I think it does a great job doing that. Addiitionally, there are seed projects which you can use to avoid writing your own build tools. I agree that the build is complicated but it's much more complicated to make a large scale app without using the abstractions that the build tools provide you with.
Re:Javascript is a buffet, not the enemy [video] by ysavir on Saturday April 29, 2017 @11:15AM (#14226902)
> Keep in mind that angular is not made for small, simple apps. It's designed to support large web applications and I think it does a great job doing that.

My experience has been the complete opposite. Angular has been best for simple, straightforward apps. The larger the app got, the more convoluted the code grew, and the more I found myself fighting with the "angular way".

Maybe 2.0+ is different. I wouldn't know, and have no interest in finding out.

Re:Javascript is a buffet, not the enemy [video] by haburka on Wednesday May 03, 2017 @12:27PM (#14257297)
I have been developing in angular 2+ and this is absolutely true. It lets you build large scale apps pretty easily. It makes it simple to use design patterns.
Re:Javascript is a buffet, not the enemy [video] by Rapzid on Friday April 28, 2017 @11:04PM (#14224814)
I have similar feelings about Python.
Re:Javascript is a buffet, not the enemy [video] by bitexploder on Saturday April 29, 2017 @12:05AM (#14224987)
I think JS ecosystem is an order of magnitude more unstable. I can still write a Django/Flask/Pyramid app in roughly the same way I did 5 years ago. The key libraries have longer and more consistent development. The whole environment is just easier to use. Maybe I am biased from nearly a decade of heavy Pyhton use, but I have written a non-trivial amount of JS code. Angular 1 is basically a relic. It just isn't a user friendly sandbox to play in. Python has its warts but we build and use tools in Python and it seems much easier than JS.
Re:Javascript is a buffet, not the enemy [video] by pfooti on Saturday April 29, 2017 @01:00AM (#14225123)
You can still write an Express, Jade, haml, whatever app like it is 2011. The js world moves fast, but the old libraries are still out there. Plenty of people writing jquery or knockout code.

Web dev has a fast cycle time, mainly (imo) because products are created and used and discarded quickly - lots of websites are short-lived one offs. So, naturally, there's churn.

And as to what my sibling commenter said, I agree. I'm starting to move from angular 1 to 2, and 2 is better. It has some downright amazing features, and the tooling is quite excellent. That's why, personally, I'm learning the new thing.

Re:Javascript is a buffet, not the enemy [video] by ern on Saturday April 29, 2017 @01:30AM (#14225194)
I'm starting to move from angular 1 to 2, and 2 is better.

Angular 4, you mean (or just "Angular").

Re:Javascript is a buffet, not the enemy [video] by alttab on Saturday April 29, 2017 @10:26AM (#14226714)
I'm still in the Rails/Bootstrap/jQuery camp. When you need something quick, that will function, and not look like shit - you really can't beat this option. It's also easy to teach junior developers, and they strengthen on the fundamentals first.
Re:Javascript is a buffet, not the enemy [video] by zackify on Saturday April 29, 2017 @11:16AM (#14226907)
Needing something quick is subjective honestly. Personally I could build you a service worker that makes your app offline capable and throw in React components on whatever pages you need, or setup a whole React / vue / vanilla js / whatever app structure in 30 minutes thanks to the time I've spent investigating good packages to use. So I'd say there's many options that are great and it's sad to see people here in this thread (not you) complain that there's so much js churn when isn't the whole reason We are developers because we have a passion for constant learning and building cool things?
Re:Javascript is a buffet, not the enemy [video] by alttab on Sunday April 30, 2017 @11:41AM (#14232038)
Very true. Yet as a manager leading a team of mainly backend engineers who don't have lots of interest in front-end development - we need a toolchain that is easy to pick up, easy to understand the fundamentals, and easy to train interns or junior devs on.

Of course - it also helps I understand that tech stack enough to efficiently explain it to younger engineers. That said - these three technologies have a LOT of material on the web and consensus on that tech has helped my folks build things "more right" more often, without having to do all the nuanced consideration themselves.

When it comes to X resources, Y time, and Z goals, it's all about the right tool.

I think many people give JS shit because it isn't always the right tool - but people choose it anyway due to hotness/hype/vague advantages.

So I'd agree its a mix of skill, resources, and goal. Arguably another manager with amazing React skillsets could do the same thing with a different stack. I'd love to see that guy in action, especially if he can have a more productive team for the choices.

But for us - most UI Frontends are fancy buttons on backend service APIS, or stupid CRUD. Rails does this with confidence.

Re:Javascript is a buffet, not the enemy [video] by bitexploder on Saturday April 29, 2017 @11:26AM (#14226958)
It is true and you are correct t but as a JS novice it is very hard to know which things are good and which are just new junk.I love learning and mastering things as much as the next individual. (BTW I have moved to Vue when I need a fancier front end and Love it). I guess my complaint, if you can call it that, is that it is hard to find the good stuff and easy to spend hours fighting node packages and Packers and get nowhere.
Re:Javascript is a buffet, not the enemy [video] by zackify on Saturday April 29, 2017 @05:48PM (#14228958)
It keeps coming down to finding the right resources and not wasting time on the bad projects. And that's totally valid.

We need some sort of js beginner walk through that has a section for each step in the process and explains the solutions and differences between projects.

ex: step 1 is language fundamentals, step 2 dom manipulation step 3 bundlers and why you need them. Step 4 frameworks and libraries to build your frontend. Something like this would be useful but I don't know if anyone is building something like this for beginners :/

Re:Javascript is a buffet, not the enemy [video] by ng12 on Saturday April 29, 2017 @12:20AM (#14225036)
Is your complaint that JS development is getting better? People didn't ditch Angular1 because it was old, they ditched it because Angular2 is better.
Re:Javascript is a buffet, not the enemy [video] by mercer on Saturday April 29, 2017 @02:41AM (#14225348)
That's not saying much though. I keep reading that Angular 2 is still a really bad idea (haven't gotten to using it myself though). What's your experience comparing Angular 2 to other frameworks you've tried?
Re:Javascript is a buffet, not the enemy [video] by bitexploder on Saturday April 29, 2017 @09:45AM (#14226566)
I am just saying that the "newest" tools in Python are more stable and if you pick a popular framework or package in Python chances are good it will still be active years later. Whereas JS community seems to have ADHD and things like TypeScript come along in the JS world. The cost of learning and staying modern in JS and front end development in particular is high. It does create meaningful new ideas but it is a mess compared to investing in almost any other popular language.

So, I learned Angular 1 for a project. Some concept there really are everywhere (promises, DI), but you might as well not even call Anuglar 2 Angular. It is totally different and even getting started in it took so much effort I gave up. I have almost never done that as a hacker. But the sheer amount of stuff to install and learn just to implement Hello World was more than I was willing to deal with at the time.

Re:Javascript is a buffet, not the enemy [video] by zackify on Saturday April 29, 2017 @11:22AM (#14226933)
It's not as high as you would think. Everyone here loves to complain how fast things come along but the following is true for any language. If you know the fundamentals of JS you can do anything. It's not hard to spend a Saturday trying out Vue or webpack or React and decide what stack is best for your company. If you can't spend the time to find the right tooling and your excuse is that things move too fast, it sounds like you're complaining about learning and using the latest technologies, which I don't get as a developer. I personally find it exciting how everything is going. It's also easy to stick to your stack thanks to yarn which will lock in your dependencies so you don't have to worry. Lastly, creating a hello world app in React or vue can be extremely simple. I haven't used angular much so I can't attest to it.

But after all that, I can see why some people would be frustrated.

Being on the inside and doing js for the past 3 years it's more exciting than looking in. We keep getting new awesome language additions as of late!

Re:Javascript is a buffet, not the enemy [video] by bitexploder on Saturday April 29, 2017 @11:30AM (#14226977)
I do worry it's just a Python bias I have. But it clearly isn't just me. I have been using Go and can get things done there pretty easily. JS th language isn't any harder than Go or Python. It isn't the language. If I spent a few years my senses would be honed for avoiding traps -- but I feel I can do that in many other languages and ecosystems much easier as a novice. Maybe it is just the size of th JS world.
Re:Javascript is a buffet, not the enemy [video] by tigershark on Saturday April 29, 2017 @10:44AM (#14226795)
I second this. I'm tired of fighting to enable my AMD card on the MacBook Pro in theano. Maybe I will find a working solution one day, but I'm supposed to learn neural networks, not all the environmental problems when using a Mac with an amd card. And apparently at some point in time it used to work, albeit compiling stuff from the develop branch of some libs. Now it seems broken, at least with python 3.5 and/or with the stuff on my machine..
Re:Javascript is a buffet, not the enemy [video] by sidlls on Saturday April 29, 2017 @12:19AM (#14225031)
The language I use day-to-day in my current job (machine learning and data engineering) is Python, although I employ a smattering of C++ and, lately, Rust as well (the only one to use either of the latter, that I'm aware of, in the company). Python's virtualenv/pip system, for all its warts, is orders of magnitude better than any JS package management system I've seen.
Re:Javascript is a buffet, not the enemy [video] by indexerror on Saturday April 29, 2017 @01:47AM (#14225233)
> Python's virtualenv/pip system, for all its warts, is orders of magnitude better than any JS package management system I've seen

In terms of what? Can you please do a npm vs pip and a nvm vs virtualenv?

Thanks

Re:Javascript is a buffet, not the enemy [video] by Can_Not on Saturday April 29, 2017 @04:37PM (#14228616)
> Python's virtualenv/pip system, for all its warts, is orders of magnitude better than any JS package management system I've seen.

I've had the complete opposite experience. Crates, composer, and npm are my go-to examples of good package mangers. Python is my go-to example for lack of a good package manager.

Re:Javascript is a buffet, not the enemy [video] by cshenton on Friday April 28, 2017 @11:08PM (#14224827)
What problems do you run into? I've had good luck with a pretty vanilla virtualenv + requirements.txt files, and docker for packaging (great for c libs that my python packages call down to).
Re:Javascript is a buffet, not the enemy [video] by Rapzid on Saturday April 29, 2017 @12:00AM (#14224976)
I've worked through most of my packaging and pyenv/virtualenv issues but I must say I found it much more convoluted and painful than any other language I've worked with in the past 6 years. The need for all the virtualenv's makes me sad, and I'm not a huge fan of the shim system. Working on multiple projects that need different versions of a dependency, particularly when your also working on that dependency, can be a pain still. This is very subjective but pipenv was just released THIS YEAR and has over 3k stars on github; clearly there is some general angst out there.

But I more meant the ecosystem in general:

A "batteries included" language makes me create my own UTC tzinfo implementation so I can get a datetime in UTC... Python's time situation is maddening and by far the worst I've worked with. I'm sure others feel this way because there are a bakers dozen of time libraries trying to fill the gaps.

I almost rage quit the industry trying to save and retrieve a UTC datetime from the database with sqlalchemy. Luckily I found Arrow and ArrowType and that's been working well enough for now.

On the subject of time this has been open for close to five years? https://bugs.python.org/issue15873 . I get the impression that lots of proposed improvements are languishing like this.

sqlalchemy and alembic feel like JUST ONE GUY is working on them. Massive achievement, but the gaps are visible.

The module system feels stale; a holdout of a system from different workflow times. Splitting stuff off into separate files for maintainability(including improving multi-dev workflows trying to reduce conflicts) creates some gross imports.

It feels like there is a reluctance to evolve the language itself; a lot of enhancements appear to be made via more magic metaprogramming and function usage. super(Cls, self).__init__() comes off as an artifact of this. Not really my cup of tea these days, but I can see how this is very subjective.

The propper way to handle generated members with pylint is supposedly a plugin; which almost no projects provide.

Type annotations are supposed to go a long way in 3.x, but the prevalence of metaprogramming and lack of tooling awareness has probably defeated more jedi than Darth Vader.

boto3 has no official async support even though lambda just released support for Python 3.6. Meanwhile the javascript sdk is shipping with TypeScript definitions and a new promise interface.

A lot of this is very subjective(other than perhaps the languishing of certain library areas) of course. To me though, after having worked with a lot of other languages, it just feels like Python is a bit of a ghetto these days. It's like the language world has built north and Python is.. Not living to the north.

EDIT: The pipenv announcement thread has some comments that go into more detail on package/project management situation: https://news.ycombinator.com/item?id=13459740 . sjellis and sametmax touch on most of the stuff I've run into.

Re:Javascript is a buffet, not the enemy [video] by blitmap on Saturday April 29, 2017 @01:21AM (#14225173)
I have for the longest time wanted to filter npm-search results by shared dependencies or licenses. Package management could be so much better.
Re:Javascript is a buffet, not the enemy [video] by krapp on Saturday April 29, 2017 @11:04AM (#14226858)
After the left-pad fiasco[0] several people mentioned wanting to develop saner package management to replace npm, then of course nothing happened, because package management is hard.

[0]https://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/

Re:Javascript is a buffet, not the enemy [video] by Can_Not on Saturday April 29, 2017 @04:43PM (#14228636)
The made yarn, which is better, but didn't they fix leftPad?
Re:Javascript is a buffet, not the enemy [video] by hiram112 on Friday April 28, 2017 @11:17PM (#14224847)
Agreed.

I must be getting old and grumpy, but I really am tired of learning 'new' frameworks and ideas unless they actually provide some sort of benefit.

For example, I started using Docker here and there. There's a bit of a learning curve and I initially thought 'how is this all that much different than running a VM or two?' Only later, when a single docker compose file set me up with a full CMS, DB, NGINX, etc. stack did I understand just how cool it was.

To compare, I've spent a few years now on various projects where the front-end guys have added all sorts of bloat - bower, then grunt, gulp, Angular, React, Browserify, JSPM, onto Webpack. Hell, it looks like npm is now being replaced by Yarn - WTF?

And the vast majority of this crap is absolutely no better for the user than the old school MVC server side template apps+JQuery that worked for years.

Re:Javascript is a buffet, not the enemy [video] by specialist on Friday April 28, 2017 @11:31PM (#14224895)
"...vast majority of this crap is absolutely no better..."

Recurring amnesia.

It's because the industry (number of programmers) is grower faster than the rate of diffusion of knowledge (experience).

Also, easier communication mediums has greatly increased the noise to signal ratio. So maintaining our BS filters requires that much more effort.

Re:Javascript is a buffet, not the enemy [video] by zitterbewegung on Friday April 28, 2017 @11:59PM (#14224972)
I have written an angular app with just angular scripting script imports. No tooling or package management.
Re:Javascript is a buffet, not the enemy [video] by alttab on Saturday April 29, 2017 @10:24AM (#14226707)
Yes but have you worked on that with 10 other developers and deployed it to multiple stages or environments for testing and then onto production hundreds of times for paying customers?
Re:Javascript is a buffet, not the enemy [video] by monkmartinez on Friday April 28, 2017 @09:55PM (#14224594)
Yes and I would add that the ecosystem practically begs devs to do this. The language lends itself nicely to these ends as well. I wish there were more options for the web...
Re:Javascript is a buffet, not the enemy [video] by ng12 on Saturday April 29, 2017 @12:18AM (#14225029)
So why don't you write something better if the shortcomings are so obvious? I'm not saying that the current popular stack (npm, babel|typescript, webpack) is the end-all solution but it's miles better everything else that came out in the last 10+ years.