r/javascript • • May 28 '19

What are some JavaScript things beginners don't know?

333 Upvotes

383 comments sorted by

View all comments

46

u/mjeemjaw May 28 '19

Javascript is very fast in modern environments

13

u/ShortFuse May 28 '19

Javascript is also multi-threaded if you use web-workers (which even works in IE11).

If you ever done desktop software application development, the main thread is basically your UI thread. You can interact between threads with postMessage. It's narrowing down your architecture pattern (MVC, MVVM, MVP, etc) to make that happen where beginners usually get lost.

The popular frameworks don't really push their usage much. I fear many people don't bother learning the core DOM/JS/Browser interactions. It's not bad because most frameworks heavily push async operations (promises), but the less you do on your UI thread, the better.

-3

u/takaci May 28 '19

Yeah people think javascript is slow like python or ruby but actually if you are careful it can be almost as fast as C on modern engines

0

u/[deleted] May 28 '19

[deleted]

8

u/takaci May 28 '19

I'd say that it is quite slow more often than js is

Good performance cases in python are when lots of intense computation is offloaded to C, for example numpy. This isn't true in js which is natively fast

0

u/[deleted] May 29 '19

[deleted]

1

u/takaci May 29 '19

Yes of course sorry, by language I mean the most popular implementations

1

u/vscde_gtr_thn_jtbrns May 28 '19

Python can be very slow.

0

u/[deleted] May 28 '19

[deleted]

3

u/vscde_gtr_thn_jtbrns May 28 '19

JavaScript is significantly faster than python.