[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
JS
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 60
Thread images: 3
File: javascript.png (35 KB, 300x300) Image search: [Google]
javascript.png
35 KB, 300x300
How do we solve the Javascript problem?
>>
Proper scoping.
Type safety.
>>
>>51220296
>the javascript problem
>look at me, I have to fight everything I don't understand because I only work in C

>>51220395
This is literally the only thing wrong with js, and typescript solves it all beautifully. There's coffeescript too for the tinfoil loonixers but anyone supporting coffeescript is just a self-contradicting moron who likes to write vague code.
>>
>>51220395
Oh btw, and for scoping, if you're still using var everywhere instead of let, you deserve any problems you have.
>>
>>51220666
let isn't realistically supported anywhere.

v8/nodejs doesn't count.
>>
It seems Javascript is detrimental to anonymity and privacy on the Internet.
>>
>>51220651
>work in C
>dont understand js

kek
>>
Delete it and go back to 90's web with static HTML, browsers like Lynx, etc.
>>
>>51220703
Also it doesn't optimize well.
>>
>>51220296
By NOT trying to take it out of the browser.
>>
>>51222200

javascript is a hell of a lot nicer to work with outside the browser than in it.

>>51220651
es6 has block scoping with let and const, don't say "its not available yet". The latest version of node has it by default and if you're making a web application without some type of build process(minification, concatenation, transpilers) you're doing it wrong. Which means you can add an es6=>es5 compiler easily. The overhead is a few hundred milliseconds for a 20k+LoC app.
>>
>>51220296
WebAssembly
>>
mass exterminate the 'web developers'
>>
File: 6vmFQWV.jpg (87 KB, 700x443) Image search: [Google]
6vmFQWV.jpg
87 KB, 700x443
what we need is perl 6 in the browser.
>>
>>51220296
Make it Scheme like it always should have been.
>>
>>51223678
This. You can do whatever you want in Scheme.
>>
>>51221153
Is it really that unusual? C is low level and statically typed, JS is high level dynamically typed. When you're used to low level interactions adjusting to high level interactions can be difficult.

Source: coded in C/C++/Verilog HDL in all my early years. Received top marks for my undergrad thesis. Have made significant contributions to various successful open source projects. Didn't know anything high level until this year (learned JS/Python/PHP for a web project I'm working on).
>>
>>51224077
>C is low level
>>
>>51224090
Yeah yeah shush. I've done a fair bit of 6502/MIPS/x86 assembly too.

>tfw I can't code directly in machine code
>>
>>51222849
word.
>>
>>51220296
cure your autism and you'll realise js has no problem
>>
>>51220296
can't solve where there's no problem
>>
>>51221153
Yeah you try telling some C dinosaur that functions can be first class and all the benefits that brings. They'll have an aneurysm.
>>
>>51220296
If the 'problem' you're referring to is how butthurt it makes blob programmers, that would be a feature.
>>
>>51222760
This. Write in something else, compile to WebAssembly, we can still analyse the code because it's an AST.

I'm glad the days of bytecode are over. Java can suck it.
>>
File: stallman1.article.jpg (9 KB, 460x276) Image search: [Google]
stallman1.article.jpg
9 KB, 460x276
>>51226577
>>
>>51222506
Yeah I know that anon, I'm defending js. And like >>51220703 said, let is available but afaik only works in firekek
>>
>>51220666
i'd use let if Firefox supported it natively
>>
i dont understand. what is this 'problem' with js /g/ always talking about? please enlighten
>>
>>51220296
Using NoScript
>>
>>51220296
ITT: Luddites
>>
ES6/7
>>
By educating people like yourself.

Javascript is a great language, one of the best I have ever learned.
>>
>>51221153
There's no way a C dev will be able to just go and write websites in JS. The transition is fucking agonizing and there's a learning curve.
>>
Javascript is great. It provides plenty of jobs.
My suggestions:
Add more features
Support more programming paradigms
Bring it into more fields like embedded, systems programming, hpc,
>>
>>51230132
>how do we improve this already-too-inconsistent-and-complex language?
>add more features!
>make it jack of all trades and master of none!
This is how C++ became how it is.
>>
>>51230132
>It provides plenty of jobs.
So does Java and COBOL.
But ultimately it's just pointless second-rate junk.
And anyway, a web browser shouldn't have a VM with any language. It's a huge security hazard, given the bloated and crap code typical in modern web browsers.
Just putting stuff in VM doesn't increase security either. This subject always comes up on OpenBSD mailing list, someone wanting to put OpenBSD on VM next to Linux or other OS, and they think it provides security. Every single time the kernel devs have to explain it's a stupid idea. No VM is going to give you increased security, when the host (or in this case browser) are of questionable quality.
And anyway, I just want my browser to render HTML documents, not execute random Internet code that's often obfuscated and designed to spy on me or serve ads and other stupid crap. I'm just in this for pure content, hence why my favorite browser has always been Lynx.
>>
>>51230131
>download jquery
>profit

javascript is the reason shit like jquery exists
>>
>>51230447
Does jquery make javascript less shitty somehow?
>>
>>51222760
Seriously this.
>>
>>51220395
/thread
>>
>>51220651
nigga my first language was C and i still got javascript
>>
>>51230928
I started with C++ then moved on to JS. Didn't find it difficult, at least not more difficult than any other language.
>>
>>51220296

Update it until it's a language like c#/java then make a 'legacy mode' where everything is available and a 'standard mode' which has all of the bad parts removed.

I HAD TO CLICK THROUGH 26 FUCKING GOOGLE IMAGE CAPTCHAS. TWENTY-FUCKING SIX.
>>
Would it be feasible to create a new browser that doesn't have JS and instead uses a new client side programming language built specifically for the web browser? Maybe it can include a permissions system for users to specifically to allow it to load external content, load windows and other shit.
>>
>>51228168
Firefox DOES support it. Chrome is the one that doesn't iirc. I know cause I write firefox addons and you won't find a single var in there, only const and let.
>>
>>51230416
>implying js is only used for shit like tracking and is always junk
>implying there's no such thing as useful js like ajax or UIs that are actually a pleasure to use and have useful features your static text web 1.0 shit can't have
>>
>>51230783
Tbh it really doesn't. Jquery is mostly just for writing shorter code, not more advanced code. The actual improvements it introduces are very limited.
>>
i think most people who whine about JS seek out a few aspects where you basically have to purposefully try to fuck it up

the only thing i dislike is the lack of advanced IDE help because its not compiled
>>
>>51233119
You have no idea what you're talking about, partly because you're saying
>let's replace x with something functionally identical to x but not the same
and implying browsers don't already let you control things like popup permissions
>>
>>51222760
this. ctrl+f: wasm
>>
>>51220296
>>51220395
Kek, my friend tried to JS, he accidentally put
if (a = 3){}

in his code and wasn't able to find out where his problem is until I came along.

Why is this not illegal in JS anyways?
>>
>>51224077
Cpp is fairly high level. Some would argue C is also high level, but let's just put it in the middle.
>>
>>51234239
basically every language has that problem
an assignment would evaluate to true, so its not its fucking anything up and could be useful on occasion (or it was back in the 80s with K&R C etc)
>>
>>51222849
Fucking disgusting.
Also enjoy the exploit cesspool it's gonna be.
>>
>>51234239

it's not illegal in a lot of languages
>>
>>51234239
>Why is this not illegal in JS anyways?

Why would it be illegal?

And 'evil twins' is considered harmful, so it's either a = 3 or a === 3
Very easy to tell apart.
>>
>>51234239
Say having

if((db = new Database()).Exist("moot"))
{
//Simple and inline assignment
}
>>
>>51234239
'use strict'
>>
>>51228403

THIS. Avoid js-heavy websites like the plague.

Secondly, boycott everything ChromeOS and FirefoxOS. Shit must not catch on.
Thread replies: 60
Thread images: 3

banner
banner
[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.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.