JS and why it sucks

Luis Green
Luis Green

Legit question from someone getting into programming now, I get that there's a meme surrounding it but I'd like to know actual concrete reasons why someone shouldn't bother learning it.

Pic unrelated

All urls found in this thread:
https://github.com/ArkEcosystem/ark-desktop
https://github.com/vrlc92/lisk-api/blob/master/src/transaction.js#L21
https://archive.fo/https://thehackernews.com/2017/07/ethereum-cryptocurrency-hacking.html
https://archive.fo/https://news.bitcoin.com/ethereums-parity-client-users-lose-millions-multi-sig-hack/
http://www.byond.com/docs/guide/
https://archive.org/hola.html
https://archive.org/tech/w7tele.html
https://archive.org/av.html
Hunter Reyes
Hunter Reyes

actual concrete reasons why someone shouldn't bother learning it
if you enjoy unemployment

Nathan Davis
Nathan Davis

See that's what I figured, I mean I'm not an expert on the matters of the tech industry in general but all I've heard about anyone is that if you want to at least be able to feed yourself while working with computers you should learn this basic bitch shit.

Charles Thompson
Charles Thompson

If you want to do frontend development then go learn it, you will be highly employable especially if you learn the meme frameworks like react or angular, combine that with backend knowledge using a language like Go and some trendy database like neo4j and you're set for a good career as a full stack developer. However web development is a depressing field to work in when you actually know your shit and prefer working on other things.

t. reluctant web developer who would rather be reverse engineering malware and finding exploits in software

Camden Fisher
Camden Fisher

Personally, I don't really like my browser to be executing all sorts of potentially malicious scripts every fucking page I go to, just because some people want to track my every movement or want to have DYNAMIC web pages with shit like infinite scroll designed for smart phones.
So from that standpoint, JS sucks.
**I've only rarely written any scripts for websites with JS, and tried doing more things with php instead, but this is a decade ago.*

Luke Young
Luke Young

Well right now I'm unemployed and only just started getting into this stuff, I wouldn't mind learning how to work net security stuff (since that's basically where I want to end up eventually), but I don't see myself doing that professionally as soon as I could do basic web development.

Well neither do I but you don't need to know JS to protect yourself, you do need to know JS if you want to fuck over people who don't know how to protect themselves. At least that's how I look at it, besides knowing the ways it sucks would probably make you better at not falling for it.

Owen Wright
Owen Wright

JS is the web development language, but its leaking out into other fields e.g cryptocurrency and application development. You wouldn't bother learning it if you were pursuing other fields e.g embedded devices where low abstraction languages are king. As for the science and theory of language, there's better choices, but JS is one of the most popular languages since nearly all web browsers have interpreters for it.

javascript section of webm starts at 1:24

Right now web browsers are used more as an operating environment for easily downloadable applications. Some people might disagree with that and disable JS entirely, meaning your work and effort is completely null for some clients or in some cases counter-intuitive (this browser supports this, but doesn't support that), but there's enough normies that most web devs don't bother at all (just upgrade your browser to one of the big 3 goy!).

John Nelson
John Nelson

How is it leaking into cryptocurrency and application development? Are we talking about mobile shit or regular computer applications?

Julian Taylor
Julian Taylor

Regular computer applications. I say leaking into cryptocurrency because I've come across about 3 promising ones, and then some others while randomly browsing that were originally implemented in JS.

For example, you would expect a client software to be in whatever language (in Bitcoin's case, its C++). For ARK's desktop client, its implemented in JS.
https://github.com/ArkEcosystem/ark-desktop
It's a stripped out web browser used as an interpreter for the JS scripts.
Among other projects this approach is becoming common since its an easy way to do cross-platform apps.

Dylan Cooper
Dylan Cooper

Wouldn't it be kind of dangerous to work cryptocurrency through something like JS? One sudden exploit and the whole thing goes up in flames.

Chase Lopez
Chase Lopez

I don't program in JS so I don't know too much about exploits. The data sent between is probably limited (not like you're actually going to browse the net using your wallet client, unless you're Ethereum holder).

Cryptocurrency can be a complete shitshow.
This one sends out the private key for each transaction as an actual programmed thing, not an exploit.
https://github.com/vrlc92/lisk-api/blob/master/src/transaction.js#L21

Samuel Jones
Samuel Jones

it doesn't matter what the client is made in because it just reads things from duh blawkchain. the blockchain should reject anything bad anyway, so even if there was a problem with the client it shouldn't matter.

Hudson Long
Hudson Long

Oh alright, so basically it's not like the regular SQL injection script-kiddie action you see in very poorly programmed sites, the client is just there for the sake of user convenience.

I recall a thread about this shit cropping up a few months ago, not this one in specific but other upcoming cryptocurrencies that people should look into, honestly never really appealed to me since they all come off as ponzis in their own way, though I guess if you know when to sell one that gets some value that's a profit of sorts.

Dominic Parker
Dominic Parker

I like the concept of cryptocurrency as an alternative to online payments, but its full of opportunists, scams, and market manipulation

.>Oh alright, so basically it's not like the regular SQL injection script-kiddie action you see in very poorly programmed sites, the client is just there for the sake of user convenience.
It's mostly about keeping your private key safe.
https://archive.fo/https://thehackernews.com/2017/07/ethereum-cryptocurrency-hacking.html
https://archive.fo/https://news.bitcoin.com/ethereums-parity-client-users-lose-millions-multi-sig-hack/

Noah Turner
Noah Turner

Cryptocurrency is good from the safety standpoint but right now it's basically at the same point as startup companies like Kickstarter, it's a solid concept that could be built upon but will require a lot of trial and error and especially loopholes getting patched up before we see normies adapting it as a valid alternative.

Though I guess at least crowdfunding sites are evolving already, bitcoin has existed for a long-ass time and barely any places accept it that I know of

Evan Johnson
Evan Johnson

I tried to use JSON once.
I disabled javascript and never enabled it again.

Easton Watson
Easton Watson

why someone shouldn't bother learning it.
Because other people are already good enough at it to write the adblocking filters and extensions you need to survive

Mason Roberts
Mason Roberts

But JSON is one of the best things about JavaScript. Troll/10. What, you prefer XML?

Grayson Carter
Grayson Carter

tfw you grew up on XML and think JSON a shit

Noah Roberts
Noah Roberts

JSON
s-expressions

Ryan Perez
Ryan Perez

Pretty simple, if you want to do web stuff, especially frontend, then you have to. If not then there's probably a language more suited to what you want to do anyway.

Mason Wilson
Mason Wilson

Javascript is a language that was thrown together in literally ten days to animate dancing monkeys on web pages. For what it set out to do it's perfectly fine, the problem is that people began using it for things it was never meant for. Animating dancing monkeys on a web page in C++ would be awful as well.

If you want to do web development you practically have to do Javascript. There are languages like Dart, Coffescript, or Typescript which are transpiled to Javascript, so the fact that those languages even exist are a good indication that there is something wrong with Javascript.

If you want to learn programming for the sake of programming there are more sane languages (e.g. Python, Scheme, C). Starting with those will give you a more solid entry into programming because those languages were designed to write standalone programs in instead of scripting a document. On the other hand, after you have been spoiled by them, picking up Javascript will be more painful, so pick your poison.

Chase Fisher
Chase Fisher

People saying Javascript is utter bullshit ( considering other languages ) is full of bullshit. People who think there's nothing wrong with it is also full of bullshit.

Many people here seems to love bragging about doing things in fucking Assembly because they lack ideas about what to actually develop. And since they can't get the satisfaction of finishing a project and actually thinking from a broad pespective about what they're doing, they rather just stick with the satisfaction of idk doing manual memory management.

Also, You can develop apps with it, is it ideal? Maybe, probably not, but in some cases yes. I believe that for instance, the guys behind Discord saved a lot of money, and developed the new 'skype' botnet, much faster in JS, than they'd in a lower level, more autism-inducing language.

I'm probably full of bullshit also

Evan Flores
Evan Flores

What would you recommend for something that isn't frontend? I feel like I should get to know both sides at least relatively well before picking what to do professionally and what to invest the bulk of my time into. I've got some basic-ass python skills, but it's bad enough that I don't really consider that a proper initiation

Aaron Hall
Aaron Hall

how to not become another javacriptfag
<1 + 1 yields "11"

Grayson Watson
Grayson Watson

If you want to fuck shit up: perl, c, asm

Jonathan Rivera
Jonathan Rivera

Why C and not C++?

Aaron Morales
Aaron Morales

perl
While recommending shitty languages, why not recommend PHP, too?

Julian Howard
Julian Howard

perl
shitty
maybe if you're pajeet

Samuel Hughes
Samuel Hughes

Maybe he just thinks it's a convoluted language to learn early on, not that it's shitty in terms of lacking any uses. Though yeah then I guess it makes sense if you're a pajeet since you can't learn shit

Jackson Young
Jackson Young

Perl was incredibly shit and we all abandoned it as soon as we could. Note how people still write a lot of C but Perl is nearly a dead language. Why do you think that happened?

Evan Clark
Evan Clark

Since you brought C up, why the fuck is there a meme going around that C is a dead language now?

Ryan Long
Ryan Long

It's been treated as a dead language out west for about half a decade now. It's one of those things old physics teachers tell you is good to learn for grandfathered systems still in use, but not for development.

Landon Murphy
Landon Murphy

perl
dead
maybe for you, streetshitter

Nathan Morris
Nathan Morris

No, it's garbage. It's incredibly convoluted to do datastructures in, the code has a million ways to do the same thing leading to trainwrecks once you have several people working on some code, it heavily promotes regexes for everything which we now realize was a tragic mistake and led to a huge amount of broken software, and it quickly becomes unreadable. I likely have perl code older than you, I saw this all first-hand.

Hudson Anderson
Hudson Anderson

It's the Rust community. C isn't anywhere near dead and I'm confident I'll be able to stay happily employed writing it for the next 50 years.

Ryan Ward
Ryan Ward

So would it be best to learn it before or after I learn C++? I have no problem learning a language for the sake of it but if one helps the other I'd probably rather do it in that order.

Evan Perry
Evan Perry

Don't you have a CS degree to be working on, future CS grad?

Cameron Hughes
Cameron Hughes

So would it be best to learn it before or after I learn C++?
I'd learn C before C++. It's quick to learn and effective C++ is the art of using as little C++ as possible for the most effect. If you try and use maximum C++ you will destroy whatever you're working on. For example, read what people have to say about boost and learn a healthy fear for the language before you fuck someone's code up.

Jaxson Bailey
Jaxson Bailey

OP, learn whatever sounds interesting to you. Coding is a lot like foreign languages- the more you understand, the easier the next one becomes to learn. Personally my track record can be seen over at if you're interested. I started out learning HTML/CSS in order to edit the Urban Dead wiki, learned a bit of MATLAB as an engineer, fucked around a little with Ruby in RPGMaker VX Ace, and proceeded to seriously try to learn programming after that point. I'd say go ahead and learn JavaScript first if only because, from personal experience having learned a bit of Python first, JavaScript is fucking disgusting to try to learn in comparison, not because it's hard, but because of the gross syntax. If you learn it first, you'll have to pick up new knowledge, but other coding languages will spoil you when you try them out.

William Roberts
William Roberts

JS sucks. Being able to use single quotes and double quotes interchangeably is of the highest degree of bullshit.

Henry Moore
Henry Moore

The main reason JS sucks is that there are no integers. Math above 2**53 will fail. It's a shit show trying to interface with an API that produces 64 bit ints.

Nathan Roberts
Nathan Roberts

Honestly I really never got that from the very first point I saw it, WHY would you add that as a function for any reason other than confuse people? You either do single or you do double, there's no reason to make parenthesis and brackets have alternatives, why do we need that for quotes?

Would you happen to know what god-awful language BYOND runs on? I was interested in modding custom shit for SS13 at some point but the people in the thread rarely know much about the coding side of the game.

Christian Collins
Christian Collins

Off the top of my head? No fucking clue. assuming you're referring to byond.com/docs/guide/ here.

And "runs on" is a hard question to answer. MATLAB for instance is a 4th Gen language that runs on a mix of C, C++, JS, etc. I'd assume BYOND is a similar interface. From what I can gather, it was originally "written" in C++ if that's what you're asking.

Owen Perry
Owen Perry

Basically what I would need to know to be able to fuck with it and implement custom goods like how furries have their fucking custom vorecode but somehow nobody can figure out how to add FUN stuff

Nathaniel Anderson
Nathaniel Anderson

If you can't even identify what it is you're going to have a hard time modding anything.

Owen Martinez
Owen Martinez

C or Python. C will get you close to the metal so you get a feel for the hardware while still remaining portable. Python will hold your hand with garbage collection, dynamic typing and other "magic", but it also comes with a huge ecosystem of libraries.

There are other languages like Ruby, Perl, Racket, Java, C#, any of them are a good choice. I just find C and Python really easy to get into; C is very minimal, so there is not much to learn (the K&R book is only 190 pages long, not counting the standard reference), and Python has so much written for it and about it, that you will have a lot to draw from.

Ultimately though, the language doesn't really matter. Some languages are more convoluted than others, but in the end what you learn in one can be applied in others as well. So even Javascript, as shitty as it is, it's not that shitty that you won't be able to learn programming. The real challenge is always in data structures and algorithms, something that transcends individual languages. Different languages give you different way to solve those problems. Don't overthink the issue, there is no perfect programming language.

Not him, but C++ is a huge language. Definitely worth learning eventually, but it's really hard to get into when you don't know what you are doing. C++ is the result of taking something as small and simple as C and then bolting every feature and paradigm onto it. It's not that those features and paradigms are bad, they are good things, but the legacy of C++ makes the language really awkward. The best thing would be to just throw everything out and design a new language that does everything C++ does but with a clear syntax.

If you compare Javascript to C or C++ you would be right, but even among the dynamic scripting languages there are better choices. There is a reason people are inventing new languages on top of Javascript.

Lucas Sanders
Lucas Sanders

isn't XML the better meme?

Daniel Butler
Daniel Butler

Probably asking a lot out of you, but why are data structures and algorithms the real challenge?

Wyatt Hill
Wyatt Hill

Because employers don't quiz your C++ knowledge, they make you solve monkey puzzles that require dick sucking and algorithms questions.

Jackson Perez
Jackson Perez

The latest iterations of JavaScript are powerful and a joy to use. It has legacy warts from its hasty initial development, and it can be a nightmare walking into a maintenance job where someone else slapped some sloppy JS together (this is a problem in general being a professional programmer). Also you have to mind the compatibility matrix of all the browsers of your website visitors.

It's my language of choice for writing quick scripts, and it's handy for modifying the behavior of webpages via userscripting.

Jack Ortiz
Jack Ortiz

exactly. JavaScript is a language that developed organically, much like a tumor. the biggest issue with it is that learning it will probably teach you bad habits.
it's like php, a language for html monkeys who wanted to add code to their site. that's like letting uber drivers design mass transit.

C and Python would be a good choice. IMO you should learn to program with at least two languages to start so that you don't assume the idioms of a particular language are the only way to do things. Not literally at the same time, take a few weeks and focus on one language, then switch, after a while you'll get enough fluency to be able to keep them straight.
the 'install gentoo' version of my answer to this question would be 'learn lisp', but do look at lisp eventually. there are language features modern languages are adding and touting as huge new features that CS undergrads could do in lisp in the 80s and didn't think they were big deals.

Parker Wright
Parker Wright

javashit got shitty over time
False it was created by a nigger during a week long meth binge

Pic related.

Samuel Stewart
Samuel Stewart

The real problem with perl is the community behind the language, created by openly Christian white male, has been taken over internationally by faggots and mentally ill trannies.

Juan Bennett
Juan Bennett

Data structures and algorithms are about solving actual problems. Think about it this way: you need a programming languages to write a program, just as much as you need shoes to go on a journey. But it's not really the shoes that make the journey, it's being able to navigate, find a resting place in time, read bus schedules, budget your money, and so on. Obviously the shoes are important, you wouldn't want to be wearing sandals during winter, but ultimately the shoes are not what the journey is really about and sperging too much about finding the ideal shoes will prevent you from starting your journey in the first place.

In programming the real challenge is writing something that works correctly and efficiently. This means storing and transforming your data, i.e. data structures and algorithms. It doesn't matter what language you use, if your algorithm is slow it will be slow in any language.

If you focus on the the language alone what will happen is that you know how to write fizz-buzz, but you won't know how to write anything useful. You would be like a craftsman who knows all sorts of ways to get a construction in any shape, but doesn't know how to make anything useful out of those shapes. The language is the construction material (wood, metal, concrete), but the code you write are the actual construction pieces (planks, sprints, gears, plates) you will build your machines (programs) from.

I second this, learning at least two languages is good advice. If I may add, "learning" a language does not mean you need to be aware of its every nook and cranny and know its standard library by heart, it means you should be familiar enough with its syntax to be able to read the code, and be familiar enough with its ecosystem so that you can look up things. Don't bother learning everything, learn how to quickly look up things. Then as you keep using the language the things you use often will start sticking in you head through sheer repetition.

That's great, but since JavaScript is run client-side you cannot rely on users having the latest Javascript support in their browsers. It will be years until every grandma has migrated to a sufficiently modern browser.

Jacob Parker
Jacob Parker

Javascript sucks but it's practical and you have to learn it anyways. Get to work, nigger.

Nathaniel Myers
Nathaniel Myers

IIRC, some JSON parsers are a bit picky about whether you use " or ' for the keys and only accept ". Anyway, point is, it's to avoid situations like


"{ \"benis\": \"bageena says: \\\"fugg :-DDDD\\\"\"}"

You could just write:

'{ "benis": "bageena says: \"fugg :-DDDD\""}'

I am using JSON as an example, but the point is that JS is a string-processing oriented language and it makes sense to let the user choose how many escape sequences he wants to get in. It's syntactic sugar, and it's not bad, so why complain? There are much worse things in JS, like the sometimes unintuitive or downright insane type coercion, the weak dynamic typing system that makes your error control code twice as big or the fact that strict mode isn't the default.

Some time ago I implemented a S-expression parser that allowed users to use parenthesis, brackets or braces interchangeably as long as the opening matched the ending. It had some semantic meaning on the conventions side and made certain sections of the file easier to read, but it was pure syntactic sugar and had no meaning during runtime. People liked the idea.

Aaron Bennett
Aaron Bennett

IIRC, some JSON parsers are a bit picky about whether you use " or ' for the keys and only accept ".
The JSON standard only specifies the double quotes (") for surrounding strings, and only strings can be used as keys. So I'd say that only allowing double-quoted strings for keys is the correct thing to do. But your example uses double-quotes in both cases, so I don't see what the issue is, you have only used single quotes to delimit the serialized object.

Thomas Thomas
Thomas Thomas

The difference is you don't have to account for doubly escaped quotes when quoting inside a string. Second example is much clearer to read and write and that's the rationale behind allowing single quote strings: it's just so you don't get lost in escaping sequences. They made me do one of those at work, quite long and with string concatenations, and I chose not to use single quotes. I can safely say it was a huge mistake because not only was it a pain in the ass to keep track of which quotes were opened, but it's also basically unreadable.
<But user, why did you do that? It's a bad practice and Djimonkstra said...
Because my boss made me. I know.

Jeremiah Richardson
Jeremiah Richardson

But that doesn't have anything to do with JSON. You wanted to typed out raw serialized JSON data (which happens to be a string following certain rules) and you chose single quotes to write that string. Single VS double quotes is only with regards to the language you are writing the string in, inside the string (i.e. the JSON data) it's always double-quotes. I still don't see that this has to do with JSON, if your implementation of Javascript chokes on understanding the string then your Javascript engine is broken. (or maybe I'm missing what you are trying to say)

Jacob Thomas
Jacob Thomas

I mentioned in the first post that JSON was just an example. If you have another serialization format that depends on either single quotes or double quotes, possibly nested and signaled through escaping, you will face the same problem.

People were complaining about JS allowing single quoted and double quoted strings, which is simply syntactic sugar to avoid using escape sequences. Count the number of backslashes in the double-quoted string with double-quoted inner strings to the single-quoted string with double-quoted inner strings and you will see the real difference. It can happen when writing GLSL, it can happen when writing dynamically generated JS... It's just syntactic sugar, and just because it doesn't mean the same as in C doesn't make it bad.

Nobody complains about being able to declare functions as function F() { } when it's just syntactic sugar for var F = function () { }, so why complain about this?

Ethan Carter
Ethan Carter

Would you happen to know what god-awful language BYOND runs on? I was interested in modding custom shit for SS13 at some point but the people in the thread rarely know much about the coding side of the game.

I'd just like to interject for a moment. What you’re referring to as BYOND, is in fact, DM/Byond, or as I’ve recently taken to calling it, DM plus BYOND. BYOND is not a programming language unto itself, but rather a free framework of a fully functioning DM system made unuseable by the DM spaghetticode, suicides of its past maintainers and vital system components comprising a full donation suite.

It's shit, but before I give you the link to the man page I want to tell you it really is is shit. DM is hell. Everything is an object, and properties are stored for every object even if the property is never used. The overhead is enormous and the networking is trash.

You're better off joining a remake attempt. If you know C++ or GO, I'd recommend checking out Grief.ly (that's the site). It's made by a russian, but he's chill.

Stay away from Space Station 14 (or whatever it's called). It's a remake in C# and the maintainer is a loon.

I know there are others, but those are the only ones I can think of off the top of my head.

So here's the link: http://www.byond.com/docs/guide/

Chase Moore
Chase Moore

read a book, nigga

Isaiah Lee
Isaiah Lee

You're better off joining a remake attempt. If you know C++ or GO, I'd recommend checking out Grief.ly (that's the site). It's made by a russian, but he's chill.

D Lang is pretty slick

Gabriel Rivera
Gabriel Rivera

Can we add this shit to the sticky to eliminate a weekly thread? Some one put together a really quality, concrete pasta, and just slap 'er in.

Nathaniel Baker
Nathaniel Baker

design a format specifically to be incredibly easy to parse
everyone still parses it differently

Jacob Myers
Jacob Myers

I'm saving for myself for marriage, user.

Isaac Flores
Isaac Flores

Can we add this shit to the sticky to eliminate a weekly thread? Some one put together a really quality, concrete pasta, and just slap 'er in.
From my time in browsing imageboards, a lot like screencaps of posts, this is one of the traditions that doesn't work well. It's better to write an article that summarizes a consensus of a thread (if there's anything particularly enlightening or helpful). This over a copy pasta in which the right anon(s) would need to be available at an arbitrary time to repost or would need to rearticulate his stances repeatedly.

For example these articles:
https://archive.org/hola.html
https://archive.org/tech/w7tele.html
https://archive.org/av.html

The only real downside or limitation is that only board owners can really publish them. The average user is limited to pdf's or offsite links. Like
/pdfs/res/3152.html#3152

Julian Cruz
Julian Cruz

Currently my list is basically just:
Wrap up JS, get on C then either go towards Lisp or C++ as my means of actually getting started on doing noteworthy shit. Funny enough I already had an idea that when you guys tell someone to learn a language you're not really telling them to learn 100% of what there is to know, just enough that you can start on those Holla Forums challenge images and being able to read it proper, it always came off to me that practice is what gives you the real in-depth knowledge in programming much like anything else.

That's a shame, I really didn't want to do anything too absurd with it, just add some basic fun he I could run on a private server. I'll check those remake attempts but man I don't think a single remake has had any meaningful success so far, have they? At least none that I've heard of.

I could see that being helpful for people picking between languages and stressing a language choice over the actual learning of programming itself, but in this thread I've found more useful advice and seasoned anons to help me understand things than a sticky really could have answered. That being said I'm all for a sticky helping people just like code stuff.

Thank you guys for having patience answering some pretty basic shit you're probably sick of hearing asked, honestly.

Evan Lee
Evan Lee

It's a terrible language, but it's almost ubiquitous, so you should learn it.

Anthony Cooper
Anthony Cooper

JSON was not designed to be easy to parse. If you want something like that, try Tag-Length-Value encodings.

Henry Miller
Henry Miller

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.

Michael Green
Michael Green

Javascript is shit because of the ideas that drove its creation. Javascript actually wanted to be the complete opposite of java, and made sure that when the user gave it an unexpected input it would try to figure out what they were trying to say and spit out a result. Although a good idea, it has made typecasting, input handling, and error handling universally iffy. Sometimes javascript just runs with stuff and you don't even know if there is an error. I don't care how many "but omg strict javascript" fags come into the thread, I want web asm and I want it now.

Disable AdBlock to view this page

Disable AdBlock to view this page