Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Sedro
Dec 31, 2008

Bongo Bill posted:

This is the opposite of a union. It's a sort of a wonky record whose fields are accessed by interpreting it in a context that expects one primitive or other.

code:
A = "Seven" | 7
B = A + A
And that is how you calculate B = "SevenSeven" | 14

Adbot
ADBOT LOVES YOU

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
yeah the dude who wrote the script plugin was a kid who really wanted to write his own programming language and was written over the course of a year

https://cgit.freedesktop.org/plymouth/commit/?id=e564655e13b5ac7f0d4acf37db098cc66bc43958

ray strode, the maintainer of plymouth, is a super chill guy and doesn't deserve this mess of nonsense

Edison was a dick
Apr 3, 2010

direct current :roboluv: only
The guy taught one of my modules at university, and gave me my first taste of "hey, it's not too difficult to contribute back to open source projects".
Still an odd bloke. Had a weird obsession with screwball scramble. He left to work at ARM and tried to get me to join.

return0
Apr 11, 2007

The Fool posted:

If this guy can build full websites and java apps on this phone you sure as gently caress can type out [code] every once and a while on your lovely smartphone.

This is cool.

Doom Mathematic
Sep 2, 2008

JavaScript code:
const a = {
  toString: () => "Seven",
  valueOf: () => 7
}

const b = String(a).charAt(2) // "v"
const c = 80 + a // 87

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Doom Mathematic posted:

JavaScript code:
const a = {
  toString: () => "Seven",
  valueOf: () => 7
}

const b = String(a).charAt(2) // "v"
const c = 80 + a // 87

Yep! I wish more people who used Javascript (or like, any at all) learned this. This is how operators and types work in Javascript, no more, no less

Volguus
Mar 3, 2009

hackbunny posted:

Yep! I wish more people who used Javascript (or like, any at all) learned this. This is how operators and types work in Javascript, no more, no less

I wish more people who make programming languages learned that it is an extremely idiotic idea to do this to your built-in types.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Volguus posted:

I wish more people who make programming languages learned that it is an extremely idiotic idea to do this to your built-in types.

Counterpoint: Javascript is an extremely simple language that was created in two weeks and takes even less time to learn - actually learn, not go "it feels like it should work like this, so why doesn't it?", which is even quicker but only leads to tears

Volguus
Mar 3, 2009

hackbunny posted:

Counterpoint: Javascript is an extremely simple language that was created in two weeks and takes even less time to learn - actually learn, not go "it feels like it should work like this, so why doesn't it?", which is even quicker but only leads to tears

Hmm, i wonder why all those infinitely long (and growing) "JavaScript Gotchas" lists exist? Oh yes, every single one of them "gotchas" is essentially explained by the fact that Javascript was created in two weeks while high on acid, but normal developers don't think like that during everyday coding. Hence: gotchas. So no, don't do that when you're making a language.

Xarn
Jun 26, 2015
All I am seeing is some sort of lovely perl? Or maybe this is where Perl 6 got the newer shittiness from :shrug:

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Volguus posted:

Hmm, i wonder why all those infinitely long (and growing) "JavaScript Gotchas" lists exist? Oh yes, every single one of them "gotchas" is essentially explained by the fact that Javascript was created in two weeks while high on acid, but normal developers don't think like that during everyday coding. Hence: gotchas. So no, don't do that when you're making a language.

Maybe stop reading outdated, mutually contradictory articles written by randos and read the language specification instead. Saves a lot of time

Eela6
May 25, 2007
Shredded Hen

hackbunny posted:

Maybe stop reading outdated, mutually contradictory articles written by randos and read the language specification instead. Saves a lot of time

I did. Language is bad.

Winter Stormer
Oct 17, 2012

hackbunny posted:

Maybe stop reading outdated, mutually contradictory articles written by randos and read the language specification instead. Saves a lot of time

Hmm, I read the language spec, but it turns out that '==' is still a trap operator??

Absurd Alhazred
Mar 27, 2010

by Athanatos
ECMA bad, so what?

Volguus
Mar 3, 2009

hackbunny posted:

Maybe stop reading outdated, mutually contradictory articles written by randos and read the language specification instead. Saves a lot of time

I tried to. I honestly do not think anyone has ever fully gone through it, not without getting an aneurysm (or maybe those that actually did are no longer with us. That explains so much....). So I stopped reading "specifications" and just went along and did what I had to do, knowing the gotchas (somewhat) all while longing for the day the language will finally die. I may not be alive when that will happen, but I'll surely throw a party wherever I'll be.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Eela6 posted:

I did. Language is bad.

You're still forced to use it :shrug:. Stop treating your job as a relaxing hobby that still somehow makes a gorillion dollars and take it seriously

NiceAaron
Oct 19, 2003

Devote your hearts to the cause~

hackbunny posted:

You're still forced to use it :shrug:. Stop treating your job as a relaxing hobby that still somehow makes a gorillion dollars and take it seriously

How does acknowledging that Javascript is bad imply that you don't take your job seriously?

Absurd Alhazred
Mar 27, 2010

by Athanatos
Some of us don't have to touch JS with a five-foot pole in our jobs. :sweatdrop:

Doom Mathematic
Sep 2, 2008
The list of gotchas in JavaScript is not egregiously long and the tools for avoiding those gotchas are getting better every year.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Xarn posted:

All I am seeing is some sort of lovely perl? Or maybe this is where Perl 6 got the newer shittiness from :shrug:

Haha this reminds me in my younger days how eagerly I awaited Perl 6 I the same way I suspect the Soviets awaited Full Communism.

I ended up going to Python, for what it's worth.

Eela6
May 25, 2007
Shredded Hen

hackbunny posted:

You're still forced to use it :shrug:. Stop treating your job as a relaxing hobby that still somehow makes a gorillion dollars and take it seriously

This doesn't follow whatsoever.

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison
fuckin' objects, how do they work?

Absurd Alhazred
Mar 27, 2010

by Athanatos

uncurable mlady posted:

fuckin' objects, how do they work?

I'm personally moving over to subject-oriented programming.

repiv
Aug 13, 2009

webassembly host bindings will turn good languages like rust into first class citizens on the web

just hang in there guys, javascripts reign of terror is almost over :yaycloud:

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

NiceAaron posted:

How does acknowledging that Javascript is bad imply that you don't take your job seriously?

I've yet to see a Javascript programmer calling the language "bad" and proving they understand the language they're using, rather than treating it as a convenient way to glue libraries together

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

repiv posted:

webassembly host bindings

What a shockingly bad idea. As if Javascript JITs hadn't proven to be enough of a security and privacy nightmare

repiv
Aug 13, 2009

I don't get it, how is letting WASM modules call into Web APIs any more of a security/privacy nightmare than letting Javascript call into Web APIs.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Javascript is fine. I mean, you just spend a bit of time learning its pitfalls and then you go on and do your job.

The one thing that I can see is the fact that sometimes you have to work with people who didn't spend the time learning its gotchas, but I actively avoid getting into that situation!

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

repiv posted:

I don't get it, how is letting WASM modules call into Web APIs any more of a security/privacy nightmare than letting Javascript call into Web APIs.

You say "higher performance", I hear "more reliable side channel exploitation". "Sandbox" and even "virtual machine", these days, are just synonyms for "minor inconvenience"

We will regret going for performance before correctness and security have caught up

Thermopyle posted:

Javascript is fine. I mean, you just spend a bit of time learning its pitfalls and then you go on and do your job.

The one thing that I can see is the fact that sometimes you have to work with people who didn't spend the time learning its gotchas, but I actively avoid getting into that situation!

Javascript's greatest flaw is its syntax. It doesn't look anything like its semantics and in fact both it and the "Java" in the name seem to actively deceive you into misunderstanding the language

hackbunny fucked around with this message at 18:57 on Jan 27, 2018

Spatial
Nov 15, 2007

hackbunny posted:

It doesn't look anything like its semantics and in fact both it and the "Java" in the name seem to actively deceive you into misunderstanding the language
Working as intended

Eela6
May 25, 2007
Shredded Hen

hackbunny posted:

Javascript's greatest flaw is its syntax. It doesn't look anything like its semantics and in fact both it and the "Java" in the name seem to actively deceive you into misunderstanding the language

I feel like there's some word we could use to describe something with deeply flawed syntax which actively impedes the developer's understanding of it.

What about "bad"?

Jeb Bush 2012
Apr 4, 2007

A mathematician, like a painter or poet, is a maker of patterns. If his patterns are more permanent than theirs, it is because they are made with ideas.

hackbunny posted:

Counterpoint: Javascript is an extremely simple language that was created in two weeks and takes even less time to learn - actually learn, not go "it feels like it should work like this, so why doesn't it?", which is even quicker but only leads to tears

hackbunny posted:

You're still forced to use it :shrug:. Stop treating your job as a relaxing hobby that still somehow makes a gorillion dollars and take it seriously

these are not the posts someone defending a good language would make

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

I feel like there's more options than "good" and "bad".

Eela6
May 25, 2007
Shredded Hen

Thermopyle posted:

I feel like there's more options than "good" and "bad".

JavaScript is tolerable. Its better than C++ and plenty of good programming is done in both languages. If I need to write JavaScript for my job, I will grouse a little bit and then proceed to write JavaScript (or typescript if possible), because I am a professional.

It's the hot take of 'JavaScript is Good, Actually' that's the true coding horror.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
Conversely, I'm really enjoying Swift. I especially like that, unlike C, C++ and Java, which it superficially resembles like many other languages, it doesn't shy away from having a ton of keywords and adding more as needed, instead of overloading the existing ones (just how many meanings does "static" have in C++?)

It's not without its horrors though. A few days ago, I found out that Swift's sweet copy-on-write feature for containers is not thread safe :psyduck: You took pains to keep your class's internal list or dictionary immutable and only exposing it as a read-only property? Any two random idiots that receive the container instance can make a writable copy of it, and as soon as they write to their copies at the same time in different threads, who the hell knows what will happen. Heap corruption? sure, why the hell not. Have fun going through your code and manually making copies of every single container returned by methods, properties or callbacks on the off-chance that someone "misuses" them

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

repiv posted:

webassembly host bindings will turn good languages like rust into first class citizens on the web

just hang in there guys, javascripts reign of terror is almost over :yaycloud:

hahahahahahahahahahahahahahahahahahahahahahaha no

the current host-bindings spec proposes to leak memory forever because it can only track one lost object.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Eela6 posted:

It's the hot take of 'JavaScript is Good, Actually' that's the true coding horror.

Well there's also the 'JavaScript is terrible poo poo and I'd literally die if I had to use it' coding horror.

NiceAaron
Oct 19, 2003

Devote your hearts to the cause~

Having so many pitfalls and gotchas makes Javascript bad compared to other languages which have fewer pitfalls and gotchas. Obviously Javascript is not irredeemably bad, otherwise we wouldn't all still be using it. And obviously a good programmer can avoid the pitfalls and gotchas and produce great results despite the flaws in the language. But you have to acknowledge the flaws in the tools you use.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Eela6 posted:

It's the hot take of 'JavaScript is Good, Actually' that's the true coding horror.

"Javascript is a fact of life for a web developer" is my thesis and as something that's been true and inescapable for 20+ years and counting (I learned Javascript in 1998 and it already had the "pitfalls" of toString, valueOf, no such thing as local variables etc.), I feel safe in defending it

Adbot
ADBOT LOVES YOU

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
the real horror is people thinking that the number of warts / gotchas in javascript is any greater than what's in, say, python

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply