[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]
4chanarchives logo

/jsg/ JavaScript General


Thread replies: 310
Thread images: 33

File: js.jpg (67KB, 640x640px) Image search: [Google] [Yandex] [Bing]
js.jpg
67KB, 640x640px
Every programmer has to master JavaScript. JS is like English, it's becoming the universal programming language. Knowing JS empowers you to build any kind of application, whether you need an app, a website or a backend infrastructure. ES6 is the JavaScript of the future, a new specification designed to make JS even more powerful. I highly recommend everyone to take some time and learn ES6.
>>
Especially now when everything is possible with NodeJS the future of all devops.

People who haven't used NodeJS are in full neglect, utnil they've tried it. I got blessed by Node a couple of months ago and I'm completely loving it. I've started to rewrite all my side-projects in javascript.

That way i can share the same language and librarys cross everything, everywhere and all the time. And it compiles on any OS since its JavaScript, which makes it superior to Haskell and C.
>>
File: dondraper.jpg (34KB, 413x395px) Image search: [Google] [Yandex] [Bing]
dondraper.jpg
34KB, 413x395px
>>54055317
>superior to Haskell
>superior to a meme language designed for academia

no shit kek
>>
I wouldn't mind learning JS to create userscripts, but I really don't like the dynamic typing and type coercive == operators.

Is there any way to enforce static typing in JS?
I don't want to learn bad habits
>>
>>54055346
Try TypeScript, haven't used it myself but supposedly it enforces type-safety.
>>
My issue is that js programmers have gotten worse over time. Relying on libraries and writing bloated and inefficient code. Alot of sites and projects that are using huge js libraries for the simplest tasks just reveal how lazy and bad the field is currently.
>>
>>54055346
Dynamic typing isn't really an issue as long as you maintain a good structure general structure of your code desu.
>>
>>54055372
So you think you are a better dev than Google engineers who made AngularJS?

Why reinvent the wheel for every single application you make?
>>
>>54055395
>why reinvent the wheel
so you can make a better wheel you fucking moron

>why do you need a better wheel my stone wheel is great
>>
File: baka.gif (731KB, 500x297px) Image search: [Google] [Yandex] [Bing]
baka.gif
731KB, 500x297px
>>54055446
Once again: you think you're better than Google engineers?
>>
>>54055446
Why can't the wheel-makers themself make the better wheel? Since they are the wheel makers after all. I'm not a fucking wheel maker.
>>
>>54055468
Why make a better wheel when nobody else makes wheels?
Why waste money when nobody else will threaten your business with an improved wheel anyway?
>>
i like it, there's always a library out there for what I need to do and saves me a lot of time and keeps me going and not wasting time on unnecessary stuff
>>
>mfw there was never a good book on JS
>not even creators understand fully this disaster of a language
>only shit stuff are popular in our world
>>
>>54055565
Then explain why it is taking over the tech world?
Already, PHP is being replaced by Node.js.
JavaScript is frontend and backend in one.
>>
Can I write javascript like C?
It's what I'm used to.
>>
>>54055468
test fakku you anders
>>
>>54055615
Why buy two dildos when you can have a double dildo?
>>
>>54055645
It's pretty much C syntax.
>>
I don't hate JS as much as I hate how common bloatfest sites are thanks to gobs of JS.

With that in mind, what's the right approach to learning JS for a guy who plans to use it only on the web front end (other tech powering back end) and wants to keep his site as light, fast, and efficient as possible, and preferably mostly functional in the absence of JS? I'd assume this means avoiding big libraries in favor of microlibraries and a higher percentage of straight JS.

Oh yeah, and how does one do front end web work efficiently without the usual long, convoluted chain of build tools?

For reference I currently spend most of my time writing Objective-C, Swift, and C++.
>>
>>54055684
I don't want to deal with garbage collection tho.
Is there anyway to avoid it?
>>
File: collision01.webm (451KB, 608x624px) Image search: [Google] [Yandex] [Bing]
collision01.webm
451KB, 608x624px
>>54055253
I agree, m8 (^:
>>
File: baitdesu.png (15KB, 200x200px) Image search: [Google] [Yandex] [Bing]
baitdesu.png
15KB, 200x200px
>>54055765
>>
>>54055458
It's more "why not build a wheel instead of kidnapping a 400 pound grandmother on a rascal scooter so you can use the wheel from that"
>>
>>54055835
The "bloat" argument doesn't even hold anymore.
With current hardware it's a non-issue.
>>
>>54055765
Use asm.js, it's a GC-free subset of JS.
>>
>>54055317

Roh oh.

Node Js...

The new Macromedia Dreamweaver... Or is that React? I need to jump off this ship... The rats appear to like this one, and have no intention of leaving first...
>>
File: koa.jpg (158KB, 602x764px) Image search: [Google] [Yandex] [Bing]
koa.jpg
158KB, 602x764px
who /stage3/ here
>>
JavaScript is fine for what it was created for -- making dynamic websites. One might reasonably argue that it's good for backend web development. Beyond that, it's a bad idea. Yes, Node.js can be used to develop desktop applications and perhaps even mobile applications, but you're basically adapting a language that was created in a few weeks, that has numerous flaws, to a task that is already being done pretty damn well by other languages.

For mobile applications, if you need them to be cross platform, Xamarin is arguably a better choice. JavaScript's type system is pretty flawed, while .NET's is rather rock solid.

For desktop applications, there are a myriad of available languages and frameworks that can beat out Node both in performance and in better high level abstractions. If you want cross-platform support, that's basically a solved problem. Qt and GTK both run on every major platform, or at least all of the ones Node runs on, and they support many more languages than just C++ (although it is worth noting that some of the best applications have been written in C++).
>>
>>54055933
Can I really develop web applications with that?
What's the catch?
>>
>>54055645
Yes you can. You can even make your own bytearray and have pointers in it. I did this when I needed to implement a custom trie datastructure.

Some code for lulz:
   while (!stop) {
var normOffset = this.data[offset]+(this.data[offset+1]<<8);
if (j > 0 && normOffset == 0) { stop = true; break }

var normForm = this.offsetToKey(offset-normOffset);
var nTags = this.data[offset+2];
var i = 0;
var tBase = offset+3;
if (tagsAsDicts) {
var tags = {};
for (i=0; i<nTags; i++) {
tags[this.data[tBase+i]] = true;
}
} else {
>>
>>54055317

>>Suoerior to C

>>Write me some embedded software in Node please!
>>Write me a kernel driver in Node please!
>>
>>54055656
Sonic sonic sonic sonic sonic sonic
>>
>>54055991
That you are developing web applications, and that you are using JavaScript.
>>
File: yablewit.jpg (11KB, 180x233px) Image search: [Google] [Yandex] [Bing]
yablewit.jpg
11KB, 180x233px
>>54055999
>gl writing a driver desu

So sick of this shit. Like all of /g/ is busy writing kernels and drivers all day kek.
>>
>>54055253
It's not so much mastering JavaScript, it's mastering the coding paradigms that JavaScript allows. This scope is enormous and encompasses functional programming, OOP, and procedural all at once. That's why everybody uses it.
>>
>>54055933
>asm.js
>you gotta install emscripten
>no compiled SDK for linux
>YOU GOTTA COMPILE IT YOURSELF SENPAI
>./emsdk install latest
It's been 15 fucking minutes and it's still compiling clang
what the fuck dude
>>
>>54055991
>What's the catch?
Interaction with dom will be harder, also you will need emscripten compiler. It's easier not to do it.
>>
>>54056063
Go back to /tpg/ you non powerhouse computer fag.
>>
>>54055999
I write my embedded code in C, but all other code I write in JS (sometimes in C++).
JS saves enormous amounts of developer time. No more segfaults, new/delete, malloc/free etc. Simple and universal datastructures.
>>
>>54055372
>being lazy
>bad
>>
I have a few questions anons. Please don't troll me. Don't tell me to install Gentoo thanks.

1) Is JS a good first language ? I already know HTML, CSS, and I learned Turbo Pascal as a kid. I also have basic knowledge of Python and Ruby but I never truly mastered any language.

2) Is it a good idea to learn ES6 directly and use it exclusively?

3) Is OP right when he says JS is becoming the universal language or is that just a meme?

4) Is CodeCademy a good place to start learning JS?

Thanks anons! I'm just a confused girl who wants to become a programmer .
>>
>>54055317
the day when some nerds realised that cpus are damn fast, they started writing servers in js... js is just a skiddie tool to hack nice features for gaymer websites that are visited by /v/
>>
>>54055372
>blah blah
It's not us, it's the market. Normies eat whatever market feeds them. 10 years it was shareware with ERROR ERROR MEMORY CANNOT BE "READ" now it's JS apps. At least there is no segfaults.
>>
>>54056108
Also I forgot to add:

5) What is /g/'s opinion of CoffeeScript is it a good idea to start using that after learning some JS ?
>>
>>54056108
1) Yes.
2) Yes.
3) If web dev is of interest to you, JS is a good language to learn. I like using Node for my local scripting needs too.
4) Dunno. I got into it through userscripts myself.

>>54056123
It's a much better idea to just use ES6 over CoffeeScript. ES6 includes a lot of the good bits of CS anyway.
>>
>>54055736
>spending time writing swift

Ouch.
>>
Teaching myself how JS really works on a deeper level.
I've always found JS exciting because it's everywhere around us.
I want to have a detailed understanding of how threads and processes are implemented.
What the network layers are about but mostly the underlying philosophy and design - how everything plays together.
What are you learning right now? #indiedev #coder #developer #js
>>
>>54055253
i program embedded devices in C
why should i need to know JS?
>>
>>54056158
Thanks! I?m excited.
>>
>>54055395
why use a wheel that has a built in commamd center? and a wheel that can only roll on perfect asphalt?
>>
>>54055926
Bloat is never a non-issue.

But there are JavaScript optimizers that remove unreachable code.
>>
>>54056108
>1) Is JS a good first language
Yes it is.
>Is it a good idea to learn ES6 directly and use it exclusively?
It's not a bad idea, there are transpilers. I don't bother much, just use some features of ES6.
>3) Is OP right when he says JS is becoming the universal language or is that just a meme?
He is right. See developer survey http://stackoverflow.com/research/developer-survey-2015
There are literally billions of JS environments on this planet.
>4) Is CodeCademy a good place to start learning JS?
People talk good things about it. I learned JS mostly myself via practical projects (code space invaders, seriously) and by reading "Javascript: The Good Parts".

>girl
-___- hope you are at least mtf girl
>>
>>54056188
Most node packages do just one thing.

That's the real reason why node developers use so many packages.
>>
>>54055458
clearly you havent been on big projects and enjoyed library hell
>>
>>54056116
You are dum-dum, anon. Slow languages are Perl, PHP, Python (previous gen server languages). JS is 10x faster than them. Just yesterday I rewrote my JS game in C++ and got only 4-5x speedup.
V8 is the most advanced compiler for dynamic language ever written. It's a fact.
>>
>>54055346
the answer is as simple as === and not writing shit code like comparing numbers to strings or making variables switch types.
>>
File: kek.jpg (13KB, 250x247px) Image search: [Google] [Yandex] [Bing]
kek.jpg
13KB, 250x247px
>>54056222
>implying Google doesn't do big projects
>>
Is there money in JavaScript or is the market over saturated since it's a front end web dev language?
>>
>>54056234
but v8 is made by google
its non free!
>>
>>54055483
Self-improvement, proper service to the customer, etc.

Anyone driven only by money and even turning down progress because it's not quite profitable enough yet is subhuman filth.
>>
>>54056123
>CoffeeScript
It's a passing fad, ES6 is better.
>>
>>54056239
But I wanna declare my own types anon.
I don't want people to make fun of me by writing
/* int */ var i = 0;
or
/* char * */ function(/* char * */ dicks) {
>>
>>54056164
I like it more than Obj-C and C++, especially the latter. C++ can get fucking ugly.
>>
>>54056267
>I don't want people to make fun of me for writing <retarded shit>

I have bad news for you anon...
>>
File: 9000atoms.webm (2MB, 560x640px) Image search: [Google] [Yandex] [Bing]
9000atoms.webm
2MB, 560x640px
>>54056181
I programmed embedded in C too, and even did some FPGAs in verilog.

If you can do that there is nothing to "learn" in js.

Just do var a = []; a.push(1); a.push(2)
Compare that with C++ std::vector blah blah that will give you
>Segmentation fault

JS is really scheme with C syntax. It's a language from lisp familia. Lisp languages are good for exploratory programming and I agree with it.

TL;DR; Write routine stuff and prototypes in JS because it is easy fast enough and saves your time.
>>
>>54056305
thats pretty cool anon
>>
>>54056247
It's BSD-free, anon. It's even freer than GPL stuff.
And if you don't like that implementation there is SpiderMonkey, JavascriptCore and ChakraJS, all under BSD like licenses as well. And then there are dozens of minor implementations...
>>
>>54056108
>4) Is CodeCademy a good place to start learning JS?
Codeacadamy describes the process of riding a bike, and points out the different parts of the bike to you. It lets you ride for a few seconds, but it never lets go of the back of the bike.

This all gives you a false sense of accomplishment while not actually teaching you anything. You'll most likely finish your course on codeacadamy, and then be completely incapable of sitting down in front of an empty IDE and writing something useful. Because you never learned how to solve problems or think like a programmer, you were just shown the syntax.

Find tutorials that walk you through building some kind of practical project. The only way to learn is to do. Eventually when you think you've got the syntax down, try making something yourself. Find out how to research solutions to your problems and apply them, this usually involves reading stackoverflow.
>>
>>54056337
Thanks anon. I want to develop this thing further. Physics is fun.
>>
>>54056363
how long did it take you?
>>
>>54056222
Clearly all the projects you worked on were a total fuckup.
>>
>>54055955
>ES6 import statements
I use node's require() syntax, because ES6 modules aren't implemented yet and it'll just get transposed to require() anyway, so I might as well write what's really going to be in the code.

I also use a lot of promises, haven't used async-await yet, but promises are gud.

Also waiting for proper tail call optimization to land because recursive functions are fucking pro. I know TCO is available as a node harmony flag, but I won't use harmony flags in production. 1
>>
>>54056239
>or making variables switch types.

That's the whole problem.

When you write something like
const concat = (string1, string2) => { return string1 + string 2; }

Then there is nothing stopping you colleague from fucking up by writing:
concat(2,4);
>>
File: boxy3.webm (657KB, 512x592px) Image search: [Google] [Yandex] [Bing]
boxy3.webm
657KB, 512x592px
>>54056385
Time to first demo was 3-4 days, then I lazily optimized performance for some weeks. If I wrote it in C++ it would have taken at least 3x more time.

You can google "Verlet integrator" it's not that hard.
>>
>>54055645
actually
http://asmjs.org/
>>
>>54056509
i'm not using any flags or any runtime transformations in production, that would be stupid. i have a build step that compiles everything to plain old es5 which i then run with node. babel does the transpiling and it works great. i even have source maps in place so whenever something goes wrong i get a nice clean stack trace with my original code.
most es6/7 features are bullshit. the only thing that i'm really in love with is async/await.
it absolutely kills the need for callbacks or any sort of nesting. i work with plain es5 and express in my day job and it's a nightmare. i'm playing around with koa on es7 right now and it's a joy, the code is absolutely flat and clear. no need for constant error handling because it just throws an exception that you can easily catch (unlike callbacks).
plain promises aren't enough in most non trivial cases, you will still end up with pyramids, sometimes it'll even be worse than callbacks because it becomes unreadable.
>>
>>54055253


>learn front end "web dev"

Fuck off anon. If I wanted to make $40k as a web designer I'd follow your faggot advice
>>
>>54056509
is
var x = require('x');
the same as
import x from 'x';
?
>>
>>54055372
This is mainly a front-end problem. Because in this field it seems that "front-end developer" actually just means "entry-level fuccboi who doesn't know what he's doing", despite the fact that front-end can be really hard to do well.

My boss has been looking for a DECENT front-end dev since November because he has standards and there's too many useless shits who suffer from the problem you mention.

Like we had an application from a 'mobile first' guy, who's portfolio site had a 3mb page weight, and was stacked with meme frameworks and oversized images to make it look pretty.

The problem is that developers usually have a fucking private lease line pumping pure uncut internet directly into their faces while they design sites on their 4k retina displays. So they lose sight of the fact that websites should be lightweight and performant instead of being full of janky gimmicky bollocks and fuckloads of libraries.

I do backend though, so I can pretty much import what I want so long as I don't left-pad myself.
>>
>>54056600
All the good web developers work freelance.

Normal rate is 90 euro's/hour.
>>
File: kingseeker frampt.jpg (164KB, 900x900px) Image search: [Google] [Yandex] [Bing]
kingseeker frampt.jpg
164KB, 900x900px
>>54055372
it really depends on the project. for example there are two libraries i always use because i know they work and are optimized. lodash and jquery.

my last big project was a angular website. and i used lodash for formating data, jquery for interactivity and angular for data binding and routing. also express for a rest api and backend stuff like pulling data from sources.

this is pretty much standard practice.
why reinvent the wheel when someone did a good job for you.
as a developer you use X tool to proved the best result Y in the shortest amount of time Z.

i do agree however that keeping files small or using async loading or module loaders like webpack are essential for fast and responsive websites.
>>
>>54056600
webdevs nowadays make more than C developers.
as freelancer you can charge a lot of cash.
>>
>>54056572
I use promises at work, its actually pretty good. But I haven't tried async/await.

>plain promises aren't enough in most non trivial cases, you will still end up with pyramids, sometimes it'll even be worse than callbacks because it becomes unreadable.

It can be alright because you can return promises from functions and pass them around inside of other promise chains.

Though there is a situation right now at work where we have a nested stack of promises, because we're doing sequential writes to various APIs and databases, and if any part of the process fails we need to throw an error and make sure that we unroll and undo every promise we've resolved up to that point.

I understand why it was originally written like that, since if there's an error inside the nested structure, it'll trigger the catch of its parent, and then you can rethrow and trigger the catch of the next parent, etc and each nested layer is responsible for unrolling and undoing its own part of the process. It would work perfectly if it were actually implemented consistently, but it wasn't so there's one edge case where it doesn't unroll part of the process and we have to fix stuff manually, so I've been tasked with rewriting the whole thing.

When I rewrite it, instead of the nested promises (which is gay to deal with), I'm just going to have one promise chain, but push the rollback functions to an array as the database writes succeed, and then iterate over the rollback array and execute the functions if something fails at any point. It should flatten the structure out quite nicely while achieving the same result.
>>
What the fuck is left-pad and why does every web-dev latte-sipping fuccboi use it in all their websites?
>>
>>54056600
do you honestly think you will only need 1 set of tools for the rest of your career? i work as an engineer in a large tech company, i've done anything from shitty c++, tcl and perl, to java, python, and now node.js and even front end web dev. in the real world demands constantly change and a good developer is someone who is constantly learning new things. but enjoy your rupees i guess
>>
>>54055792
What did you use for that?
>>
>>54056632
>tf now javascript fuccboi bf
;_;
>>
>>54056820
No foreign code at all, I wrote everything myself from scratch. Rendering, physics, everything.

I'm hardcore (^:
>>
>>54056807
>Though there is a situation right now at work where we have a nested stack of promises, because we're doing sequential writes to various APIs and databases, and if any part of the process fails we need to throw an error and make sure that we unroll and undo every promise we've resolved up to that point.
that's very common. if you need the closure, you will need to nest. nesting promises inside promises is nasty. there are always workarounds but it's never pretty. async/await is basically just syntactic sugar for promises. you always await a promise. and async always returns an implicit promise. look at the code above to see how easy it is to write sequentially. and if i need anything collateral etc i can just use await Promise.all([something(), somethingElse(), ...]). i am not looking back tbqh. i hope i can get my colleagues to agree to use babel.
also it sounds like you might have chosen the wrong db for the job, sql can do rollbacks easily.
>>
C++ is the english of programming languages

Javascript is like the arabic. It's only useful if you want to commune with people whose goal in life is to make the world infinitely worse.

>Sysadmin: someone set us up the poor performance!
>Sysadmin: htop turn on!
>OCTOCATS: greetings gentlexhirs
>OCTOCATS: all your programs are webpage with bundled webkit
>OCTOCATS: you have no chance to security. enjoy your UX.

Take off every rust
For local programming
>>
>>54055346
Typescript is javascript with static typing which compiles down to javascript, so you get typing errors while compiling but it runs just like any javascript file.
>>
>>54056860
That must have been quite a few hours of work.
>>
File: canweaffordit.png (82KB, 218x394px) Image search: [Google] [Yandex] [Bing]
canweaffordit.png
82KB, 218x394px
WebAssembly
>>
>>54055955

If the values in those async blocks are already the RHS assignment of 'const', then why are you using 'const' const at block level too?
You have no answer for that, do you? ES6... Might well end up with more illegible crap than JS in the hands of Java devs already produces.
>>
>>54056180
fuck off with the hashtags
>>
It's been 2 hours and it's still compiling fucking clang.
What the fuck dude. I can't even try out asm.js until this finishes up.
>>
>>54056864
>that's very common. if you need the closure, you will need to nest.

You can pass values through promise chains from previous promises quite easily, it should be possible to do it without nesting.

>also it sounds like you might have chosen the wrong db for the job, sql can do rollbacks easily.
We use CouchDB for permanent storage and Redis for caching. The rollbacks are quite easy and they work 99% of the time, Its just one specific rare edge case where it doesn't work. Fixing that one edge case requires rewriting the whole function, which was just over the threshold of effort until now, because some other stuff got put on hold, so we (or I) now have time to do it.
>>
>>54057001
Doesn't 4chan support hashtags ?
#confused
>>
File: scr2.png (86KB, 908x934px) Image search: [Google] [Yandex] [Bing]
scr2.png
86KB, 908x934px
>>54056820
If we talk about math then I used matrices, and quaternions. For physics I used verlet integrtator with rigid constraints. For collision detection I used bucket-based spatial hashing. For rendering I used 2d canvas (3d is purely software via camera transform).

Actually it started as a port of my earlier common lisp program..
>>
File: crockford.jpg (87KB, 1280x720px) Image search: [Google] [Yandex] [Bing]
crockford.jpg
87KB, 1280x720px
What do you fine anons think of Douglas Crockford's plan to replace the World Wide Web with secure Javascript applications over TCP, running on Node and Qt, and using the actor model?

short intro video
https://www.youtube.com/watch?v=FHRXPlq9XNw

long video
https://www.youtube.com/watch?v=0w6tZEbrHIY1
>>
>>54055317
This reads like an occasional post on HN.

If it's package management (npm) wasn't so fucked up piece of shit, I would perhaps try it, but so far, all my attempts ended with rage. It's just pointless masturbation over fast VM (V8). For throwaway scripts there's Bash, Zsh or Perl and its VMs are fast enough.
>>
>>54056921
If he didn't one node faggot pulling his elementary module would have broken everything ala leftpad
>>
File: 1453985167815.gif (2MB, 235x240px) Image search: [Google] [Yandex] [Bing]
1453985167815.gif
2MB, 235x240px
>>54055792
>>54057101
Thius is damn pretty and interesting though! True, visualization and GUI is what JS&HTML is probably good at.
>>
>>54057156
it's better to just trash the "web" entirely and use a single language for layout, text and image content, and behavior before doing that

if fucking emacs can do it, anyone can.
>>
>>54057215
That's basically the plan.
>>
>>54057225
I mean a language that isn't javascript.
>>
>>54055955

I prefer using promises/generators over async/await because sometimes I want to push back information into the yielded generator functions.

Async/Await only allows you to receive data. So I avoid it.
>>
>>54057164

Tbh... NPM is extremely good. It's the lynchpin of the whole NodeJS movement (like Ruby Gems). Also, V8 is a very good feature if you know C/C++. But the current political war raging over Javascript in general right now... Awful, awful shit. AngularJS... A piece of shit, forced onto a large community by a large company. ReactJS... A piece of shit forc... You get the point.
>>
>>54056082
>implying you can't simplify those complexities with a nice homebrewed C library
wew lad
>>
File: goodparts.jpg (99KB, 1024x576px) Image search: [Google] [Yandex] [Bing]
goodparts.jpg
99KB, 1024x576px
>>54057236
Javascript is a good language if you avoid 90% of it.
>>
>>54055253
I've used JS for web pages and I have toyed with NodeJS, but how would JS ever replace languages like C++ and Python with their huge math libraries and high performance?

JS outside of web stuff seems like a meme to me.
>>
>>54056082

This guy gets it.
But don't worry. Soon, ES6 will turn JS into an absolute mess, like C++. Except everything will run much slower, and bypassing the ES6 standard to write fast code will be seen as a cowboy practice.
>>
>>54057291
NPM is extremly awful. It's built around the idea that you copy single exact version of every library you use into your project instead of having moving heads of system/user/... global libraries just like what you get with apt, yum/dnf, pacman, ... It's not new but it's plain retarded.
>>
>>54056082
a lot of things do everything in that second line

common lisp does it (better) and is far older than js

it comes down to few programmers of average intelligence being unable to escape the paradigm of ALGOL-like syntax, so no cohesive community with community standard can develop around lisp, dooming it to clever hacker hell.
>>
>>54057349
>>54057291
Compare with Perl:
  @INC:
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
.


and you can change it via environment variables.
>>
>>54056678
>>>54056600 (You)
>All the good web developers work freelance.
>Normal rate is 90 euro's/hour.

All the good web developers have full time jobs.
>>
>>54057291
Er no. npm is a pile of shit. None of the packages are namespaced, left-pad incidents happened before left-pad happened, they just weren't as high-profile. And right now the only thing that is supposed to prevent another left-pad is a policy where npm assumes ownership of unpublished modules.

Every complaint about Node is usually a complaint about npm doing something stupid. Try using it on Windows, install some dependencies, and then try to delete the node_modules folder... except you can't because npm built a recursive filestructure of interdependent modules in there, that results in filenames longer than 260 characters, so Explorer can't delete them anymore and you have to get rid of them with powershell. Granted you shouldn't be developing on Windows ever, but its still fucking stupid.

>But the current political war raging over Javascript in general right now

Javascript has always been in the middle of wars between big companies. Why do you think its called Javascript? That name is still technically an Oracle trademark.
>>
>>54057326
It is a meme, Ryan Dahl (creator of nodejs) realized it in 2012 and wrote a rant that he later removed because of the backlash. Hundreds of thousands of developers only know JS and they created a stack worse than Sepples and it continues to get worse since the enterprise developers joined the cult of shit.
>>
>>54057430
Where can I find his rant?

JS is just a scripting language, so I don't see why people are trying to make everything work with it.
>>
I mostly do C,C++ and Java programming.
Recently,I learnt method invokation through REST links in android and that sparked my interest in JS.
What's a good place to start learning JS?(Prefereably a book) and how long will it take to learn enough so that I can build my own RESTful API?
>>
>>54057262
can you give an example to this scenario?
>>
File: Screenshot (102).png (283KB, 1657x835px) Image search: [Google] [Yandex] [Bing]
Screenshot (102).png
283KB, 1657x835px
>>54055955
It's magical. I rarely indent more than once or twice anymore. async/await and higher order functions make programming fun again.
>>
>>54057156
The Internet should be replaced by the blockchain
>>
>>54057208
JS is surprisingly good at numerical computing. It has double and is high-performance. See http://playground.tensorflow.org/
>>
>>54057295
How do you make a universal hashtable in C? I have written one, and it requred macros for every separate datatype. In JS it just works automatically. With hastables and arrays you can do whatever you want with data. Add lodash and you will be 5x more performat (time-wise) than with any C libs.

Say honestly anon, do you really like debugging segfaults?
>>
>>54057430
>Hundreds of thousands of developers only know JS
And they refuse to learn anything else, as if learning a new programming language is hard when you already know one (it's not) and act as if there's a vast chasm between Javascript and other languages in terms of difficulty (there's not). They have no notion of tool appropriateness and just use JS wherever they can with no regard to the consequences (see Electron based text editors eating 350MB doing nothing).

It's infuriating. Nobody tries to hammer the square pegs of C++, Python, Haskell, etc into the round hole of the front end web, so why must JS nuts try to force their shit everywhere?
>>
>>54057326
node.js has better performance than python. it will most likely surpass java in the coming years.
>>
>>54057565
>It's infuriating. Nobody tries to hammer the square pegs of C++, Python, Haskell, etc into the round hole of the front end web

WebAssembly is coming, so soon they will try.
>>
>>54057484
>JS is just a scripting language
How to spot someone who doesn't know Javascript.
>>
Javascript is chock-full of issues and questionable design decisions. Can anyone give me a convincing reason why the language lacks native integers?

>inb4 why use a 32 bit int when you can use a 64 bit float
>>
>>54057600
And I will most assuredly compile a blacklist of sites that use it. Websites do too much already, the last thing I need is sites loading a near-equivalent of native binaries without my permission.
>>
>>54057516
dis nigga knows what's up
smash dat mf like button
>>
>>54057363
I was a Common Lisp fan, but then I got tired of it. Too much fighting with library infrastructure, also for my numeric things it wasn't the best thing. Ofc I could implement a infix expression parser but it required debugging etc.

Now I think algorithms are more important than programming languages, a good language should just work. JS just werks.

>it comes down to few programmers of average intelligence being unable to escape the paradigm of ALGOL-like syntax, so no cohesive community with community standard can develop around lisp, dooming it to clever hacker hell.
blah blah, these things old quickly. The new frontier is numeric applications, machine learning. Programming languages aren't as important anymore. Maybe for some domain-specific tasks lisp-style DSL still rule, but I'm not interested in it anymore.
>>
>>54056530
True, but that's basic design by contract. Fail to pass in the contracted data (strings) get undefined behavior. Garbage in garbage out
>>
>>54057669
there are static type checkers for JS, like flow
>>
>>54057669
Sometimes it even helps, it's cute. JS-chan tries to execute my programs no matter what! So stubborn! :3
>>
>>54056717
>lodash
>jQuery
>angular
Ugh. That code must be ugly. Just still with angular and use es5 instead of lodash. jQuery is like old yeller that needs to be put down.
>>
>>54057598
[citation needed]

Where are the libraries? What is the JavaScript equivalent of numpy?

>it will most likely surpass java in the coming years.

First of all, this is insane because Java is a totally different kind of language, so JavaScript can't displace Java from its niche. Secondly, JavaScript would have to go from #8 to #1, and Python is #4. JavaScript would have to take territory from almost every major language to displace Java, which isn't going to happen.

You are smoking memes friend.

>>54057614

I do know JavaScript though. I just finished taking a course in it and building a website with it. I've also compiled stuff with NodeJS.

It's only used as a fucking scripting language.

https://en.wikipedia.org/wiki/JavaScript#Uses_outside_Web_pages
>>
>>54057363
>it comes down to few programmers of average intelligence being unable to escape the paradigm of ALGOL-like syntax, so no cohesive community with community standard can develop around lisp, dooming it to clever hacker hell.

I don't think syntax is as important. The only thing CL has that JS lacks is macros. I can live without them desu. Higher order functions and dynamism are still there, these features I consider important. JS is a lisp for mainstream
>>
>>54055253
Guys I just wrote a kernel in JS. This is so webscale and 10x. I can't wait to boot it. I just have to figure out how to get NodeJS to run on bare metal.
>>
>>54057504
>What's a good place to start learning JS?(Prefereably a book) and how long will it take to learn enough so that I can build my own RESTful API?
JS the good parts

To make an API just find express.js hello world. You will do it in under an hour.
>>
>>54057728
>Where are the libraries? What is the JavaScript equivalent of numpy?
You are right that JS doesn't have what scientific python has. But it didn't stopped high profile people from implementing state of art machine learning in it (for fun), see
http://cs.stanford.edu/people/karpathy/recurrentjs/
http://cs.stanford.edu/people/karpathy/convnetjs/started.html
http://cs.stanford.edu/people/karpathy/reinforcejs/puckworld.html
>>
>>54057728
>can't google benchmarks where nodejs is eating python
>can't google case studies where companies have dropped java as a backend for node.js and gained performance
>makes up arbitrary rankings of programming languages
>doesn't understand the difference between performance, popularity, and ecosystem
>knowledge in JS: build a website
>"""compiled stuff with NodeJS."""
yeah naw opinion completely disregarded
>>
>>54057749
https://node-os.com/
>>
http://www.haneycodes.net/npm-left-pad-have-we-forgotten-how-to-program/

>those fucking comments

these stupid webdev faggots literally do not trust themselves to write a trivial left padding function so their entire project consists of over 25,000 dependences.
they have the gall to call an isArray function "low level"
>>
>>54057810
Okay, no citations. I'll assume you're full of shit then.
>>
>>54057504
i was a complete noob and in under 2 weeks i read
>javascript the good parts
>node.js in action
(in that order)
it should get you up and running straight away
>>
>>54057813
What the fuck.
>>
>>54057801
How else were they going to get it to run on a web page? JS is great for that.
>>
>>54057836
no one here owes you shit, either go study the facts yourself and come back to this discussion with actual knowledge or gtfo. you are clearly a complete noob and you're making an ass out of yourself.
>>
>>54057813
What a fucking abomination.
>>
so why is javascript bad?
>>
>>54057866
I've actually read on reddit about JS getting kicked out of the back end for being slower than Java, so I have no reason to believe any of your assertions.

You're no different than a fundie creationist if you're going to make assertions without evidence.
>>
>>54055253
NodeJS is a golden hammer.

https://en.wikipedia.org/wiki/Law_of_the_instrument
>>
File: baxterx910_0_0.jpg (222KB, 910x1259px) Image search: [Google] [Yandex] [Bing]
baxterx910_0_0.jpg
222KB, 910x1259px
>>54055253
JS is cool because programming should be easy & powerful. There is a need in standard fast, expressive dynamic language. It's time to stop bitching about programming languages and solve the world's problems with programming.

The more you automate with code the less work you have to do. Do it on global scale and you have post-scarcity.

Imagine a scenario where almost everybody knows JS and there are cheap robots available. These robots contain special hardware and a dtandard library for computer vision, voice recognition, object manipulation, machine learning etc written in C, but everything can be accessed via JS-api. Using their JS skills ordinary people could buy these robots and quickly automate >90% of all menial labor. We could literally live in utopia.
>>
>>54055253
FUck off OP. I have written better Javascript than you can ever hope and even I know it's god awful SHITE
>>
>>54057824
I don't think that using left-pad someone else on the Internet wrote is wrong in itself. It's wrong in current time with available means of sharing. But in ideal world all code would be single code base. People use big utility libraries with hundreds of such trivial functions to use one or two of them and it didn't hit the news yet.
>>
>>54057956
Name a better
>standard
>fast
>functional
>dynamic
language then

You probably can't satisfy all 4. And I haven't even added
>has lots of libraries
(^:
>>
>>54057622
Seriously, why is it this way?

Even if you are okay with wasting memory for literally no reason (it's cheap nowadays, it's not that big of a deal but it's also not really an excuse), this causes more insidious problems. A real dynamic language would convert to arbitrary precision if needed, or at least fail loudly. Javascript is content to just be a inefficient and unsafe mess.
>>
>>54058039
Having one universal number type may be a pretty good idea for a dynamic language. JS probably borrowed it from Scheme (scheme has "numeric tower").

Again, JS is just scheme for mainstream.
>>
JS/ES6 is the Master Race of all programing languages other languages should be gassed and genocided to be honest. We don't need Python and Ruby anymore because we have node.JS. Seriously people who code in Java and C++ should just kill themselves.
>>
>>54057972
How is Javascript a functional language?
>>
>>54058073
>Seriously people who code in Java and C++ should just kill themselves.

Including V8 devs? (^:
>>
>>54058081
-____-
it has closures and higher order functions, obviously
>>
>>54058082
Yep, they should be gassed with ZyklonB.js
>>
>>54058064
Scheme's representation of numbers is a lot more sophisticated than "everything is a 64 bit float"

Scheme has a native notion of exactness. Maybe I'm just ignorant, but as far as I know javascript does not.
>>
File: 1459368302900.gif (253KB, 393x130px) Image search: [Google] [Yandex] [Bing]
1459368302900.gif
253KB, 393x130px
>>54057972
Common Lisp (SBCL = 30-40x faster than Javashit)
Scheme
Smalltalk
Perl
Clojure
…the list goes on
>>
>>54058214
lmao @ your meme languages
i bet you have a chinkpad
>>
>>54058081
function byProp(prop) {
return function getProp(item) {
return item[prop];
}
}

var arrOfObj = [
{id: 5, price: 2},
{id: 2, price: 6}
];

arrOfObj.sort(byProp('id'));
>>
>>54057404

Interesting points. It good when someone can argue a case. Rare on /g. Npm leveraging GIT is still admittedly cool though. The url length thing is stupid though, for sure. Namespaces and duplicated dependencies are also quite, quite stupid. I'm sure they'll want to fix both of those issues.
>>
>>54058332
>attacks character
>even spouts the word "meme"
>argument collapses
>>
I just ran a memory intensive hashmap test suite in asm.js, and it performs surprisingly well.
native C completes in 7 seconds, while the .js bytecode finishes in 20 seconds.

How does one actually write non-trivial software with asm.js?
If emcc is supposed to be a drop-in replacement for gcc, why can't I compile any of my C programs that use external dependencies?
>>
>>54057516
>being async/await fuckboi instead of using monadic combinators
>>
>>54058374
stop making shit up
>>
>>54058214
>Common Lisp (SBCL = 30-40x faster than Javashit)
Nope, it's only 2x faster when you add (declaim (optimize and type declarations everywhere. Why not write in C or asm.js then?

In my benchmarks unoptimized js (V8) was several times faster than unoptimized Common Lisp (SBCL) code.

>Scheme
>Smalltalk
>Perl
Slow, lack well-defined standard. Schemeland is a zoo. Don't remember STALIN, you won't be able to compile it anyway.

>Clojure
This one counts, but it has it's stupid design decision and performance is worse than java.
>>
>>54058374
>tfw no javascript fuckboi bf
>>
File: IMG_0023.jpg (472KB, 2049x1536px) Image search: [Google] [Yandex] [Bing]
IMG_0023.jpg
472KB, 2049x1536px
>>54055253
> js
lol wtf are you doing op?
>>
>>54058362
>If emcc is supposed to be a drop-in replacement for gcc, why can't I compile any of my C programs that use external dependencies?
You should be able to. People ported Quake 3 to it, etc.
>>
>>54055253
2016, still using java. Kek.
>>
GTFO Shill
>>
>>54058448
Your body is disgusting and you should be ashamed of your hideousness.
Here your (you)
>>
So where the good books for node?
>>
>>54056239
>or making variables switch types.
How is this "shit code"? It's basic fucking functionality.
>>
>>54058521
People don't have much choice about their bodies yet, anon. You are unfair.
>>
File: 1460249395364.gif (45KB, 499x499px) Image search: [Google] [Yandex] [Bing]
1460249395364.gif
45KB, 499x499px
>>54058412
>muh arbitrary benchmarks

K E K
E
K

Post the CL code. I'm itching for a good laff.
>>
What are a few books for learning JS and JQery?
>>
>>54058450
Apparently, the way to use external libraries is to compile them yourself using the helper programs "emconfigure" and "emmake".
It's all a hackneyed pile of crap and I couldn't even get openssl to compile correctly with or without their python scripted hackjobs
>>
>>54058713
*couldn't even get openssl to compile to emscripten .bc format
>>
>>54058643
You will google the code (^:
It's just some numeric code with 3d vectors represented as lists.
>>
>>54058521
Just because of the hair? lol fuck you, suck my hairy dick.
>>
>>54058713
WebAssembly will be a better compiler target.
>>
>>54058752
>he owns a mac
>doesn't even shave his legs

you're doing it wrong anon
>>
>>54058750
>It's just some numeric code with 3d vectors represented as lists.

Yeah, there's no way the Javashit version of this would be faster. Unless you don't know how to use sbcl flags.
>>
>>54058073
I'm a JS babby myself, but cmon V8 is built in C++.
>>
>>54058788
No gf, no shaving.
>>
>>54058856
that's the spirit lad
>>
>>54058856
>mac owner
>gf
who you tryna fool, buddy?
>>
>>54058918
so what if all my gf's had a penis? If it wears a skirt it's a girl r-right?
>>
>>54058970
duh
>>
>>54058856
>No job, no shaving.
ftfy anon.
>>
>>54058856
I'll be your fuckboi, anon
:^)
>>
>>54058856
>no shaving, no gf
>>
>>54058800
I'm not an expert, but I used declaims and types.
Javascript could be faster because I represented vectors as arrays in it, and it's good at optimizing numeric codes without any flags.

V8 is simply superior. Too much money and engineering has been poured into it.
>>
>>54057937
But there's nothing that says the JS has to be the language to facilitate this or that it's the ideal language for such a purpose. There are lots of reasonably fast, easy to pick up languages with a low barrier to entry that could do the job just as well as JavaScript. While tunnel-vision on a single language like that? It's like eating nothing but bananas when you're surrounded by bushel-baskets full of every fruit you can imagine.
>>
>Moore's law is kill
>market demands performance
>companies fire all the js fags
>resurgence in compiled languages to keep up with demand

Learn Go, x86_64 Assembly and C and then come back and try again.
>>
>>54059205
will you code on my lap in a skirt and shaved smooth legs that I can molest?
>>
File: nodejs.png (169KB, 932x558px) Image search: [Google] [Yandex] [Bing]
nodejs.png
169KB, 932x558px
>>54057598
No JavaScript framework will ever be faster than the fastest NIO Java frameworks, ever. So fuck off and stop spreading bullshit.
>>
>>54059499
2bh, I think languages should converge on 2 main ones: one for low-level/system stuff (let's say C++) and one for higher abstraction stuff (let's say an improved JS, which has optional typed objects and other nice things which are coming in ES7).

Imagine how much time we would be saving if you didn't have to learn a fuckzilion of languages, just to get shit done. Why do we even need PHP, for example, when the same things can be done in a future JS?

I think the proliferation of programming languages has been detrimental to the world of IT, slowing things down and making things unnecessarily complex. Better invest that mind resource in developing better algorithms than learning 5-6 languages for one stack.
>>
>>54059871
You do realize literally no one programs in x86 assembly? It's not even designed to be used by humans.
>>
>>54060090
the thing these morons don't realize is that assembly is a little simpler to grasp and do something in than in programming languages with hundreds of abstractions and methodologies. it's like a downs kid bragging about being better at making play doh homes than you rofl
>>
>>54060156
working in x86 asm is fucking retarded though, it's a dogpile of shit piled on top of shit
it's not say, 68k asm, where you could pretty easily just get shit done
>>
>>54060046
>one for low-level/system stuff (let's say C++)
For some purposes even C++ is too fat. For those cases, only a subset of C++ (embedded C++), C, or assembly will work.

The reason a cornucopia of languages exists is largely due to the staggering array of differing requirements out there, many of which are specific to particular domains. It's extremely difficult to build a good wide-scope/one size fits all language. It's much more practical to just create the right tool for a specific job ("do one thing well").
>>
File: DSC05838a.jpg (67KB, 771x500px) Image search: [Google] [Yandex] [Bing]
DSC05838a.jpg
67KB, 771x500px
>>54059499
>But there's nothing that says the JS has to be the language to facilitate this or that it's the ideal language for such a purpose.
JS is already a widespread standard with several performant, well tested implementations that run on billions of devices!

>There are lots of reasonably fast, easy to pick up languages with a low barrier to entry that could do the job just as well as JavaScript.
Python could be used for that purpose but it doesn't have a reliable standard, there is only one high perf implementation and it's not well-tested. It's not that good a language (crippled lambdas). Scheme could be used but it's a niche language.

>While tunnel-vision on a single language like that? It's like eating nothing but bananas when you're surrounded by bushel-baskets full of every fruit you can imagine.
I have written some code in Asm,Verilog, C, C++, D, Pascal, Java, Perl, Ruby Matlab/Octave, Lua, ML, Scheme, Common Lisp and JavaScript. JavaScript is honestly not that bad. It's good enough, fast and widespread.

You see, I have grown past memeing about programming languages. I'm much more interested in witnessing >>54057937 post-scarcity future than arguing about languages.
>>
>>54060046
2bh I think we need one wide-spectrum language that can achieve C/asm-like performance with type decls, and JS/V8 like performance for standard usage. Asm.js in JavaScript world and Numba in Python world are flawed implementations of this concept.

>Imagine how much time we would be saving if you didn't have to learn a fuckzilion of languages, just to get shit done
Totally agree. There is too much languages.

>Better invest that mind resource in developing better algorithms than learning 5-6 languages for one stack.
Exactly that. In fact it's already being done with machine learning. Hand-written software will be less and less important as the time moves forward.
>>
Lads, what should I be learning, React or Angular 2?
>>
>>54060506
React won.
>>
>>54060506
I'd say both, you can never learn to much JS.
Start with Angular though.
>>
>>54060327
>It's extremely difficult to build a good wide-scope/one size fits all language.

Common Lisp was almost like this but it was too insulated in it's own small ecosystem. In reality a combo of C and some fast dynamic language (a luajit, for example) works good enough.
>>
>>54059871
You have a point but Go isn't much faster than Node.JS at that point.

Rust is better for safety meets high perf.
>>
Fuck off with all the generals
>>
how do i trigger a func2 after func1 is called without modifying func1
>>
>>54060638
if (func1())
func2();
>>
File: 1460368551599.jpg (30KB, 472x461px) Image search: [Google] [Yandex] [Bing]
1460368551599.jpg
30KB, 472x461px
>>54059871
This desu. v8/chakra/spidermonkey still lags far behind the JVM and the JVM lags very far behind compiled code. And if you cite little toy benchmarks, you're retarded.
>>
it'll be at least 5 years before es6 is supported without transpiling by all major browsers. get fucked faggot.
>>
>>54056045
I actually do though...
I am writing a kernel driver as we speak C.
Get tossed.
>>
>>54060805
>far behind
>literally 2x
>>
>>54060807
By then, we won't be using web browsers to run programs anymore. The browser will return to being for hypertext documents. This whole "web app" shit is a stopgap before a new app store-like platform takes over.
>>
>>54060817
Why not write it for non-shit CPU then. At least write it for RISCV.
>>54060807
>Implying I program a browser
frontie ;3
>>
File: 1460245299471.png (144KB, 500x500px) Image search: [Google] [Yandex] [Bing]
1460245299471.png
144KB, 500x500px
>>54060828
>thinking 2x isn't a lot

What happens when my JVM-powered(TM) self driving car takes 2x longer to move out of the way of a runaway vehicle?

Don't be a child-killer. Use C++.
>>
>>54060854
I use C++, m8
It's almost not worth the rewrite. Could as well rewrite only a hot part.
>>54056234
>>
>>54056979
Are you implying (s)he should use "let" or "var"?
>>
>>54060930
That's the best way to do big programs. First write most of it in a easy dynamic language like Python or Lisp and then, as it becomes necessary, incrementally replace parts with C++.
>>
>>54057813
>node-os is the first operating system powered by npm

jesus christ
>>
>>54055317
>librarys
kill yourself
>>
>>54055792
>using the backward smiley with a carat nose
>>
>>54059205
>using the smiley with a carat nose
>>
Seruous question: how do I learn JavaScript? My only programming experience is MATLAB in egr 110 and Java 101 which I failed 4 years ago because I was depressed. I'm fairly tech savvy and use arch as a daily driver on my laptop. My buddy who actually is a current working developer told me to just actually learn programming since I already know everything else about computer technology.

So, where do I begin?
>>
>>54058551
It allows for sloppy code. Strong typing means a variable is only ever one thing. When a variable could be a string, an int, or an object then any code dealing with that variable has to account for all cases.
>>
>>54061630
code academy, lynda, youtube, etc.
>>
>>54061630
press F12 in chrome, open the console, and start calculating. go to MDN to learn about basic types (Number, String, Object, Arrays)

read up on html Canvas to start drawing shit
>>
>>54061630
http://jsforcats.com/
>>
>>54061778
Strong typing doesn't help you shit when you expect user input.
>>
>>54063390
You expect something other than a string or predetermined options?
>>
>>54063417
You don't want your code to fuck up because the user decided to be a dunce and typed in an integer
>>
>>54063429
yes?
The integer is a string, still.
>>
Shitty script, weak and abominable grammar. Illogical exceptions. Horrible opacity. Neither easy to learn, nor master. The only reason to interact with it is a Superb DOM, universal availability. In short, exactly like the English language and it's promise of universal communicability.
>>
>>54063390
This is fixed by sane UI toolkit designs. Example: under AppKit and UIKit (OS X/iOS), everything typed into text fields are strings, even numbers. The only way you can change this is by attaching a formatter (for example, a number formatter) which will restrict the field to only accept numbers and will give you a number instead of a string, but even then under the hood it's doing a transformation from a string to the desired type. If the developer expects a number, it's up to him to attach a formatter or convert the input string into the expected type with methods like
[textField integerValue]
.
>>
>Hardware is getting faster and faster
>Every application is getting slower ad slower

Geez I wonder why

>"We all use javascript for everything ! Have you tried Atom ?! It's whole fucking browser converted into a text editor for sweet sweet javascript memes ! Yes half of the code is dead, and the application spend most of it's time deallocating, creating useless object and leaking memory but look ! LOOK ! JAVASCRUUUUUUUUUPT ! JAVASCRUUPT !"

kek
>>
Some anon posted this a few days ago:

https://github.com/AlexNisnevich/untrusted

Solve levels by putting in javascript where you can
>>
It fucking kills me that JS is becoming the lingua franca. Every programmer worth his salt should be able to learn JS easily but that doesn't necessarily make it good.
>>
>everything is floating points so you can encounter 3 not being === 3 after some arithmetic functions
>>
>>54057363
>paradigm of ALGOL-like syntax
The LISP community doesn't even know what ALGOL looks like. A LISP community member said f(x) and 2 + 2 are "ALGOL" which is probably one of the dumbest things I've read online.

>so no cohesive community with community standard can develop around lisp
https://en.wikipedia.org/wiki/Affirming_the_consequent
>>
>>54060854
This will rarely happen since when when the JIT has kicked in (which it has to in self-driving cars) it's usually faster than C++ code.
>>
>>54062049
Thanks. He told me to learn JavaScript and php. I'll Start here
>>
>>54067230
>hotspot kicks in after 1000 method runs
>after running over 1000 kids it'll finally be faster than C++ code
>>
>>54055366
this desu
>>
JavaScript is for web pages
I don't want to program web pages.

I like desktop applications, servers, databases and embedded systems

JavaScript is not and will never be for back-end/systems development people
>>
>>54069042
JS already does backend web and even some desktop apps. You're just behind the times.
>>
>>54069139
Using a web page scripting language to do backend/desktop development by depending on some bulky framework is a pretty silly way to do things, don't you think?
>>
>>54069250
>depending on some bulky framework

What framework?
>>
>>54057937

>quickly automate 90% of all menial labor
90% of the population will be jobless, homeless, and starving. Or there will be so much strain on the federal government to provide benefits that the economy will collapse outright.
>>
>>54069274

In the case of desktop applications, Electron.
>>
>>54069250
Maybe building desktop apps is pushing it a bit, the language would have to improve a lot more before it's viable for that.

But for web backend, I really see no major issue with that being a viable choice, with its pros and cons, just as with other languages.
>>
>>54070051
>Maybe building desktop apps is pushing it a bit, the language would have to improve a lot more before it's viable for that.
The main thing that need to happen is the creation of a desktop UI toolkit that isn't HTML+CSS and doesn't run in a browser. The bloat doesn't come from JS, it comes from dragging around a Chromium tab.

But most front end web devs are strangely insistent on using the entire web front-end stack when it comes to desktop application development. They aren't happy with JS, and won't be satisfied unless developing for the desktop is identical to developing a web page.
>>
>>54070253
>strangely insistent on using the entire web front-end stack when it comes to desktop application development
because they're monkeys that are unwilling to learn an actual programming language
>>
>>54060583
At this point yes, Go is slow as shit compared to say C which has had literally decades to improve. The beauty of compiled languages is that there is nothing stopping Go or Rust from being as fast as C on a technical level, whereas you can only go so fast with interpreters due to the script to machine language translation overhead.
>>
>>54070739
C is very simple to understand and was designed by a god amongst men.

Rust was committee designed by a bunch of hipster web developers and it shows.
They worry more about codes of conduct and inclusiveness than they do the quality of their standard.
>>
Can you get into JS without also doing html/CSS first? I'm not really interested in building websites, what other applications are there for JS?
>>
>>54070366
>>54070253
Well, I think it's mostly convenience. the HTML/CSS/JS stack just has unparalleled speed of prototyping and development.

It's very convenient that you have a fast feedback between your code and your output, when you're using the DOM. You basically don't need an IDE and a compiled language anymore, you can develop live in a browser using the console to prototype what you want to build.

But, anyway, this would never be a good choice for complex applications like a graphic suite (photoshop) or a professional engineering suite. You would still need C++ for that. But you could use the webstack to build more simple applications, like a chat app or some small shit like that, which wouldn't be a resource hog even if you build it in JS.
>>
>>54071003
Segmentation fault.
Core dumped.
Kernel panic.
>>
>>54071184
>I'm not really interested in building websites, what other applications are there for JS?
You can do everything people do with python. Data processing, games etc.
>>
>>54071252
>accessing blocks of memory not allocated to your program

your fault, stupid webdev cunt
>>
>>54071252
You just suck at programming.
>>
>>54069789
>90% of the population will be jobless, homeless, and starving. Or there will be so much strain on the federal government to provide benefits that the economy will collapse outright.

Wrong. The population will be well fed & housed because there will be oversupply of food and housing produced/built by machines. In my scenario people own most of these robots so it doesn't even cause excessive wealth concentration.
>jobless
People will engage in hobbies, go to parties, teach children, learn, do other kinds of community service. It will be much better than current gloomy wageslave world.
>>
>>54071306
>>54071274

Even C pros spend lots of time debugging memory errors. And then the same memory errors are discovered by hackers and we have next CVE SEVERITY:CRITICAL

C is a stupid unsafe language from 1970s, it's time to replace it with something better. If you disagree you are a luddite CuCk neCkbeard.
>>
>>54071375
I suppose it's my fault for walking into webdev babby general.

You don't see segfaults ever unless you do retarded things like walk off the end of the array with no bounds checking.
>>
>>54071430
>Hasn't seen X.Org segfaults
>Hasn't seen Firefox segfaults
Looks like you don't know what you are talking about. If you write any nontrivial C program you are going to use linked lists, trees, hashtables and other data structures. You will have to code most of them from scratch because C doesn't have templates. This will result in segfaults. It's the norm.
>>
>>54071512
>linked lists, trees, hashtables, the list goes on!

I feel like you just walked out of CS 101 and you feel you have the right to talk shit about languages and programming paradigms you know nothing about.

Typical webdev cunt.
>>
>>54071325
You've never been "in between jobs" have you? Even with enough money to pay the bills, not working generally makes people feel like unproductive shitbags. It's stupid to assume that more time and money = more productivity and "hobbies"
>>
>>54071211
>It's very convenient that you have a fast feedback between your code and your output, when you're using the DOM. You basically don't need an IDE and a compiled language anymore, you can develop live in a browser using the console to prototype what you want to build.
Interface Builder in Xcode comes quite close to that for native Apple platform projects. In the case of Mac development you can even do a lot of data <-> UI binding without any code at all.

Keep in mind that it does this even though most Apple platform projects are driven by a combination of C, Objective-C, and C++ (and these days, Swift). This proves that it is indeed possible to approach or exceed HTML+CSS+JS for prototyping and rapid iteration with more robust, resource-efficient languages.
>>
>>54071585
>You've never been "in between jobs" have you
I have been a NEET for quite some time because I liked it.
>Even with enough money to pay the bills, not working generally makes people feel like unproductive shitbags.
Sounds like burger mentality. We in Europe aren't as wagecucked as you, anon. We value our lives more than work. Work is for machines, life is for people. As a programmer you should understand that.
>"hobbies"
>quoting hobbies as if it's something unsightly
Burger (^:
>>
>>54071564
>No comments about segfaults in major linux software (X.Org, Firefox)
>Doesn't know that majority of all CVEs are memory errors
You sound like a freshman, not me.
>>
File: haleye.jpg (68KB, 400x400px) Image search: [Google] [Yandex] [Bing]
haleye.jpg
68KB, 400x400px
>>54069139
>JS already does backend web
What is "backend web" in this case? If you mean that bunch of scripts that used to be in PHP than, yes. It does some backend web.

But if you mean databases, search engines and caches than... no way. JS is just simple glue for the HTML/CSS web skeleton. And that's all there is to it.
>>
>>54071003
People often complain about how easy it is to segfault in C, and Go addresses a lot of those issues. Rust does too, but like you said it's run by hipster sjws so I doubt it will ever really go anywhere.
Go on the other hand has the backing of Google and for a language conceived in 2009 it's doing quite well.

Go also adds a lot of cool shit like standard networking features and multithreading out of the box.

C was the first language I ever learned. I've used it so much that it takes some getting used to when I use another language because I'm used to the verbosity of C.

As for segfaults those are easily dealt with. Simply write get and set functions that take in some pointer, an index, and a value and test to see if the index supplied is within the bounds of the array.

Pro tip: in C there is no difference between
int *array
and
int array[]
>>
>>54073309
>As for segfaults those are easily dealt with. Simply write get and set functions that take in some pointer, an index, and a value and test to see if the index supplied is within the bounds of the array.

If it were that simple we wouldn't waste billions of dollars on data breaches which are ultimately done via C memory errors... Consider just one such vulnerability - heartbleed.
>>
>>54073415
Maybe if companies would stop hiring poo2loo programmers, and if neckbeards would actually check their code before submitting it we wouldn't have these issues.

You realize a lot of programming errors are caused by poo2loos right?
Hell, entire companies have been demolished from poo2loos.

It's not the languages fault, nor the designers fault that some people are too stupid to build very simple abstractions.

Corporations are trying to turn programming into a production chain that, in theory makes better programs when you throw hordes of cheap programmers at projects. All that really happens is that they get back a pile of unmaintainable spaghetti code, critical errors, glitches and very little documentation written in "hindinglish".
>>
>>54073309
Swift also shows promise for a safe language with C-like speed. Its development is moving at a breakneck pace and giants like IBM are picking it up for server-side use:

https://github.com/IBM-Swift/Kitura
>>
>>54073706
heartbleed wasn't caused by poo2loo, it was caused by muh cool C hacker that worked on openssl. It's time to remove potential for such errors.

>Corporations are trying to turn programming into a production chain that, in theory makes better programs when you throw hordes of cheap programmers at projects.
That's so 2000sh.. You are behind the times. Now the emphasis is on getting rid of programmers entirely and replacing them with machine learning models, hehe.
>>
>>54073798
I know heartbleed wasn't caused by a poo2loo, it was caused by a careless neckbeard at his Linux box submitting code that was only glanced over and approved.

However, in general poo2loos cause a lot of glitches and general havoc in IT wherever they're employed.

The idea that well have human like AI in our lifetimes is laughable. We've hit the end of moores law. This is the end of the road. Until they figure out how to mass manufacture a more stable material, such as graphene, we're stuck. And even at that it's only a bandaid solution that will need more attention some 10-20 years down the road.

I laugh at automationfags when they ignorantly suggest that in 20-30 years humans will be removed from most/all jobs yet most of them don't know if acknowledge that moores law is dead.
As cool as it would be to live in a cyberpunk universe where we all live on universal income being NEETs while robots do all the hard work of actually making an economy move, it isn't going to happen.

They've been trying their damnest to lower the bar for programming by laxing speed requirements and using training-wheel tier languages in production environments which drives down wages because then any idiot can do it. (hence this thread) But it comes at a cost, mainly program speed, functionality and innovation. They just want something they can shit out on the market even if it's not a really good program.

The push for web based computing also comes with the "coincidental" bonus of being able to mine all your shit to sell to other corporations and the ability to monitor you for wrongthink and report you to the necessary authorities.
It has already happened in Germany, where posting a criticism of the refugee crisis for example can land you in jail.

I miss when the web was little more than an interactive encyclopedia.
>>
>>54074263
Well said anon, i'd like to add that today games are made to shill most amount of money possible through time, and back in the old days they were reflection of human ability to create a fucking awesome game engine and then games were released as some sandbox engine to mess around just so devs could get funds and make better engine.
>>
>>54074529
I remember when expansion packs were a thing. When you didn't have to pay $2.99 for a map, a weapon or a skin. I also remember when you actually owned your games and could play them without a constant connection going to "the cloud".
>>
Seriously we should write a kernel & core utils in JS so we can finally get rid of the vomit that is C/asm/C++ and similar outdated languages
>>
>>54075142
>we should
>we
I like how people use that word when they have no intention of actually doing something.
>>
>>54075142
Do you not know what an OS is? No matter what you do you still have to write in a compiled systems language like C, C++ or Assembly to interface with the hardware. At best you can make an OS where all the low level shit is handled with C and so on with a heavily integrated JS interpreter strapped to it. The OS would be slow as fuck due to the shitty interpreter and miles of inefficient spaghetti sjw code running on it. You'd have better luck programming an OS in BASIC, at least it has the ability to modify memory addresses and so on with PEEK and POKE. Quit trying to ruin our profession because you and the poo2loos are too stupid to understand how a computer works. Just accept the fact that programming isn't your thing no matter how much you like it.
>>
>>54075234
You can write compilers for interpreted langues.

But it would be a colossal waste of time.
>>
>>54075321
Not exactly. As I said earlier in the thread due to the way JavaScript handles arrays there will always be an overhead with accessing data stored in RAM. This kind of thing happens on all languages where there is no type system. Not only that but they would have to heavily modify the JavaScript spec further fragmenting it to take into account that RAM is basically a huge ass unsigned char array.
>>
File: Convolutional_NN-3.png (143KB, 895x681px) Image search: [Google] [Yandex] [Bing]
Convolutional_NN-3.png
143KB, 895x681px
>>54074263
>The idea that well have human like AI in our lifetimes is laughable.
It's not if you are following the ML field. The progress in machine learning/deep learning for last 5 years has been literally staggering. Read about new state of art results. There is already superhuman visual object recognition, voice recognition, good machine translation, description of scenes in natural language, question answering (facebook babi dataset), visual question answering, algorithm learning (neural turing machines, neural GPUs), and finally really strong reinforcement learning (deepmind's DQN, A3C algorithms).

The last one, reinforcement learning, is really important because it's a basis for general intelligence. By rewarding/punishing a reinforcement learning agent you can train it to execute very complex tasks, for example navigating a maze with pixel input or controlling a robot body to do some tasks. DeepMind is on the cutting edge of this kind of research, you can read about their latest agent here http://arxiv.org/abs/1602.01783

With such rate of progress it's not inconceivable if a sub-human but general intelligence could be developed in 10-20 years, or even sooner.

>We've hit the end of moores law.
It's true, though we'll see 10nm and maybe 7nm. 10nm should be enough for AGI.

>This is the end of the road. Until they figure out how to mass manufacture a more stable material, such as graphene, we're stuck. And even at that it's only a bandaid solution that will need more attention some 10-20 years down the road.
You are implying that we'll need raw CPU compute for AGI. Other approaches that allow for orders of magnitude more FLOPS/mm^2 of silicon on the same lithography node are possible. One such approach is GPGPU. Another is GPGPU hardware with fixed point arithmetic (10-50x boost over GPUs, because floating point units are very bulky). And yet another is ASIC for binarynet-like neural net ( http://arxiv.org/abs/1603.05279 ) - could give another 10x boost.
>>
File: image03.jpg (73KB, 886x284px) Image search: [Google] [Yandex] [Bing]
image03.jpg
73KB, 886x284px
>>54074263
>>54075409
(cont.d)

>As cool as it would be to live in a cyberpunk universe where we all live on universal income being NEETs while robots do all the hard work of actually making an economy move, it isn't going to happen.
Cyberpunk scifi is 100% dystopian, nobody wouldn't like to live there. Our current world is cyberpunkish in a bad sense. Basic income @ post-scarcity world would be completely different, much more happy and satisfying.

> while robots do all the hard work of actually making an economy move, it isn't going to happen.
Many people note that automating 95% of menial labor was possible in 90s-2000s tech-wisw, but it happens very slowly because both power elites and middle class effectively defend status quo.

>They've been trying their damnest to lower the bar for programming by laxing speed requirements and using training-wheel tier languages in production environments which drives down wages because then any idiot can do it. (hence this thread)
I think lowering the bar is a very good idea because programming is new literacy. Computers are everywhere. People should be able to interact with them as power programmer-users. 1970s programming language technology is outdated (I say this as a person that coded his fair share of C/C++), modern dynamic languages are great for developer's performance, and runtimes/compilers are improving.

>But it comes at a cost, mainly program speed
V8 is fast
>functionality and innovation.
Dynamic languages allow for fast iteration/innovation. Nobody writes games in C++ from start to finish, people always used some dynamic language to write game logic.

>The push for web based computing also comes with the "coincidental" bonus of being able to mine all your shit to sell to other corporations and the ability to monitor you for wrongthink and report you to the necessary authorities.
This is true but nobody gave people better alternatives, even neckbeards didn't come up with anything new to combat web2.0 megacorps.
>>
>>54075409
Well if this is the case then I retract my previous statement. Humans and programming aren't really compatible, but if we can make an AI that can program in say, assembly then we wouldn't have a need for higher level languages.
>>
Every programmer has to master javascript? hahahahhahahahahahahahahahahahahah
thanks for making my day :)
Have finished two computer science departments and currently working at robotic vision lab. There is nnnnnnnnnnnnnnooooooooo fucking way javascript is becoming the universal programming language....stop using the first google result as a guidance to programming.
>>
Do we really need a general thread for Javascript if we already have DPT?
>>
File: DMNplus.png (1MB, 1108x917px) Image search: [Google] [Yandex] [Bing]
DMNplus.png
1MB, 1108x917px
>>54074263
>The idea that well have human like AI in our lifetimes is laughable.
Current state of art is very impressive. There is a ML model that can learn to answer arbitrary questions about arbitrary images. It generalizes to images it was never trained on. It's from http://arxiv.org/abs/1506.07285

Again, with such state of art it shouldn't be impossible to develop sub-human but general AGI in coming 10-20 years.
>>
>>54075546
>Every programmer has to master javascript? hahahahhahahahahahahahahahahahahah

>as if there is something to master if you already know any other language

Nobody is saying that JS will be universal, but it will be very widespread.
Also if you are doing computer vision you should know Karpathy. He is deep learning researcher. In his spare time he implement modern deep learning methods in JS, for example here you can see a demo http://cs231n.stanford.edu/
>>
>>54075546
I'm screencapping this
>>
>>54055346
"use strict";
>>
>>54075520
I don't quite understand your point, anon. Still, I think there is a need in standard easy to use dynamic reasonably fast language and JS fills this niche.

In the future there will be natural language interfaces (many people are working on them right now), maybe widespread programming literacy won't be necessary, but I'm not sure.

Still, I think that automation is a boon in itself, so the more people can automate tasks the better it is for all.
>>
>>54075647
does this let me declare my types in advance?
>>
>>54075650
A lot of people in the world, dare i say the majority, barely have an IQ above room temperature. A lot of people don't have the patience, will, or brains to learn to program. Sure you can simplify most of the building blocks like JS tries to do, but the beauty of programming comes from the fact that you can put those blocks together to make something truly extravagant.
That is where most of your thinking goes, not so much towards understanding the syntax. Most people in the world don't have the brains to "put the blocks together" so encouraging them to program is a bad idea in my book.
I'm not saying it's a bad thing for them to automate personal tasks, but it is a bad idea to let them into the work place. Shame it's illegal to give IQ tests to applicants in the USA.
We already have enough stupid asses writing dumb shit in English, we don't need them writing even dumber shit in JavaScript.
>>
>>54075569
Double Penetration Training?
Thread replies: 310
Thread images: 33
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK