[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Why is javaScript so unintuitive? How can I make it feel

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 20
Thread images: 2

File: js.png (3KB, 209x241px) Image search: [Google]
js.png
3KB, 209x241px
Why is javaScript so unintuitive?
How can I make it feel more natural for me?
>>
>>58469803

Study and practice harder.
>>
>>58469829
do you have some good sources?
>>
It was made in less than a week.

What part of it do you not understand?
>>
ES6/7 feels very natural to write, even the old ones were fine once you get used to it but required a lot more boilerplate.
>>
>>58469803
I thought about doing web dev recently and then I saw how fucking crazy the JS world is. Seems like everyday there's a new framework popping up and nobody is working together, they're all trying to fork and it's just a fucking mess.
>>
Because it is a "functional" (???) programming language.
>>
>>58470234
And the base is really shaky. JavaScript lacks a proper standard library and that's a HUGE pain in the ass. JavaScript might be the one language where having a huge standard library would actually be a good thing - after all, file size in JavaScript matters more than in any other platform (except for embedded systems with tiny ROMs).

It's not just a standard library that's missing, JS's web APIs are also severely lacking. The DOM api is a disaster. I can't stand jQuery, but at least it has chainable method calls and pioneered CSS selectors for DOM node selection in JS.
Or literally everything about document.cookie. How can JS not have a better mechanism?
Or URL parsing and generation. How can window.URL be such a recent invention?Every JS developer needs to keep reinventing that wheel.
Or escaping and unescaping for HTML or CSS. You can abuse a temporary textarea for HTML, but why would you? It's absurd. JS should provide this. It's a very basic need.

However, I believe that the framework craze will eventually die out. Web Components are being implemented in all major browsers right now and the polyfills work quite well for the older browsers. And once the world has moved away from IE, there won't be any older browsers left as all other browsers are evergreen.
>>
>>58470501
>>58470274
>>58470234
>>58470188
>>58470159
can anyone post useful javascript teaching links please?
>>
Its not real code. It runs on a virtual machine. Just like bitcoin is not real money because it only exists in cyberspace.
>>
>>58470562

>It runs on a virtual machine.
Just like Java runs on the JVM.
>>
>>58470501
Yeah it feels like at this pint JS is too far gone to ever get it right.

Talk about a rough transition, but IMO JS should be scrapped altogether and build the web with something that's done correctly form the start (Web Assembly?)

Until then, if ever, maybe html5 standards will be able to replace some JS abilities. the less JS needed the better.
>>
>>58470561
Try
https://bonsaiden.github.io/JavaScript-Garden/

I learned a lot from that site. It was the first site that could easily explain to me what the hell prototypes are and how "this" works in JS.
It's easy, much easier than most people make it seem. Similar to how the Haskell community treats their monads.
Not really sensible, though. JS has some huge design problems.

>>58470562
What does that have to do with the code not being code?
By that logic, Java isn't code either, it gets transcompiled into JVM Bytecode and that then gets executed by the JVM.
C++ isn't code either. It gets compiled into some intermediary format (usually a CPU's machine language, or even asm.js or WebAssembly) and that then gets executed by the target.
And neither is modern machine language code, because the processor is going to transform that into microcode and execute that.
>>
>>58470501
>web APIs

Because it's so hard to get all browser makers to implement uniform APIs, when they have different commercial interests (Apple cares about iphones not desktops, Microsoft-Google-Mozilla care about desktops too, but each has its own special interests, like Google has its own Android/ChromeOS/etc ecosystem).

Asking these companies to put money into implementing the same web APIs is like asking 4 presidents of different countries to implement the same policies, even though their countries are different / have different interests.

That's why Javascript has been so bogged down by a crappy DOM implementation, by browser wars, variably implemented web APIs and so on.

Getting unanimity on each API is hard and getting vendors to implement them similarly is even harder and takes more time.

And what do you do if one of them refuses to respect any timeline. You can't do shit. Then you get one browser in which a standard doesn't work.

Etc.

There can't be a standard JS library, because it depends too much on implementers. It would have to be included in the language core specification if you want to really force browser makers to comply.
>>
>>58470639
We'll never replace JavaScript. It's by far too late for that. JS is available everywhere and the web is way too inert to ever replace it.

WebAssembly has no access to actual Web APIs. You can't "do" stuff with it.
It can only expose functions that do calculations to JavaScript. JavaScript still is the one that has to respond to events, make requests and change things around.

Unfortunately, that is how it is.
>>
>>58470639
Web Assembly is basically C/C++ transpiled into JS to run in the browser.

Saying that Wasm will make JS obsolete is missing the point.
>>
>>58469803
Learn how to speak Indian
>>
File: 1463777325387.png (132KB, 500x334px) Image search: [Google]
1463777325387.png
132KB, 500x334px
>>58470770
>>
>>58470708
>There can't be a standard JS library, because it depends too much on implementers. It would have to be included in the language core specification if you want to really force browser makers to comply.

Yeah. That's what should be done for a JS standard library.
At least all of those features will be polyfillable since they don't interact with the browser (as long as they don't also rely on features the language itself doesn't have yet).


As for the Web APIs... Yeah, unfortunately, you seem to be right. Apple is the biggest problem right now, as they refuse to implement anything that will make web applications able to compete with native applications (Service-Workers for Offline, WebRTC and user media for Video and Audio).
But convenience APIs could still be polyfilled for browsers that need it.
And that would definitely motivate the browser vendors — If I need to ship another 600KB of standard library- and web polyfills to IOS devices, their users will complain that Android Users get websites faster and that will pressure Apple into implementing them natively.

There's so much boilerplate that repeats for every single modern web application (and website) nowadays that could so easily be avoided if only the language itself implemented those features...
>>
>>58470501
>And the base is really shaky.
This. Web Audio isn't done after how many years, now?
Thread posts: 20
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.