The Javascript world is today's the most vibrant development ecosystem. It's popularity propelled it from a simple scripting gadget to the backbone...
For further actions, you may consider blocking this person and/or reporting abuse
I agree to some extent that some things about the JS ecosystem are a mess, but not these examples.
ES6 is now widely supported in every browser with Internet Explorer being the only exception; just take a look at caniuse.com/#search=es6, where's that "used by nobody but Node"?
Secondly: TypeScript is a complete optional language for those who want types in their JS experience and it's definitely not suitable for someone who's a complete JS beginner. And Babel, as you said, is a transpiler but it's just that, if anyone mistakes Babel as a language they need to check what Babel does. So we just have one language, JavaScript, and two versions. Any confusion with this is the same as saying: "Oh, well, I get confused with C# not having support for Generics in C# 1.0 but having them in C# 2.0!"
I don't understand why you consider that React, Vue or Angular are not optional. You can just make any kind of development with pure JS the same way you can do it with PHP. React, Vue or Angular are the same as Laravel, .NET MVC, Flask or Spring: libraries to make your life easier, but if you want you can go ahead and do it without them.
Maybe in React it's hard to start a project (though given that it's the most famous view framework right now I highly doubt that there's no project like Spring Initilizr for it), I don't have experience with it, but in Angular or Vue here's how hard it is to start a new project.
Angular:
Vue:
And voilà, you just got yourself everything you need to start developing with a nice architecture and some example files. You DON'T need to learn Node if you're developing a front-end app, you DON'T need to use Yarn (it's the same as NPM, so what's the point if you don't want?), so what's your complaint here? That you need to learn some library to use that library?
Again, I agree that some parts of the JS ecosystem are a mess, the amount of libraries that are published in NPM for such trivial things like padding a string just because the developers are lazy enough to write a few couple of lines is awful, but your complaints here seem more like a problem with not knowing the ecosystem enough rather than a problem with the ecosystem itself.
Are you joking? This is a good thing? With packages like is-odd and is-even? It's a complete and utter mess
Node isn't a language and honestly anything can do the job, once you get used to it. Node lacks a lot of things, but simplicity attracts people, not it's features or anything related to being competent or mature or anything else as language, because it's not.
This is nice indeed, but nothing that new or amazing. We were sharing code between different platforms, operating systems, etc even in the 90s and this is only how far I remember, so probably much longer.
No I'm not. I know it's a very dividing subject and I agree
is-odd
and alike are a stretch. However, modules should be trusted black-boxes. If you don't want to trust others, you still have the choice to code you own.I don't get why JS still has such a bad rap. At the same time I don't care if people like it or not. I just pick the language that allow me to do the most, and today it's JS.
No one has the truth. Every word on Internet is subjective. Moreover, once again, if JS is awesome (being true or not) doesn't imply other are not.
NPM - we all know what happened, when the turkish guy got offended and deleted his own package: qz.com/646467/how-one-programmer-b...
So about trust - you will quickly get bored of checking who you trust if you decide to inspect a more complex package. An old joke is that JS developers compete if they can build a meaningful app with less than 100 dependencies. You add 10-15 dependencies and and that quickly escalates to over 300 folders in you node_modules. So theoretically - you can, practically - no way in hell.
OK you MUST be joking this time. Right?
The "this" hell, funny features like parsing numbers in octal format by default, "funny" date functions, assuming months start from 0 etc. Yeah all of this helps the good reputation I guess.
And yes, we get around these parts by using TypeScript or literally anything else but plain old vanilla JS, exactly because of this.
Anyway, keep up the enthusiasm, and don't give up. Learn more and have fun :)
I think that you may continue to develop your applications using php or python if you like them. I've used php and I like it. I've considered also python and I like it. But I think my next project will be with Node. I love to use the same language full-stack. God bless
Well said. Its hard to judge without knowing the environment and core of language itself.
PHP can do like that because it mean to be run on server at the first place. But if you want to serve your PHP file and create a server without server like apache/engineX try that. And serve your image :)
Jorge you could do with your own choiches. There a lot of programming language. And they trying to solve some other problem that they may have. And as always God Bless
There is very little JS here, you are amazed by NPM and now.sh while most code is NodeJS's libraries, JSON or HTML.
You made a good tutorial for beginners but nothing really showing how amazing javascript can be.
Because now.sh supports other langages anyone can make the same article with titles such as "PHP is incredible", "GO is the best"...
It sure is nice to see the existence of all theese tools.
And I would love to read those articles. The fact (being true or not) that JS is great doesn't undermine other languages.
Cool guide!
I think the JS ecosystem got a lot of things really right. And it's still developing at speed. Things I like about the JS ecosystem:
npm
,npx
etcpackage.json
)There's definitely things not to love in the JS ecosystem, but that's a topic for another post :-)
Interesting article, thank you, coming from a novice JS developer.
Primarily I am a PHP developer. I prefer MPAs over SPAs. Using the right tool for the right job is important.
Personally, I don't enjoy JavaScript that much. That's just me. However I will use JS if I'm building a real-time application, or high-load HTTPS RESTful APIs. Many times JS is the perfect route to solving a problem, for me at least.
There are many places where JS excels. And places where it fails. For one, I think NPM and the libraries are a mess! So many packages. So many libraries. Some simple frameworks require 800+ packages! There are also security issues involved including SO MANY packages.
But ya know what? In the end, some of those frameworks make it beautifully easy to deploy applications, which is great. <3 (Looking at you Vue and Next.js)
Lots of upsides and downsides. Weight them out. Decide what's best for you.
I hold very strong to this opinion, that we should not be trashing tools. Programming languages are tools.
The JS ecosystem is awesome, wonderful, but bad too. Nothing is perfect. And perfection is subjective to each individual.
Thanks for that beautiful review. I wholeheartedly agree with everything you said.
Yes, absolutely and that's why I state it's awesome ... not perfect.
Well said.
+10 bonus points for being so polite
You could just start with nodejs itself without hassle if you will. Lib are just options 😊
If you want raw, keep it raw do with nodejs itself. They are just tooling same as spring you got your tooling right ahead with that IDE.
The think is that PHP run on server this makes simpler approach of serving images on server, compare it with other languange like JAVA without JAVA Spring, Or C# without ASP.Net :)
Wow that is so much work but that is probably because of all the garbage we have forced into the pile of garbage JavaScript already was. I am glad you have found something you like but JavaScript isn't the solution to everything infact it's really only good in a small group of use case scenarios. Why do we keep overengineering simple things?
You seems to have a conflicting relation with Javascript and that's alright. Of course, JS is not meant for everything, that would be bad.
The fact that JS is able to do CLI, web API and front-end scripting, all of that with the same code-base is still awesome in my opinion.
I don't know where do you see
so much work
. This article is quite long because it was aimed at medium to low level devs. The code is somewhere around 100 line of code, this is far from a lot of work.What solution would you have recommended that is less over-engineering ?
First off just want to point out that you mention that JS was created to work on the back end but unless I am mistaken it was created to make buttons work on the front end and it wasn't until node that we could use it on the backend.
Javascript is being presented as the solution to everything these days, and not only that, but it changes so much that what is new and what you need to know at this moment is outdated and not cool anymore in about 5 minutes it seems. What this leads to is people chasing after every new thing that comes out or getting frustrated and giving up. We need to help the new people instead of scaring them off which is what all this pushing JavaScript leads to. JavaScript, language we used to say was for people who couldn't figure out programming has turned into a huge complicated mess that tries to do everything and its getting harder to the point where it rivals C++ in difficulty if it hasn't already surpassed it.
How many different languages and tools and npm packages did this require, and yet your trying to convince people this is easy and aiming at new devs, and it's no wonder we scare people off.
As far as an example of an easier way of doing things here is some c# code that I found in a quick google search on how to create an png file in unity and export it. This code has 6 lines to it. I know its a different situation but still if your looking to make a png file and export it this is easier than what you did. It used only one language, no need to find and install a bunch of packages, no config files no scripts to let your operating system work with it or anything.
//create the bitmap
Bitmap bmp = new Bitmap(50,50);
Graphics g = Graphics.FromImage(bmp);
if we want to help more people become developers instead of scaring people away we need to find and show simple solutions that serve a real need not scary looking things that don't really help anyone out. We need to stop promoting JavaScript for everything because learning php for example is not hard at all infact it is super easy and most anyone can pick up the majority of it in an afternoon.
Here is a python example using the Pycairo library to create a png drawing it using vector math and then exporting it which can be found at pycairo.readthedocs.io/en/latest/t...
import math
import cairo
WIDTH, HEIGHT = 256, 256
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, WIDTH, HEIGHT)
ctx = cairo.Context(surface)
ctx.scale(WIDTH, HEIGHT) # Normalizing the canvas
pat = cairo.LinearGradient(0.0, 0.0, 0.0, 1.0)
pat.add_color_stop_rgba(1, 0.7, 0, 0, 0.5) # First stop, 50% opacity
pat.add_color_stop_rgba(0, 0.9, 0.7, 0.2, 1) # Last stop, 100% opacity
ctx.rectangle(0, 0, 1, 1) # Rectangle(x0, y0, x1, y1)
ctx.set_source(pat)
ctx.fill()
ctx.translate(0.1, 0.1) # Changing the current transformation matrix
ctx.move_to(0, 0)
Arc(cx, cy, radius, start_angle, stop_angle)
ctx.arc(0.2, 0.1, 0.1, -math.pi / 2, 0)
ctx.line_to(0.5, 0.1) # Line to (x,y)
Curve(x1, y1, x2, y2, x3, y3)
ctx.curve_to(0.5, 0.2, 0.5, 0.4, 0.2, 0.8)
ctx.close_path()
ctx.set_source_rgb(0.3, 0.2, 0.5) # Solid color
ctx.set_line_width(0.02)
ctx.stroke()
surface.write_to_png("example.png")
There is just a couple of quick examples. JavaScript sucks when you look at the alternatives.
Technically JavaScript has been a server side language since 1995 (source). Although I don't think it was used a lot up until we got node.js.
I disagree with a lot you're saying.
OK, where do I begin?
JavaScript is a language with a lot of good features. It also has some ugly warts, definitely, and most JavaScript devs really know that this is the case. The reason why JS wasn't taken seriously is not because of the language. This had more to do with browsers not running JS fast enough, computers were slower and a couple more reasons.
JavaScript, the language, has not gotten that much new features in the last few years. The features that were added are actually quite good and very useful.
So your counter example uses Unity which is a video game engine. That's sort of like saying "welding a bicycle yourself is more work than buying a car". Well duh.
😄
Ah and now we come to your Python example, yum. Don't misunderstand me, I like big parts of Python.
Now please show us how, with very little work, you can make this Python script into a CLI, a package and a deployed web app.
(hint: this is quite a bit of work actually)
OK, and by now I get the feeling you're trolling. I can't take you seriously anymore.
Well played.
All languages have a reason to exists. Monopoly has never been any good anywhere. We couldn't have Javascript without the syntaxe breakthrough of Java, without the C++ V8 engine, without the Erlang CouchDB Database of NPM ...
JS maybe's not perfect, but for newcomers I'll recommend it without hesitation (I know, I'm biased).
The complaint is that JS requires libraries and configuration and your counter-example is in a compiled language that requires an SDK and uses Unity? Wow.