So the problem isn’t.

 
Bidle: John_au: good practice would be not to scrolljack the user

Giroir: So just avoid it all together?

Ped: Afroradiohead: if you’re using callbacks, you need to write it like that if you expect the things to happen in order but asynchronously

Quist: Oh oops I wasn’t talking about your code john_au

Upton: Masella: Bidle: is there a reason, or just personal preference?

Sattlefield: Afroradiohead: were you talking about my code?

Kho: Games: People wouldn’t just name their calllbacks as an alternative?

Sawdey: John_au no i wasn’t, sorry for the confusion

Masella: Afroradiohead: read the article i linked to

Owensby: I skimmed it, i’ll read again

Steves: Masella: must be moving up in the world if my example was pretty much the exact example of your blog lol

Masella: John_au: because every single site that does what you’re attempting to do makes me scroll too far, because it doesn’t work. it’s a stupid and frustrating UI decision

Masella: Games: that’s not my blog

Drummer: Masella: the blog you linked to*

Masella: I still have no clue what you mean

Stohl: I’m reading it and all i’m comprehending is that people creating anon callbacks within anon callbacks within anon callbacks

Kagay: Masella: fair enough, the only reason im doing it is because i have a 100% width and height splash page that i wanted the user to able to get past quickly, might rethink the design.

Masella: Afroradiohead: you can drop “anon” from that, because it doesn’t matter if they’re anonymous or not

Masella: John_au: better solution is to not have a splash screen. they haven’t been good UI since the 90s

Thedford: Http://termbin.com/gmtl — I’ve got this file, and http://i.imgur.com/mJgWnJX.png this image. why is the text not set or visible?

Elliston: DoSomethingAsynconSomethingAsyncDone; var onSomethingAsyncDone = function

Layton: Yea afroradiohead you can do that, but you’ll have to name them all somewhere else

Hedrington: Afroradiohead: which makes it look cleaner but some people find that even harder to reason about

Masella: Afroradiohead: defining the callback after it’s p***ed into the function is dangerous. also, how are you going to trace the control flow?

Arbry: Since now you have two sources

Galeano: Masella: right it’s not defined after, but before

Masella: No, it’s right there, defined after

Masella: So, worse, you have to write the code in reverse order

Yother: Afroradiohead: you can do that, but you still have a bunch of logic all over the place

Cayetano: I usually nest it in prototype objects. hmm let me see if i can psuedo code an exammple

Konopacki: Afroradiohead: Show some code, but don’t paste it on the channel. For frontend code HTML/CSS/JS, you can provide a test case that we can run, so that we can help you: use https://jsfiddle.net , https://jsbin.com , or http://requirebin.com . For Node.js code, use sites like https://gist.github.com/ and https://bpaste.net .

Masella: Var doTheFifthThing = function { . }; var doTheFourthThing = function { doTheFifthThing }; var doTheThirdThing = function { doTheFourthThing }; /* ugh. */

Masella: The further away from each other all of these callbacks are, the harder it is to see what the whole is doing

Masella: But you really probably shouldn’t be learning about how much your current code might ****, because you should be shipping

Trumble: Masella: thanks for your advice, gonna ditch the splash screen, which is really just a m***ive head block, it will be just an annoyance for the end user 😀

Moilanen: So the problem isn’t necessarily anonymous functions afroradiohead but figuring out how the code is working, because they may not nest in so nicely a way. some may be sync, others async, callbacks would go so far then stop halfway, but there’d be no clear way of seeing how it all fit together without studying it for longer than what should be necessary