FACT: JavaScript is the most useful language to know and with TypeScript it is actually good

FACT: JavaScript is the most useful language to know and with TypeScript it is actually good.
Prove me wrong.

Other urls found in this thread:

github.com/wanadev/abitbol
gist.github.com/Sebbyastian/9bf5551f915b2694c77e
twitter.com/SFWRedditVideos

If I could prove it wrong it wouldn't be a fact, would it?

what do you do when you only have 8K storage and 1K SRAM?

>JavaScript is the most useful language to know
No, I consider English to be much more useful.

I begin to actually like ES6. Also Abitbol classes are nice
github.com/wanadev/abitbol

Typescript is awesome.

If you have a background in any static-typed OOP language, you will feel at home

>transcompilers

Typescript makes it atleast usable yes

>not using purescript
Kill yourself pajeet microshaft shill.

Dodgy browser based applications, poor peoples web backends and blinking LED tier microcontrollers aren't the most useful things.
Done.

/thread

.>purescript
literalaly who

>TS compiles down to ES6
>ES6 has no private methods, no private properties, statics are only public methods
>ES5 has all of the above
You should all drink bleach at this point

Can someone post me a wiki page with this font? I would like to try something new.

>Prove me wrong.
can't TS is actually fucking decent

font?

types are garbage, for people who can't program or keep track of multiple things

t. nigger

That's not how philosophical burden of evidence works. You are the one making the claim. Any position other than skepticism needs to have verifiable evidence supporting it.

You can set the transpile target in a config file, try harder next time.

It's useful to know about all the things wrong with it in case you ever have to read or write it.


> '5' - 3
2 // weak typing + implicit conversions = headaches
> '5' + 3
'53' // Because we all love consistency
> '5' - '4'
1 // string - string = integer. What?
> '5' + + '5'
'55'
> 'foo' + + 'foo'
'fooNaN' // Marvelous.
> '5' + - '2'
'5-2'
> '5' + - + - - + - - + + - + - + - + - - - '-2'
'52' // Apparently it's ok

> var x = 3;
> '5' + x - x
50
> '5' - x + x
5 // Because fuck math

var PI=((++[+[]][+[]]+[]+ ++[+[]][+[]]+[])* ++[+[]][+[]])*(++[+[]][+[]]+ ++[+[]][+[]])/((+[+[]]+'x'+(![]+[])[[+!+[]+!+[]]*[+!+[]+!+[]]])/(++[+[]][+[]]+ ++[+[]][+[]]));

Fuck consistency and transivity:

'' == '0' // false
0 == '' // true
0 == '0' // true

false == 'false' // false
false == '0' // true

false == undefined // false
false == null // false

null == undefined // true
'\t\r\n' == 0 // true

Fuck sanity:

typeof null == 'object'; // true
typeof NaN == 'number'; // true
NaN == NaN // false

Here's a great idea: automatic semicolon insertion!

// guess what this function returns, I dare you:
function f() {
return
{
foo: 'bar'
};
}

If that didn't blow your mind, how about this:

(Number.MAX_VALUE + 999) == Number.MAX_VALUE; // true
(Number.MAX_VALUE * 1.1) == Number.MAX_VALUE; // false, Infinity

Speaking of numbers, all numbers are 64-bit, except if you plan to do
any bitwise operation at all, in which case they're silently converted
to 32 bits, than back to 64 again:

Math.pow(2,31) == 2147483648 // true, as expected
1

Have you maybe ever considered to not to retarded shit?

I have, that's why I don't use Javascript.

So you use C to calculate the value of ((++[+[]][+[]]+[]+ ++[+[]][+[]]+[])* ++[+[]][+[]])*(++[+[]][+[]]+ ++[+[]][+[]])/((+[+[]]+'x'+(![]+[])[[+!+[]+!+[]]*[+!+[]+!+[]]])/(++[+[]][+[]]+ ++[+[]][+[]]))?

Seek help for my autism

OH ok lol. you've never ACTUALLY had a job. My mistake. lol.

>the only jobs available are writing shitty code for 5 cent microprocessors bought from Shenzhen

>var PI=((++[+[]][+[]]+[]+ ++[+[]][+[]]+[])* ++[+[]][+[]])*(++[+[]][+[]]+ ++[+[]][+[]])/((+[+[]]+'x'+(![]+[])[[+!+[]+!+[]]*[+!+[]+!+[]]])/(++[+[]][+[]]+ ++[+[]][+[]]));

Please explain how this works

google jsfuck

>LOL XD XD
There are a thousand JS jobs for every job in C and Go combined

JS is nice because it combines C-family imperative syntax with support for functional programming techniques. However, I would like it if TCO became standard, because as it is any non-trivial recursive function will run out of stack.

They're called transpilers, doofus.

>t. OOP apper who's terrified of gotos

TCO is part of the ES6 spec you fucking idiot.

Then why doesn't the Firefox JS interpreter support it?

Transcrypt

Stop using an outdated Javascript interpreter.

typescript is definitely not good and a lot of the class shit in ES6 is retarded.

just accept that javascript's design and stop adding your cancerous bullshit to it.

I'm using Firefox 51.0.1. Where exactly would I find an up-to-date JS interpreter?

Autism gets the job done so I don't see why I should seek help when it's contributing to productivity and avoiding high costs by avoiding higher end microprocessors. Also get to play with Forth.

Are you retarded?

SD cards, keycard locks, ect... things that go everywhere and you use without even thinking about it.

Recursion is functionally equivalent to loops, just like objects are functionally equivalent to closures.

>SD cards, keycard locks, ect... things that go everywhere and you use without even thinking about it.

and funny enough most of them are complete garbage programmed by chinks and morons like you.

Btw it doesn't work in nodejs either.

How would you implement the Ackermann function without recursion?

Chrome, Safari, or node you fucking idiot.

>implying you could do it any better

gist.github.com/Sebbyastian/9bf5551f915b2694c77e
Literally the first fucking result.

Be glad it works unlike most websites which require a bloody R7870 to render

>SD cards, keycard locks, ect... are the only things that exist in the world that can be programmed

Doesn't work in the latest version of nodejs or Chrome.

You aren't enabling the right flags. But again if you were going out of your way to use recursion to do anything that exceeds the maximum stack depth you are too retarded to know what flags are anyway.

Uses heap allocation, which makes it just as bad, if not worse than recursion. When people say "iterative function", what they really mean is a function with bounded memory usage.

No they don't. They mean a function that does not call itself or any other functions that might call itself.

Turing machine languages, context-free languages, regular languages.

>talk about TCO
>if you were going out of your way to use recursion to do anything that exceeds the maximum stack depth you are too retarded
What did he mean by this?

Yes, that's the literal definition. But when people say they NEED a non-recursive implementation, it's usually because they need to minimize memory usage.

...

>hurr durr I need recursion to write my factorial function because I'm such a special snowflake!

i don't know but if your node can't handle tco, you can just do setImmediate(() => your_func(x))

(let fib ((n 1) (m 0))
(display n)
(newline)
(let ((n (+ n m))
(m (n))))
(fib n m))

>fib function that takes 2 arguments
Again with the special snowflake shit.

Wow, you shitlord

So Sup Forums, have you wrote anything in JS ever or recently?

written*

They're called cum pilers, doofus.

yes.

will you show us user?

I would say roughly 80% of my job is using vanilla JS, jQuery, React and a little Angular 1.

My spirit breaks a little each day.

>JavaScript is the most useful language to know
Agreed.
>and with TypeScript it is actually good.
False.
>Prove me wrong.
Impossible, you provided opinions.

I hate vanilla JS

Typescript makes it bearable

Typescript is a bandaid. Javascript is a broken spine.

I agree but there really isn't any alternatives for the browser

Elm, Purescript, Dart, Clojurescript

>take dynamic meme language
>add stronger typing to it

literally just use a statically typed language retards

Typescript's really great, yeah.

I just wish it supported powerful compile time macros.

One thing I really want in JavaScript (or Typescript) is the cascade operator from Dart.
Being able to do something like

document.getElementById('bla')
..addEventListener('click', () => console.log('clicked'))
..textContent = 'hurr'
.classList..add('someClass')..remove('someOtherClass');


Would fix so many of my pain points.I don't want to include some huge crap like jQuery but the nativ e API, especially the DOM API is such a fucking pain in the ass to work with because it's not fluid.

...

That compiles to absolute crap code. Needs a shit ton of helper functions to provide a runtime for dart code and the code it produces is unreadable, suboptimal and huge.

Prove me wrong.

Just write a transpiler silly.

Interesting idea. Why don't you go on github and propose it on the JS working groups. Anyone can contribute to JS on github, I think. If your idea is great it might stick.

I keep thinking about it, but I don't want to be the person to formulate and fight for a spec. I know how exhausting that is.

There are some things to consider here, like if you want to set your cascade to some inner object like
document.getElementById('aaa')
..classList.add('irrelevant')..remove('alsoIrrelevant') // Note that only one dot is used on the first add
..click() // Won't work, click() will be called on the classList
.

So you have to make up some way to go back or scope the cascade, like with surrounding the part you want to scope in parentheses (which seems might have serious implications on JS implementations) or maybe even a ... operator that works like .. except that it reduces the "scope"?

And then there's the problem that .. can be valid syntax already, like with 5..toString(). So what's the solution here? ... for cascade, .... for cascade with scope narrowing?

I dunno.

>ES6 looks bretty good
>node.js package in Debian Jessie is ancient shit that supports nothing fug.

JavaScript is Lisp without any of the good parts and all of the bad.

>tips )))))))

Well memed

what the fuck is going on

What the fuck man, im scared

...

>mfw even Google chose TypeScript instead of their own Dart for Angular 2

>agreed

Also JS only has a single thread.

No fagatronic framework or language update will fix that.

unreadable doesnt matter as long as the source is ok, as for it being suboptimal... well who cares about that nowadays lol

And I thought bash was bad....

Well then your SoL if the new super javascript memeory allocation manager uses Ackerman functions aren't you/

JUST

Javascript is a horribly shitty language that sadly ended up in the center of internet programming. I'm still hoping WebAssembly kills it in a timely manner, although 1.0 is still way too JS-focused.

Java/Typescript as a language is pretty cool. It's the Silicon Valley hipster community that sucks.

>github.com/wanadev/abitbol

Why would someone implement something like that and then deliberately not use the standard "constructor" name for constructors??? It uses an ugly "__init__" name instead. Bizarre.

Thanks for posting that. I didn't know about the cascade operator in dart until just now. Seems like a nice feature.

not even gnuplot is that fucked with it's implicit conversions

the only correct behavior in this entire fucking thing is NaN == NaN yielding false.

TypeScript actually makes it worse.
Types are useless and actually harm sometimes.
It's ++2016, get something better.

You have types whether you like them or not.
What matters is whether they're static or dynamic.

I'm happy that with Typescript, ES6 and React the js community have finally recreated Java.