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
qntm
Jun 17, 2009
C++ is absurd and everything I learn about it makes me wonder why people ever spend time bashing any other programming language's design decisions

the very, very first thing you learn in C++ is that it implements IO by overloading the binary shift operators :psyduck:

I mean, what is this:

Mr Dog posted:

an rvalue is any expression that isn't an lvalue

???

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=
something something clopen values

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
keep a clopen mind

Dr Monkeysee
Oct 11, 2002

just a fox like a hundred thousand others
Nap Ghost

rjmccall posted:

they don't really act like c++ references, java object assignment copies the reference instead of (a slice of) the object. i completely sympathize with wanting a nonnull pointer type in c++, but thinking of c++ references that way is really dangerous, because it almost works as long as you're programming in a basically functional way, but as soon as you do an assignment, or worse an assignment of a struct containing a reference, you get in trouble bad

wait... c++ references slice? i thought they were polymorphic like a pointer.

sarehu
Apr 20, 2007

(call/cc call/cc)

qntm posted:

the very, very first thing you learn in C++ is that it implements IO by overloading the binary shift operators :psyduck:

I'm confused, is that supposed to be intrinsically bad?

Dr Monkeysee
Oct 11, 2002

just a fox like a hundred thousand others
Nap Ghost

Bloody posted:

i have literally no idea what this means or what it might even mean

move semantics are a mess to reason about.

RISCy Business
Jun 17, 2015

bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork
Fun Shoe

qntm posted:

C++ is absurd and everything I learn about it makes me wonder why people ever spend time bashing any other programming language's design decisions

the very, very first thing you learn in C++ is that it implements IO by overloading the binary shift operators :psyduck:

I mean, what is this:


???

http://harmful.cat-v.org/software/c++/linus

Dr Monkeysee
Oct 11, 2002

just a fox like a hundred thousand others
Nap Ghost

MALE SHOEGAZE posted:

JavaScript is actually weirdly satisfying to program in provided you're not doing anything significant

something about passing around those first class functions and storing them in a hash / object is cool

i like javascript when it stays in the browser. i've had a chance to do some neat stuff with it over the years.

node is a poo poo show because on top of being run by 12 year olds it fundamentally misunderstands javascript's strengths and then builds a platform on top of that misunderstanding.

i also think ES6 overcomplicates the language. i like my weird objects and have never needed nor asked for class inheritance.

Flat Daddy
Dec 3, 2014

by Nyc_Tattoo
but its just sugar over the existing system right.
i like es6 but class syntax is the thing i care the least about

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Dr Monkeysee posted:

wait... c++ references slice? i thought they were polymorphic like a pointer.

reference-initialization can bind to objects of subclasses, but assignment is resolved statically

basically, if you're going to work with references, you have to understand the difference between initialization and assignment, because they are radically different

Sapozhnik
Jan 2, 2005

Nap Ghost
The "nice" thing about JavaScript is Closure Hell. It's actually kinda neat. But then that's not unique to JavaScript, it's just that you kind of end up relying on it massively and I'm sure plenty of other languages do closure much better (like um, er... uh.... idk help me out here). Node.js does correctly identify JavaScript's strengths in that sense: it's built entirely around Closure Hell. And even so, Closure Hell is merely neat, it really does become hell if you try to build something substantial with it.

Everything else sucks.

Serenade
Nov 5, 2011

"I should really learn to fucking read"

Mr Dog posted:

The "nice" thing about JavaScript is Closure Hell. It's actually kinda neat. But then that's not unique to JavaScript, it's just that you kind of end up relying on it massively and I'm sure plenty of other languages do closure much better (like um, er... uh.... idk help me out here). Node.js does correctly identify JavaScript's strengths in that sense: it's built entirely around Closure Hell. And even so, Closure Hell is merely neat, it really does become hell if you try to build something substantial with it.

Everything else sucks.

closure hell can be fun if you never need to edit or revisit the code in a meaningful way

sarehu
Apr 20, 2007

(call/cc call/cc)
Do the newer versions of Javascript have call-with-current-continuation? I don't think a dynamic language is complete without it.

abraham linksys
Sep 6, 2010

:darksouls:
es6 only has class syntax because in 2010 or whatever when it was being "finalized" every single framework their own classical object model implementation and it was a bad scene

of course they then managed to create a class syntax that doesn't fit anyone's use-case due to the lack of annotations and property initializers, both of which now exist in es++/babel-land along with async/await and other exciting, new, arguably confusion-increasing syntax :toot:

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

abraham linksys posted:

hey, js is getting async/await soon-ish, so there's that :v:

this is a major Soon™ afaik. thankfully babel can transform-in a polyfill, but last i heard there isn't anyone actually working on getting it into a browser.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

sarehu posted:

Do the newer versions of Javascript have call-with-current-continuation? I don't think a dynamic language is complete without it.

yessum

pepito sanchez
Apr 3, 2004
I'm not mexican
can someone pitch in and explain to me what a web worker is? it's presented as the major fundamental change in angular2's way of handling stuff. in presentations it looks amazing and logical, and it makes me wonder why no other javascript ever used more than one thread. is this some other kind of ~virtual DOM~ magic that isn't actually handled in a second thread in the browser? because the main question on my head after seeing it presented was "why isn't this everywhere already?"

abraham linksys
Sep 6, 2010

:darksouls:

pepito sanchez posted:

"why isn't this everywhere already?"



browser development takes time

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer
i was gonna say "it's relatively newly supported" then i remembered most browsers had it in like 2012 and then "oh right :lol: IE"

abraham linksys
Sep 6, 2010

:darksouls:

ultramiraculous posted:

i was gonna say "it's relatively newly supported" then i remembered most browsers had it in like 2012 and then "oh right :lol: IE"

mobile support is rough too

tbh I don't know of a lot of great uses for web workers in the common web app, hadn't heard Angular 2 was adopting them until now. ServiceWorkers are neat, though

pepito sanchez
Apr 3, 2004
I'm not mexican
jfc IE is always the thing dragging browsers behind. assuming most people are smart enough to not use IE, who is obligated to use IE? for work or whatever? even that can't be that high of a percentile

edit: oh yeah forgot about native mobile browsers. gently caress them too

abraham linksys
Sep 6, 2010

:darksouls:
not to get all shaggar up in here but Mobile Safari is holding the web back far more than IE at this point

Malcolm XML
Aug 8, 2009

I always knew it would end like this.
is is legacy

edge is the future

abraham linksys
Sep 6, 2010

:darksouls:
edge gonna be the first browser to implement async/await

I look forward to their implementation ending up differing from the final spec and causing backwards-incompatible headaches and Microsoft dragging their feet on bringing it up to spec

Soricidus
Oct 21, 2010
freedom-hating statist shill

Malcolm XML posted:

is is legacy

edge is the future

ie has been legacy forever

there are people developing web browsers today who weren't even in kindergarten when ie started being legacy

triple sulk
Sep 17, 2014



Soricidus posted:

ie has been legacy forever

there are people developing web browsers today who weren't even in kindergarten when ie started being legacy

makes u think

JewKiller 3000
Nov 28, 2006

by Lowtax
closures are only hell in javascript because the values you're closing over are mutable

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



has anyone really profiled any common use cases for web workers in mvc stuff?

not like computation-wise, but just like angular in general using it, would you actually see any real performance benefits?

pepito sanchez
Apr 3, 2004
I'm not mexican

piratepilates posted:

has anyone really profiled any common use cases for web workers in mvc stuff?

not like computation-wise, but just like angular in general using it, would you actually see any real performance benefits?

supposedly it improves performance a lot in angular2 but i'm just as curious. angular 1.x doesn't use it because that's not angualr 1.x. i don't think anything else at all has implemented a web worker yet except maybe some rare node.js cases where ES6 is enabled? i'd like to see performance benefits too. but the fact that you can have a js presentation layer on a separate thread from everything else is just cool and good.

sarehu
Apr 20, 2007

(call/cc call/cc)
IE is the best tablet browser though.

Sapozhnik
Jan 2, 2005

Nap Ghost
Web Workers seems like a profoundly bad thing to be using for just a dumb UI toolkit

JavaScript's good at doing overlapped async stuff thanks to Closure Hell, why throw that all away and put actual concurrency in

abraham linksys
Sep 6, 2010

:darksouls:
assuming Angular 2 still has a $digest cycle, they could theoretically do virtual DOM updating (does Angular do DOM diff? don't remember) in a worker then send a batch of DOM updates back to the main thread, but I have no idea if this would actually be any more efficient

like if it is the theoretical gain is that if you had a very long re-render cycle you could still accept user interaction during that time and not block the UI thread execution. not actually sure that's A Thing in practice though

e: I actually might be completely misremembering how $digest works fwiw, been like two years since I touched Angular

abraham linksys fucked around with this message at 03:56 on Sep 4, 2015

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer
it might help if the main js engine is jammed up with ad network crap or something?

pepito sanchez
Apr 3, 2004
I'm not mexican

Mr Dog posted:

JavaScript's good at doing overlapped async stuff thanks to Closure Hell, why throw that all away and put actual concurrency in

because this is pretty much the one thing in theory a js framework could actually help make easy for a good reason? you know, usability where instead you'd have lines upon lines of dynamic functional shitcode in pure ES6 (this is javascript). i don't get your point.

so researching, web workers have been out for some time, but all we get are hello-world-like examples from what i've seen (sum/fibonacci stuff). it's not being used. am i really the only one in yospos thinking it's cool angular2 is taking serious advantage of this poo poo as much as possible?

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



ultramiraculous posted:

it might help if the main js engine is jammed up with ad network crap or something?

DOM changes can only be done on the main thread, ad network crap will always be on the main thread, all of your angular stuff will just be on the other thread waiting to post a message back to your main thread to actually interact with the user in any way so it probably wouldn't be useful at all

edit: i'm pretty sure google, apple, and amazon are waging a war against bad ad injection right now, mostly by telling them to go gently caress themselves and swinging around their weight

piratepilates fucked around with this message at 04:35 on Sep 4, 2015

pepito sanchez
Apr 3, 2004
I'm not mexican

piratepilates posted:

DOM changes can only be done on the main thread, ad network crap will always be on the main thread, all of your angular stuff will just be on the other thread waiting to post a message back to your main thread to actually interact with the user in any way so it probably wouldn't be useful at all

but it's worth noting the angular2 team has been working with the react team, not just for the native iOS stuff (react native) but also for the ability to route views from the backend ala reflex. or did i get that wrong?

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

a guy wrote a threaded version of the elm runtime using webworkers as an experiment a while back. i dont know if it was just his implementation or not, but it didnt really seem to be a massive boost in performance.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

but back then i think you could only send strings or typedarrays to and from webworkers

cowboy beepboop
Feb 24, 2001

qntm posted:

the very, very first thing you learn in C++ is that it implements IO by overloading the binary shift operators :psyduck:

right?! I thought I was was the only one bothered by that "and here we bitshift "hello world" into something called "cout" wtf

Adbot
ADBOT LOVES YOU

cowboy beepboop
Feb 24, 2001

piratepilates posted:

has anyone really profiled any common use cases for web workers in mvc stuff?

not like computation-wise, but just like angular in general using it, would you actually see any real performance benefits?

how are you guys managing to write webpages with performance issues

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