Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "callback"
-
TABLE BASED WEB DESIGN
I was surprised there were no rants about this topic before I realized it was more than a decade back 😳
We've never had it better! So to help add a little perspective for all those ranting about what is unarguably the golden age for web developers... let me fill you in on web dev in the late 90's;
JavaScript was a joke. No seriously! - I once got laughed out of the room for suggesting we try use it for more than disabling a button - (I wanted to check out the new XHR request thingy [read AJAX]).
HTML was simple and purely a markup language (with the exception of the marquee tag). The tags were basically just p,ul,ol,h*,form inputs,img and table and html took 10 minutes to learn. Any style was inline and equally crude - anything that wasn't crude could not be trusted and probably wouldn't render at all in most browsers (never mind render correctly).
There were rumors of a style TAG and something called a cascading style sheet which were received with much skepticism since it went against the old ways and any time saved would be lost writing multiple [IE version specific] style sheets for each browser just to get it to work - so we simply didn't.
No CSS meant the only tags you had to work with to create a structured layout were br, hr and table... so naturally EVERYTHING was in nested tables! JS callback hell can't touch this! - it was not uncommon to have 50+ nested tables all with inline style in a single page which would be edited without any dev tools or linting.
You would spend 30 minutes scanning td tags until your eyes bled to find something, make a change, ftp the file to the server, reload the web page and then spend 10 minutes staring at the devastation on your screen convinced you broke
the internet before spotting an un-closed td tag with your bloodshot eyes.
Tables were not just a silver bullet - they were the ONLY bullet and were in the wild west!
Q: Want an inline form or to align your inputs left?
A: Duh table!
Q: Want a border with round-corners, a shadow or blur?
A: That's easy! Your gonna want to put that table in the center cell of another table then crop a image of the border into 6 smaller images to put in the surrounding cells... oh and then spend 10 minutes fucking with mystical attributes like cell-padding and valign to get them flush.
...But hey at least on the bright-side vertically & horizontally centering stuff was a breeze!22 -
We're using a ticket system at work that a local company wrote specifically for IT-support companies. It's missing so many (to us) essential features that they flat out ignored the feature requests for. I started dissecting their front-end code to find ways to get the site to do what we want and find a lot of ugly code.
Stuff like if(!confirm("blablabla") == false) and whole JavaScript libraries just to perform one task in one page that are loaded on every page you visit, complaining in the js console that they are loaded in the wrong order. It also uses a websocket on a completely arbitrary port making it impossible to work with it if you are on a restricted wifi. They flat out lie about their customers not wanting an offline app even though their communications platform on which they got asked this question once again got swarmed with big customers disagreeing as the mobile perofrmance and design of the mobile webpage is just atrocious.
So i dig farther and farthee adding all the features we want into a userscript with a beat little 'custom namespace' i make pretty good progress until i find a site that does asynchronous loading of its subpages all of a sudden. They never do that anywhere else. Injecting code into the overcomolicated jQuery mess that they call code is impossible to me, so i track changes via a mutationObserver (awesome stuff for userscripts, never heard of it before) and get that running too.
The userscript got such a volume of functions in such a short time that my boss even used it to demonstrate to them what we want and asked them why they couldn't do it in a reasonable timeframe.
All in all I'm pretty proud if the script, but i hate that software companies that write such a mess of code in different coding styles all over the place even get a foot into the door.
And that's just the code part: They very veeeery often just break stuff in updates that then require multiple hotfixes throughout the day after we complain about it. These errors even go so far to break functionality completely or just throw 500s in our face. It really gives you the impression that they are not testing that thing at all.
And the worst: They actively encourage their trainees to write as much code as possible to get paid more than their contract says, so of course they just break stuff all the time to write as much as possible.
Where did i get that information you ask? They state it on ther fucking career page!
We also have reverse proxy in front of that page that manages the HTTPS encryption and Let's Encrypt renewal. Guess what: They internally check if the certificate on the machine is valid and the system refuses to work if it isn't. How do you upload a certificate to the system you asked? You don't! You have to mail it to them for them to SSH into the system and install it manually. When will that be possible you ask? SOON™.
At least after a while i got them to just disable the 'feature'.
While we are at 'features' (sorry for the bad structure): They have this genius 'smart redirect' feature that is supposed to throw you right back where you were once you're done editing something. Brilliant idea, how do they do it? Using a callback libk like everyone else? Noooo. A serverside database entry that only gets correctly updated half of the time. So while multitasking in multiple tabs because the performance of that thing almost forces you to makes it a whole lot worse you are not protected from it if you don't. Example: you did work on ticket A and save that. You get redirected to ticket B you worked on this morning even though its fucking 5 o' clock in the evening. So of course you get confused over wherever you selected the right ticket to begin with. So you have to check that almost everytime.
Alright, rant over.
Let's see if i beed to make another one after their big 'all feature requests on hold, UI redesign, everything will be fixed and much better'-update.5 -
That feeling when the feature you've been working on everyday for the past 2 months is pushed into production.
My baby's all grown up now 😭8 -
Yesterday was Friday the 13th, so here is a list of my worst dev nightmares without order of significance:
1) Dealing with multithreaded code, especially on Android
2) Javascript callback hell
3) Dependency hell, especially in Python
4) Segfaults
5) Memory Leaks
6) git conflicts
7) Crazy regexes and string manipulations
8) css. Fuck css.
9) not knowing jack shit about something but expected by others to
produce a result with it.
10) 3+ hours of debugging with no success
Post yours27 -
Laravel is the worst framework ever.
Everything has to be made convenient and easy. That sounds amazing, because developers want to save time, worry less about boilerplate code, right? No more constructors, no more dependency injection, fuck all the tedious OOP shit... RIGHT?
It does one thing well: Make PHP syntax uniform and concise through easily integrated libraries such as Collection and Carbon. But those are actually not really part of the framework... just commonly integrated and associated with Laravel.
The framework itself is completely derailed: You can define code in a callback in the routes file. You can define a controller in the routes file. You can define middleware as a parameter to the route, as a fluent method to the route, you can stack them up in a service provider. Validators can be made in controllers, Request objects, service providers, etc. You can send mail inline, through Mailable objects, through Notification objects, etc.
Everything is macroable, injectable, and definable in a million different places. Ultimate freedom!
Guess what happens when you give 50 developers of various seniority a swiss army knife?
One hammers in a screw with a nail file, the other clips the head from the screw using scissors, and you end up with an unworkable mess and blunt tools.
And don't get me started about Eloquent, the Active Record ORM. It's cute for the simple blog/article/author/comment queries, but starts choking when you want more selective and performant queries or more complex aggregates, and provides such an opaque apple-esque interface which lets people think everything is OK, when in reality it's forcing the SQL server to slowly commit suicide.50 -
Boss comes in and gives me some js code for syncing data (he hacked it together the other day, really messy with like 5 callback lamdas stacked into each other)
Boss: Make it faster and more reliable and add some progress indicator
So i look at the code and he literally pulls all the data as one json (20+ MiB). Server needs multiple minutes to generate the response (lots of querys), sometimes even causing timeouts....
So i do what everyone would do and clean up the code, split the request into multiple ones, only fetching the necessary data and send the code back to my boss.
He comes in and asks me what all this complexity is about. And why i need 5 functions to do what he did in one. (He didn't -.-). He says he only told me to "make it faster and show progress" not "to split everything up".
So I ask him how he wants to do this over HTTP with just one request...
His response: "I don't care make it work!".
Sometimes i hate my job -.-11 -
It's not that I hate PHP, I just hate the lack of consistency in standard function naming and parameter order, nonsensical attribute access, nearly-meaningless comparison operators, reference handling, case (in)sensitivities, and more!
I mean, look at these functions:
strtoupper(...)
bin2hex(...)
strtolower(...)
And look at THESE FUNCTIONS:
array_search($needle, $haystack)
strpos($haystack, $needle)
array_filter($array, $callable)
array_map($callback, $array)
array_walk($array, $callable)
And let me jUST USE SOME ATTRIBUTES:
$object->attr = "No dollar sign...";
Class::$attr = "GOD WHY";
HOW ABOUT SOME COMPARISONS:
(NULL == 0) // true
(NULL < -1) // ALSO true
Functions AREN'T CASE SENSITIVE (at least variables are).
Wanna dereference? TOO BAD, YOU'LL HAVE TO GET OUT THE TNT.
Alright, yeah, I hate PHP.19 -
God damn fucking shit.
Now I know again why I don't do apps.
This is a app as simple as can be:
Enter a link, click a button, do a http request, download a file.
BUT FUCKING HELL WHY ARE YOU SO FUCKING RETARDED ANDROID?!
I'm not familiar with java but i don't care why is this so freaking unintiutiv to get shit done? Why are there thousands of ways and none works or atleast at a easy way? Make an object for this, make an object for that...
THIS IS RETARDED.
In PHP a simple "file_get_contents" would do the job. I were even down for some curl shenanigans if it were an easy implementation. BUT GOD DAMN.
URL url = new URL("http://fuckinghardcoded.com")
Oh no can't compile because that MIGHT be an invalid URL. Ok try catch this or just tell the rest of the Programm to watch out for this bad boy cause he might throw a MalformedURLException.
Ditch that and try volley. Everything is document except how to fire that queue! Does it do that by itself? Do I really have to do an override to a function while declaring? CMON ON I'M A WEBDEV IS THIS TRYING TO DO A FUCKING CALLBACK AND IS THIS TRYING TO BE AN ANONYMOUS FUNCTION??? Why is this so frustrating and confusing? I'm also mad at myself this is dropdead simple shit but I can't get it to work. Fuck this, fuck java , fuck android and fuck myself10 -
FUCK THE RECRUITERS WHO ASK US TO MAKE AN ENTIRE PROJECT AS A CODE TEST.
Oh you need to scrape this website and then store the data in some DB. Apply sentimental analysis on the data set. On the UI, the user should be able to search the fields that were scraped from the website. Upon clicking it should consume a REST API which you have to create as well. Oh and also deploy it somewhere... Oh I almost forgot, make the UI look good. If you could submit it in one week, we will move towards further rounds if we find you fit enough.
YOU KNOW WHAT, FUCK YOU!
I can apply to 10 others companies in one week and get hired in half the effort than making this whole project for you which you are going to use it on your website YOU SADIST MOTHERFUCK
I CURSE YOUR COMPANY WITH THE ETERNITY OF JS CALLBACK HELL 😡😤😣9 -
I got a callback for mobile app development, I told them I had only worked in Android. When I got to the actual interview, "ok, your Resume and all is fine and all, but we are actually looking for an iOS developer" I stood up and walked out. I mean what in the name of holy fucking hell were you thinking you miserable son of a bitch.3
-
JavaScript Motherfucking Asynchronous Bullshit.
I get it, for quite some stuff, async is very, very useful. But why on fucking earth do so goddamn many functions NEED this (and those callback functions) and can't do without?!
If there would be good and nicely understandable await documentation that actually fucking works, I'd be so happy.
I've currently got .then after .then after motherfucking then and its irritating me to no end as it, in this context, shouldn't even be necessary. This thing I'm writing doesn't give a fuck if something takes a few milliseconds before the rest of the program can continue!!
Fuck asynchronous programming in JavaScript for goddamn everything.
(I do love JavaScript!)27 -
A lot of phrases we use in software would make awesome alternative-rock band names.
- Integer Overflow
- Curly Braces
- Recursion
- Callback Hell
- Daemon Processes
- Nested Loop
- Regular Expressions
Source: Twitter2 -
Just debugged an angularjs app for 2 hours to find out that I spelled "response" "reponse" as an http get request success callback function argument. I hate my life.5
-
Seriously? Javascript is the best?Javascript is the future?
Dont get me wrong. I have to use angularjs and nodejs in my work so I am quiet familiar with them. Js csn be usefull and make things easier and simpler but it comes with a price... You can do someting in third amount of effort but you have to debug three times more. Yes you can use typescript but thats not an option always. What about single threaded design yes you can use callback and promises but really? Thats the way it is should be working? And what about that if you need one functionality than you dowbload a module but with that you are started to depend from other 737373737 packages.
I am just simply not getting this hype around JS.24 -
Php array methods, all of them, or should i say hash methods
They should fix them. I mean they should fix placing of callback and subject params, because.
I mean
array_filter(array, callback)
array_map(callback, array)
Or they should make array a object like js4 -
I just wrote this stub function for my test and thought it was a bit ridiculous and had to share.
A function that returns a function that returns an object with just one function6 -
ajax hell/dom hell
do you know it? no dont talk abut the callback hell.
i fcking hate it when i load any modern site, and it needs a few seconds to calc some stuff, xhr this, calc that, dom/css visible that. at all it takes more time specially if you on low end to mid equipmemt.
And then you think its finally loaded, you want to click or tab something and then another xhr was Finished, dom/css changed, and the button i was about to Click moved and i click something else.
friends of me hates this to.
so please dear webdevs, stop try to be cool and fancy just because you found out how "cool" conditions in css and dom is. stop using that bullshit angular (and so on) bullshit if you cant manage to pull out a html at start that will not changr its layout all the time after being loaded, ty.9 -
PHP arrays.
The built-in array is also an hashmap. Actually, it's always a hashmap, but you can append to it without specifying indexes and PHP will use consecutive integers. Its performance characteristics? Who knows. Oh, and only strings, ints and null are valid keys.
What's the iteration order for arrays if you use them as hashmaps (string keys)? Well, they have their internal order. So it's actually an ordered hashmap that's being called an array. And you can produce an array which has only integer keys starting with 0, but with non-sequential internal (iteration) order.
This array weirdness has some non-trivial implications. `json_encode` (serializes argument to JSON) assumes an array corresponds to a JSON array if its keys are consecutive integers in increasing order starting with 0, otherwise the array becomes a JSON object. `array_filter` (filters arrays/hashmaps using callback predicate) preserves keys, so it will punch holes in the int key sequence if non-last items are removed, thus turning arrays into hashmaps and changing your JSON structure if you forget to discard keys before serialization.
You may wonder how JSON deserialization works, then? There's a special class for deserialized JSON objects, `stdClass`. It's basically a hashmap too, but it's an object, not an array, and all functions that would normally accept arrays won't work with it. So basically its only use is JSON (de)serialization. You can even cast arrays to objects, producing `stdClass`.
Bonus PHP trivia:
Many functions return nonsensical values. `preg_match`, the regex matching function, returns 1 for success, 0 for no matches and false for malformed regular expression. PHP supports exceptions, so it could just throw one on errors. It would even make more sense to return true, false and null for these three cases. But no, 1, 0 and false. And actual matches are returned by output arg.
`array_walk_recursive`, a function supposed to recursively apply callback to each element of an array. That's what docs say. It actually applies it to leafs only. It will also silently accept object instead of array and "walk" it, but without recursing into deeper objects.
Runtime type enforcing is supported for function arguments and returned values. You can use scalar types, classes, array, null and a few special keywords. There's also a `mixed` keyword, which is used in docs and means "anything". It's syntactically valid, the parser will accept it, but it matches no values in runtime. Calling such function will always cause a runtime error.
Strings can be indexed with negative integers. Arrays can't.
ReflectionClass::newInstanceWithoutConstructor: "Creates a new class instance without invoking the constructor". This one needs no commentary.
`array_map` is pretty self-explanatory if you call it with a callback and an array. Or if you provide more arrays of equal length via varargs, callback will be called with more arguments, one from each array. Makes sense so far. Now, you can also call `array_map` with null instead of callback. In that case it treats provided arrays as rows of a matrix and returns that matrix, transposed.5 -
JavaScript.
So terrible language in so many ways, the code is a absolute mess, the shit of the callback hell of functions inside functions inside functions.
And now everything it's built around the tucking JavaScript, you have to learn it by force because there is almost no project that doesn't use it.
I know it has some benefits and because that is getting bigger but the syntax is the worst shit ever, I mean, switching from Python to JavaScript is a pain.
The only good thing is it's getting better with each ES iteration, but it is still a really big piece of crap with hundreds of frameworks.13 -
Trigger Warning - Don't date JavaScript developers.
They Promise to Callback but they won't. You'll Await in vain. They don't know how to Express themselves and React to such situations.
You might not be happy to hear this, but I'm trying to save you from a Garbage situation1 -
Project Leader is explaining to teammate how their UI will call my API and it'll run asynchronously in the background. UI guy asks: about error handling? I said the callback listener will be notified if anything goes wrong. I ask the PL, what next? just log and forget about it (that's my sarcasm)? How would anyone know this has failed?
PL says: good point and can worry about this later. Lets first focus on getting things to work.
You know later never comes. Well, except when the customer reports a problem. Its like every disaster movie you've ever seen before -
Just got my first callback for a technical interview in JS tomorrow morning.
WOOOOO
*Brain*
"That's cool fam, but you just lost any ability to write anything in it."
...8 -
Last week's Android development time breakdown:
21.9% Managing state
17.7% Referring to lifecycle diagrams
15.1% Waiting for Gradle
8.5% Reading the official docs on how to use component x
8.4% Reordering auto-generated ConstraintLayout XML
7.5% Swearing
4.2% Googling “Stack overflow component x is deprecated”
3.9% Googling “Stack overflow implement component x on API 24 or lower”
3.7% Googling “Stack overflow implement component x on API 21 or lower”
3.2% Googling “Stack overflow implement component x on API 19 or lower”
2.9% Googling “Stack overflow callback y called twice”, realising its a feature and not a bug, swearing a lot
2.0% Checking if Flutter is mature yet
1.0% Implementing business logic4 -
if ( condition ) {
callback(data)
}
callback(error)
--is a lot different than--
if ( condition ) {
callback(data)
} else {
callback(error)
}
callbacks are not return statements 🤦♂️9 -
Back in the day, when callbacks was all I've found on Internet tutorials, my code looked like this (img) . But then I found something called "async" and it changed my life!
But I couldn't let go of my old ways, so the code with async looked just like the callback one, but with new boilerplate code.
The thing is: you can't simply USE something new like you were using the old one. you'll probably use it wrong. you have to understand that this new thing is different and adapt your thinking process to better work with it.
you can sit on a skateboard and go forward using your hands on the ground to push it, but that's not how it was designed to work.
I still use callbacks because I have no intention of rewriting my working codebases right now (because they work just fine). But, even with my struggles in changing to new tech, I've learned to adapt (sort of).1 -
I always thought callback functions are some mysterious things that high end devs understand. After learning it I feel to stupid now. 😭3
-
Just got a new job at an old school hardware company. The codebase is giving me heart attack. They don't care about dev experience or code navigation at all. Every attempts to modernize the codebase is so half assed. All patches are so bloated that make the codebase even worse.
Frontend is migrated from prototype-oop-jquery cluster fuck to AngularJS, then finally angular. Holy moly, all business logics are baked into UI "classes" using prototype chain. When they migrated to AngularJS, someone simply added a wrapper to that jQuery cluster fuck class and overwrote all the prototype with a 10k +lines file. Since all the methods are hidden in either prototype, JS object, or callback function, it's impossible to trace the data pipeline using IDE when "go to definition" on update() method gives you all the update methods/string in all objects/classes. And they don't care about immutability. References are taken out, renamed, and mutated everywhere. Finding the source of a bug is fucking guessing game.
I don't know what trick they use that makes cLion static analyzer fail.
And there is no unit test or spec doc.
Fuck me dead3 -
After years of my own dodgy javascript codes, I've started to throw away everything I know about javascript and learn it from scratch.
Learning that functions are objects really helped in restructuring a pile of my code. Eg passing it as a parameter to be executed.
Suddenly callback functions make a lot of sense now, and I've got a new found respect for the language. -
- Knock Knock
- Knock Knock
- Who's there?
- Your mysql query callback
- Your mysql query callback4 -
You know you have chosen the wrong JS library when you read a function definition like this:
validateSync(schema, options, callback) -
When it feels impossible to get your javascript callback to happen at the right time, so you just throw the callback somewhere just so it works, but you know that it's not the ideal spot for it... 😡😡😡
🖕💻6 -
A year ago I ranted, that I understood JavaScript callbacks.
That was a lie. I knew nothing.
But I think I scratched the surface by getting into functional programming this time.3 -
A (work-)project i spent a year on will finally be released soon. That's the perfect opportunity to vent out all the rage i built up during dealing with what is the javascript version of a zodiac letter.
Everything went wrong with the beginning. 3 people were assigned to rewrite an old flash-application. Me, A and B. B suggested a javascript framework, even though me and A never worked with more than jquery. In the end we chose react/redux with rest on the server, a classic.
After some time i got the hang of time, around that time B left and a new guy, C, was hired soon after that. He didn't know about react/redux either. The perfect start off to a burning pile of smelly code.
Today this burning pile turned into a wasteland of code quality, a house of cards with a storm approaching, a rocket with leaks ready to launch, you get the idea.
We got 2 dozen files with 200-500 loc, each in the same directory and each with the same 2 word prefix which makes finding the right one a nightmare on its on. We have an i18n-library used only for ~10 textfields, copy-pasted code you never know if it's used or not, fetch-calls with no error-handling, and many other code smells that turn this fire into a garbage fire. An eternal fire. 3 months ago i reduced the linter-warnings on this project to 1, now i can't keep count anymore.
We use the reactabular-module which gives us headaches because IT DOESN'T DO WHAT IT'S SUPPOSED TO DO AND WE CANT USE IT WELL EITHER. All because the client cant be bothered to have the table header scroll along with the body. We have methods which do two things because passing another callback somehow crashed in the browser. And the only thing about indentation is that it exists. Copy pasting from websites, other files and indentation wars give the files the unique look that make you wonder if some of the devs hides his whitespace code in the files.
All of this is the result of missing time, results over quality and the worst approach of all, used by A: if A wants an ui-component similar to an existing one, he copies the original and edits he copy until it does what he wants. A knows about classes, modules, components, etc. Still, he can't bring himself to spend his time on creating superclasses... his approach gives results much faster
Things got worse when A tried redux, luckily A prefers the components local state. WHICH IS ANOTHER PROBLEM. He doesn't understand redux and loads all of the data directly from the server and puts it into the local state. The point of redux is that you don't have to do this. But there are only 1 or 2 examples of how this practice hurt us yet, so i'm gonna have to let this slide. IF HE AT LEAST WOULD UPDATE THE DATA PROPERLY. Changes are just sent to the server and then all of the data is re-fetched. I programmed the rest-endpoints to return the updated objects for a very reason. But no, fuck me.
I've heard A decided (A is the teamleader) to use less redux on the next project and use a dedicated rest-endpoints for every little comoutation you COULD DO WITH REDUX INSTEAD. My will is broken and just don't want to work with this anymore.
There are still various subpages that cant f5 because the components cant handle an empty redux state in the beginning, but to be honest i don't care anymore. Lets hope the client will never find out, along with the "on error nothing happens"-bugs. The product should've been shipped last week, but thanks to mandatory bugfixes the release was postponed to next week. Then the next project starts...
Please give me some tips to keep up code quality over time, i cant take this once more.
I'm also aware that i could've done more, talking A and C about code style, prettifying the code, etc. Etc. But i was busy putting out my out fires, i couldn't kill much of the other fires which in the end became a burning building (a perfect metaphor for this software)4 -
MOCHA YOU FUCKING BITCH, THERE IS A DONE() CALLBACK BEING CALLED IN THIS TEST, WHAT IS YOUR PROBLEM??? I WILL RAPE YOUR FUCKING SOURCE CODE. But really mocha test, why u no work so we can both move on with our lives 😣😦😞7
-
My brain used to be normal and I used to think callback is bizarre.
Now I understand callback and my brain has become bizarre. -
can we all take a moment to appreciate the developers of flutter. they're smart, and they took the time to make flutter the *right* way.
they used an easy to learn language that's ideal for mobile development, which means hot reload/restart is possible (because dart supports aot and jit compilation)
the way it's designed is beautiful. everything is a widget, and it's easy to customize them via named parameters.
the community is great. it's not large, but it's supportive, with two active subreddits. yesterday i asked a question on r/flutterdev, and a member of the flutter team at google answered the question with a comprehensive answer.
flutter is very consistent across platforms. if it works on android or ios, you can bet it'll work on the other just as well, with the exception of platform-specific code.
it is VERY performant. unless you write a major bottleneck, 60fps is easy to achieve.
animations are EASY. define a tween and animation controller and then write a callback function. not to mention it's straightforward, and complex/combined animations are easy, too.
you can get almost direct access to the canvas, should you need it, with custompainter.
oh my god, this is revolutionary in the programming world. development is quicker than it is with native android alone, and for people who have no access to a mac, like me, i can develop for ios and compile via code magic. if you haven't checked it out and you develop for mobile, check it out.
oh yeah, did i mention it's not just mobile. hummingbird - flutter compiled to web - is already in experimental public betas, and will likely be released by the end of the year. there's also experimental desktop support, which is amazing, and much better than electron. not to mention flutter is the future, as it will be the primary way to make apps on fuchsia os.13 -
DEI QA: “For step 2 should the checkbox be checked? Or uncheck ?”
… Step 2 of my testing steps reads: “Check it [the checkbox], save it, reload it. The box should still be checked. Repeat to uncheck it, just to be pedantic, then leave it off so we can test the existing behavior.”
🤦🏻♀️
DEI QA: “The payment_method_identifier will be in api callback logs if `Return payment method identifier in auth/confirmation callbacks` is checked?”
🤦🏻♀️
Me: it does what it says on the tin.
DEI QA: “BTW its a `tin`.”
DEI QA: “In Canada its `Taxpayer Identification Number`”
🤦🏻♀️ -
I need to delay execution of code in a for loop, how do I do that?
PHP: Sleep(3000)
Javascript:
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
console.log(num)
})
console.log('Done')
}
start()
Fuck you Javascript17 -
You wrote a little simple and clean mvc framework to work faster on some new projects. It can "compile" tags as {% var %} or {% array.key %} in the html code with support of {% for arrayOfHash in hash %} foreach construct and nice features, it can call api's callback in a smart way as ghost methods of a class, he can make routes with the route provider. You tested it and made a little example, after you went in the bathroom you read the index code and you started staring at the beauty and elegance of it. You go to bed happy and sleep. The day after you wake up and realize that it's unuseful because there's a lot of mvc framework that surely are better and ready to use, so you lost useful time. Have you ever feel this way? MVC: Me Versus Creativity.5
-
I feel very anxious when developers interviewing me asks
1. is nodejs single threaded or multithreaded ?
2. How does node handle requests
3. How do u manage concurrency
4. What is event emitter and callback.
Dude i have given you my resume, without knowing these things i could never do that ?
I feel the discussion must be based on concepts and general problem solving rather than focusing on one technology. Tech can always be learnt.6 -
Was wondering why my callback wouldn't run when I intended.
> console.log each iteration
> realizes it skips the goal and goes up one
> decided to cheat use greater than instead
> ACCIDENTAL RECURSION
> Oh, there's the problem
> Thinks about going to bed for the night7 -
Fuck NodeJS. I don't want you to be asynchronous sometimes. My gahwd I need like 3 deep nested loops just to get you to make a request and compile a damn JSON of requests.
I'm learning Golang goodbye forever node.15 -
Finally got through a second interview with a company that won't abuse me(working late nights, early mornings, and weekends for months now) on Thursday! They even said I did a good job and they like me! Most intense waiting of my life for a call back!2
-
Best explanation of callback from Stackoverflow:
Guy 1 to Guy 2: Hey dude I wanna do something when a user clicks in there, call me back when that's happens alright?
Guy 2 calls back Guy 1 when a user clicks here -
[CMS Of Doom™]
Ah, yes, their built-in bullshit newsletter module just sent the n-th user n emails. Wonderful considering n=368.
The culprit? Better don't ask...
OK, anyway: So the mailer is running as a CRONjob, but nah, not as a console script call but by a public HTTP GET URL call, fucking obviously (it's the CMS Of Doom for a reason).
So these fucking imbeciles "implemented" an ob_start() callback where HTML links are - for whatever fucking reason - modified by some regex (obviously everybody knows parsing HTML by Regex is trivial). In this case the link was somehow modified to recall the mailer Cronjob...
This must have upset the pngoing mailing process thus spamming mails. Whyyyy
And I've thought I've seen it all after 6 months in this legacy hell...
This is why you don't run a company consisting of only beginners in PHP (in cluding their "CEO")! -
I've spent many years in a bubble of 1 backend lang.. but when i started checking out other langs, I got very annoyed that each one has same basic stuff but with different syntax... Can we just agree on something? Ffs!
We really couldnt come up with unified syntax for -
false, False FALSE
OR or ||
def func function
And dont get me started on all the variations of for loops... Its like we are trying make our life hard
Looking at new versions of some langs, looks like they are copying new stuff from one another.. with different syntax.. thanks!
Nodejs trying to look more like she doesnt have callbacks.. while other langs adding callback functionality... Why why why?!2 -
I had been banging my head on an issue for 2 days. The solution?
Replaced
“window.addEventListener(“message”, callback)”
with
“window.onmessage = callback”
What. The. Actual. Fuck??!!
Aren’t they supposed to be the same thing?? It’s written on MDN’s article that the latter is an alternative way of doing the former.
What the fuck then? I am actually really pissed right now. Ragefully pissed.11 -
Sometimes I look at my old code and I wish I could go back in time and punch my self in the face for writing that shit
But then I look at it as I'm actually improving so guess it's ok?
Spent 4 hours fixing callback mess I had in my ReactJs project, making it all as Promise and async hope I don't fuck up this time -
Js -
"Let me just call this function"
"Oh I need to do something with the return value. Callback"
"Oh I need to do something with that value too. Another callback..."
"Oh, again. Another callback"
"I should have thought about this more beforehand..."1 -
I hate you fucking callbacks. why don't you callback in the fucking order you were motherfucking called!!!! why must you force me to call a callback a callback!! 😣😡😤👹2
-
Well I program in PHP, JS and C#.
Weak typed variables are literally the worst thing ever.
In C# I particularly hate the way callback as handled9 -
I wish I had stack callback for my brain. I would love to know how I came to be thinking about sword fighting with stale baguettes at 8 in the morning.1
-
Run test
everything ok
Run again
everything ok
Run again
error
Run again
everything ok
*wtaf is happening?*
I googled for the cause of a "double callback" error and found out that supertest was throwing it when I was attaching a file to the API request. found no conclusive way to solve it, just that "supertest does it from time to time".
Trying to investigate further, I made a function to repeat the API request 5 times in a row. Everything passed. The run it again. Two failed. Again and everything passed.
this is bullshit
fml -
I don't want to ever hear that you're proficient in JavaScript if you put a callback function call inside of an async function right after using the await command.
All you manage to do in the end was make a simple function that gets data to populate a dropdown menu into something that is absolutely more awful to look at than the worst callback hell possible.
Refactoring this code base has really questioned my sanity and how much I'm willing to spend on alcohol.4 -
Let's focus/master computer architectures, coding paradigms, datastructures. Everything comes after that...the problem with todays academics is that they are more focused on immediately deploying students to industry; theyre more focused on teaching specific frameworks and specific language instead of teaching how things work...i bet most students (at least in my country) are having troubles with endianess or encoding or even byte manipulation or what a thread is....If im going to be the teacher for example of an oop subject, ill let the student choose the language they want as long as the oop paradigm is intact ,it will be fine.. i dont friggin care whether you know vue or angular or swing if you dont even know what a callback is..
-
Generator functions should be treated like sorting algorithms: Not worth your time if all you have is 4 or less async instructions.
Callback hell is actually kind of nice and warm when you're a just a few levels down. If you're really confused by your obfuscated code, you suck at node. -
!rant
I've been working with Golang for a while now and I've come to love the generics they introduced. Making stuff type-safe is a bit of a hassle, but it pays off greatly.
One thing I had yet to consider though, is that functions are also a type, so that those could be made generic too.
func DoThing[F func(string) | func(int)](callback F) {...}
Now you can deliver both function types and I can differentiate them using a type switch.
Weird that sometimes my brain doesn't make that connection immediately...1 -
I'm developing a new (just for fun) programming language and I'm wondering what features I should add next? These features are already implemented:
- Printing text
- Variables
- user-input
- Datatype conversion (String, Int, Float, Bool, List, Dictionary)
- lists/arrays
- dictionaries
- Sorting
- Shuffling
- random numbers & choices
- Math stuff like: log, abs, floor, ceiling, sin, etc...
- Time & Date
- Working with files
- If-else statements
- Ternary operators
- Loops (for & while)
- Functions
- Classes
- Error handling
- Importing libraries & other scripts
- Arrow/callback functions
- Escaping (\)
is there anything you often use missing?11 -
The problem: callback hell. Code would be indented by three hundred fucking spaces just to do some async work. Your code would end with thirty lines of closing curly brackets
Solution: async and await.
The problem, reborn: NoSQL. Code is indented by three hundred fucking spaces just to run a query. Your query ends with thirty lines of closing curly brackets.4 -
I've noticed that lately I've not been putting a lot of effort in making my code clean, and in learning new stuff, too. If it works, that's enough for me. I just made some endpoints in node and it's the biggest callback hell you'll ever see, but I don't fucking care, tbh. Is it time for me to change my work field? Have you ever felt this way?3
-
I always find it funny when people fight over certain aspects of Javascript. Like how callback hell is manageable, async functions etc
Do they forget that Javascript itself is a flaming pile of shit language to begin with? The inventor literally created the language in a week, so that should be the base line assumption on how "capable" that language will come out to be.13 -
Not a specific bug, but I always have that satisfactory feeling when I fix a bug inside a code like this:
1. Spaghetti af
2. Duplicated af
3. Heavy use of static fields instead of passing via callback when required
4. variable names like: textbox1 ..etc.
5. No comments
It is true that is a huge pain in the ass to deal with, but then I look at it as I was able to create something out of that mess, I mean all is mixed up nothing is clear, no clue where it starts and what caused it, but then I put the pieces together and end up with a solution of what I thought to be: It will never be solved when that mess is here.
Not an excuse for messed up code, I try fixing whenever possible, but hey, at least I did not run away and give up -
JS' array function forEach. Why. Why does it exist? How is a function with a callback better than a freaking simple language feature like for of? If I recall correctly, forEach is older than for of, but people still use it nowadays, and too frequently...
Hate it, definitely.
Also, talking about enumeration in JS, Object's "static" method entries. I can't see how it can't be an instance method. Same for keys and values, but I usually don't care about them.12 -
Why the fuck does Android's SyncAdapter stop working without ANY notice since API level 26 when available storage is low?
They fucking deprecated the system-wide broadcast that the storage is getting too full to properly work. And there's no replacement!!! 😠 No callback. No exception. Nothing. You ask the SyncAdapter to sync and it will just not do it until some storage is freed.... 😭 -
Callback your functions, not your ex.
Hash is for your data, not you,
Query tables, not your loved ones. -
Have you been using node js for a while now? Are you aware of how things work internally in node js? the queues in node js? Doesn’t matter if your answer is yes or no, I will let you in on one little secret which will clear all your doubts regarding how node js works asynchronously under the hood.
Read the following article to know more
https://readosapien.com/queues-in-n...rant node-js event-loop callstack nodejs macrotask-queue callback-queue javascript microtask-queue js programming software2 -
Pluralsight said I'm in the 85th percentile of people who know JavaScript and therefore I'm an ”Expert"
So now I walk around like, "bro do you even know how to pass a callback?" 😏 -
And the award for the least intelligent feature request on Github goes to...
The guy that wants a callback for when the QR code has been scanned successfully.
In a library that generates QR codes.
https://github.com/davidshimjs/...1 -
Software development is a special kind of a nightmare. The kind that you wish you could wake up from, but can’t, because code is money and money is life.4
-
One of my greatest personal challenges has always been to try and balance "good enough asap" and "but I know how to do this better if I spend a few more days on it". I like to think I've gotten better at it; Leaving things be if they are to spec and keeping my implementations consistent with existing work even if I disagree with it being ideal.
Which makes this new project we're taking over my trial of fire. The combination of the codebase - a Vue app from a previous rant where Vue is mostly used as a callback function to alter the dom using the document api in plain js - and the expectation for us to implement new features and minor tweaks to a user base of literally 4 people is like a charicature of the type of work I struggle with.
Even writing all this I'm evaluating if I'd be able to remake it all from scratch fast enough to sneak it in without anyone noticing.
It's an uh, "opportunity" for me to learn how to handle these situations, I suppose. Have mercy.1 -
Can we take a moment to recognize how absolutely retarded JS' event system is?
Events aren't objects. No, they're managed by an object, and identified by a string.
To subscribe to an event, you call object.addEventListener(name, callback). Because for some reason we can't just have an event object. Events MUST have an owner.
But to unsubscribe you don't call the function addEventListener returned, you don't use the token it returned either. No, you pass the same function to removeEventListener.
Because we don't use serializable tokens like in PP, and we don't return functions like in FP, no, we use functions as tokens, realising idiomatic DFP.2 -
WCF doesn't like me adding to lists...
I have to make an uno game that supports multiplayer with WCF for school...
I have a player class that has a list of card classes.
I have a function called dealHand, it adds Cards to the hand list...
I also have a callback function for updating my wpf gui...
For whatever reason if when the gui calls dealhand and I try to use myList.add(new Card()) then the updategui function in my wpf client doesn't fire...
But if I take a seperate method called makeHand which returns a list of cards, and just do myList = makeHand() then that works fine...
Never been so baffled/cursed so much at code before... Is there something about Lists that WCF doesn't like? Seriously... was weird...
Hopefully that was somewhat coherent...4 -
As opposed to my horrific experiences with PayPal, Swish, a Swedish (really smooth) payment processor has some really nice documentation. An example:
"The callback, in the happy case, will return an intermediate response with the status DEBITED."
And other nice things such as clear numbered lists describing user flows, with images for extra clarification. Also, they provide full lists of error responses and in many cases suggested way to proceed with these error cases.
And as the cherry on top, this is developed as a cooperation between a few Swedish banks. The banks, who are the most thick type of companies when it comes to IT, does it better than PayPal.6 -
Im ranting in progress of the issue so i dont get the urge to do any of the things not seem as acceptable to fix this issue.
Issue: yesterday i activated a device i havent had any (even prepaid) service on in years, and had a 'new'(to me) number assigned...
Today, after being sick so muting nuisances immediately for rest, i check, 3missed calls from the same, less spammy looking number. I havent use this number for even a txt code verification at all... aside from 1 call to comcast (for the blissful irony of seeing if its an option (they need to survey physically) since im suing my current isp who didnt take my VERY NICE and explictly required in their business t&c, refund for the issue's duration.. after months of tryjng to directly get a message (not using my not technically hacking expertise like just scrubbing for email formatting and popped up in their inbox (calling them is more frowned upon)...
Their conclusion as to "why" (they nvr solved the issue... dhcpv6 was in aggressive lease mode(no response per lease(NOT batches) of about 60 for about 20 devices which i ofc use my /28 static ipv4 block... not ipv6 (they also claimed there was no logs til i dug and found verbose, long history high/med high debug level logs in their prop. dev's gui... which they forced me to use, has 2 separate cores/stacks which is done for 1 reason only... constant simultaneous ipv4 and ipv6 (so ofc was auto enabled)...
Basically it was spamming do to a config issue with their scripts, and their WAN6 dev/script's config. Have found a single person who knows what ipv6 (or v4) or wan6 device actually means... their conclusion from multiple "specialist departments " ..."we dont support ipv6 so if u had issues caused by using something we dont support it's your fault... sooooo ludacris.
.... ok back to main point.
callback options
1 schedule a call back for "later"
2 dont schedule and hang up/try some other time
3. cancel callback and join the end of the cue(from previous message it told me a callback in 6-10m or lose your place in line and go to the end... hours later no call and they definitely have the number as it reiterated -.-
...
answer to wait in line>
experiencing extremely high wait time
>your current wait time 31-60m
2.5sec later.. let me connect you to a rep ...etc (identical as in callback options intro)
> your current wait time is 30sec
waiting nearly 25min whilst typing this.(i did make sweet potato stuff, propagated a rose, fed JSON some of his new, in closure buffet of things he previously never encounted and bought a literal ton of rubber mulch)40min to a rep 5more to solve (last guy at same position didnt know this option exited, despite me decribing it verbosely to him.
Everything the automated syst asks is about account numer... there is none ive never even had a burner that was at&t brand.
Wzf.3 -
Wasted 15 minutes by:
Put the `done` in the `describe()` callback instead if the `it()` callback in a mocha test.1 -
Hello guys..i dont know why i am posting it here...but i am really depressed..i am a fresher mern stack developer...i am applying everywhere but i am not getting any callback from any HRs..i am thinking of either running away or killing myself....i dont know what to do...my wife earns just 9500 rupees from her call center job and we both have to give 5000 every month to my mom for household expenses....it has become vert difficult for me and my wife to save money...i dont know what to do....28
-
Oh god why... Why is it that every time I work with software defined radios, I keep on having to rely on not just incomplete, but at times misleading documentation 😩
Last time was GNU radio, with the doc telling me that I could define an input for a processing block using either a type or a (type, size) tupple, only for the actual code to scream at me in confusion upon my passing a tupple.
Now is that other SDR's SDK, which, as if being built upon eclipse wasn't bad enough, managed to make its serial communications confusing. Why can't you just let me set a callback to rx interrupts, you daft punks...1 -
fighting with a submit button callback not firing..... at least the cat and I have good music to listen to.1
-
WHO THE FUCK THINKS
THIS SHIT
TS:
```
const a = function(callback: (err:any,data:string) => void):void{
callback(null,'balls');
}
a(function(err:any,data:string){
console.log(err,data)
})
```
IS BETTER THAN THIS
ES6:
```
const a = function(callback){
callback(null,'balls');
}
a(function(err,data){
console.log(err,data)
})
```
kys10 -
Sins? All of em'.
Infinite loops of recursive callback carnage, just because I like to watch it burn. -
I've almost had enough of Atlassian. So, our customers want us to integrate Jira / Confluence support into our software.
I initially thought it would be a great addition to the other providers we support, so I explored it further.
After trying Confluence – and already knowing first-hand how horrendous Jira is from a previous role – I left in absolute disgust at not only how horrendously slow, buggy and overengineered Confluence is (just like Jira), but how horrendously FUCKING SHIT their developer / API documentation is. I suspended the project at this point. No fucking way was I allowing time to be sucked away because another company can't get their shit together.
Customers kept asking for integration support, so I authorized the team to revisit Jira integration support a few weeks ago. Nothing has changed. Documentation is as shit as before, software as slow as before and the platform as overengineered as before. No surprises.
Here's the problem:
1. You can't set multiple auth callback URLs so you can actually test your implementation.
2. You can't revoke access tokens programmatically. Yes, really.
3. You need to submit a ticket to get your integration approved for use by others, because automating this process is clearly fucking impossible. And then they ask questions you've already answered before. They don't review your app or your integration beyond the information you provided in the ticket.
4. Navigating the Atlassian developer documentation is like trying to navigate through a never-ending fucking minefield. Go on, try it: https://developer.atlassian.com/clo.... Don't get too lost.
I was so very FUCKING CLOSE to terminating this integration project permanently.
Atlassian, your software is an absolute fucking joke. I have no idea why our customers use your platform. It's clearly a sign of decades of lazy and incompetent engineering at work, trying to do too much and losing yourself in the process.
You can't even get the fundamental shit right. It's not hard to write clean, maintainable code and simple, clear and concise API documentation.1 -
ScalaJs React compiles Scala to React.js.
There's some cool typing involved but I haven't done web front-end since nested tables were meta, so there's lots to learn.
There's exactly one senior dev at my company who is fluent in this ScalaReact, so I tag him in the PR for my project. Every day at 10:00 am, slack publicly posts a reminder with @mention that he hasn't reviewed my PR.
Three days later I haven't heard anything so I send a DM over slack asking for feedback... No response.
Four days after the PR I beg for 10 minutes of pairing time, because something in my component hierarchy smells funny. He doesn't have time for me until 5:00 .
I've now built almost a weeks worth of work on the original PR and the feedback I get is 'this works, is performant, and has no obvious bugs, but you can't merge it until you restructure the underlying component hierarchy'
It takes me and another senior dev an entire day of pairing to implement the changes without breaking anything. But, I asked for the feedback because I wanted to learn and write good clean code so I'm irritated but willing to move on.
Yesterday I posted in slack that I was having a hard time following my callback chains to find where the color was assigned to a <td (because I had to add a coloring rule). I wanted to know if I could change the type signature of a component from Tagmod (one or more HTML tags) to VdomTagOf[TableCell] so that it would be clear where the color was assigned.
Instead of just telling me 'no' and giving some context, the react dev gives me:
"Why would a dev need to know about the type unless they’re actually trying to use the thing ? Those are all great questions, but id suggest trying not to prematurely optimize for those until they actually come up"
I flipped my shit. After you couldn't make time for me for a WEEK I had to justify to the CEO why I was spending a day on PURE refactors to accommodate your PREFERENCES. Meanwhile when I'm being VULNERABLE and exposing that I am confused and struggling to complete my task you DISMISS my concerns and attack my motivations.
Unfortunately, this is all happening in the public slack channels and I start defending readability and my premise while triggered. Now I'm riding the shame train for fighting in public slack and trying to pretend none of this ever happened.1 -
I expect somebody else has chosen this as well, but anyway:
Async.<any-function>, cause they brought me out of callback hell and taught me the undefined ways async...arghhhh fuck -
!rant
Aside from performance concerns.. which one would you prefer for an optional callback?:b
I always use B, but i'm kinda interested in what you guys say.
✌9 -
So fun fact about message-passing plugin APIs, everything becomes a parallel programming problem. My lexer (the part of an interpreter that recognizes fundamental syntax elements) spawns a callback thread with request and reply channels, and then messages a plugin which is able to either talk to the callback thread or message the original thread with a successfully parsed token or an abort.
It has just occurred to me that plugins are under no obligation to sequence their requests to the callback thread, which means that having one channel for requests and one for responses no longer suffices; the requests need to each contain their response channel. -
Currently fixing concurrency issues with a callback which is called so frequently it probably has multiple instances running and which can't ever be paused. Also, it isn't allowed to allocate or free memory. Riddles like this are the reason I got into computer science.
-
Ok. What the flying ligardshit?! Write down the most ridiculous sentences you had been given when you were dismissed.
Today mine was:
They: Nothing got developed till deadline.
Me: *surprised* Okay maybe I overlooked something, please point out what wasn't
They: This and that project was due tomorrow.
Me: *blankly & calmly* You mean the projects that has been deployed on last friday and wednesday?!
They: *still with pokerface* Okay that is not the real reason. The real reason is we get this type of behaviour from you a lot.
Me: *dead seriously* You mean I have to tolerate your false accusations and bow my head with gratitude?!
They: *angryly* See that is what we are talking about, we don't feal like we have chemistry?
Chemistry?! 'The fuck are you talking about??? Come on!! What the goose shit you think we are some high school teenagers in their first month of relationship?! "Family" my ass!
Okay I know it is much easier to dismiss somebody without having to pay the end-of-year premium but come on, don't assume I am a braindead idiot like you!!!
Things ahead:
- Callback the recent contacted companies
- Update LinkedIn
- Find another job
- Find a way to blacklist companies preveting anybody else falling for cimpanies like this one
- If none create one
- If found / Upon creating put them on
If you happen to be able to help me with one/some/all of the above, let me know2 -
Call me when its done => Callback
Call me when it is done => Hooks
Call me when it is done => Events
Anything left ...4 -
So I have an assignment due in an hour, we need to make a basic game that implements multiplayer using WCF
I have wpf clients that connect to a service, they connect fine but for whatever reason my callback isn't firing to update the gui... the thing is though, it was firing earlier (mind you when it fired off I ended up getting null references)
I fixed the null references (turns out I wasn't serializing stuff that needed serializing) but now my updategui method just doesn't fire, period. zero exceptions are being thrown, zero errors are being given...
At this point I might just rewrite the whole thing until it breaks so I can figure out what broke it... Like trying to debug something with zero errors/exceptions being thrown is hard... -
Bloody fucking Android! Updates, updates and more updates! My development Nexus 5X won't allow me to sideload apps since it updated... Hello, printf debugging! Goodbye, profiler and debugger!
My hate for Android grows with each version after 4.0.$something... 2 was shit, I missed 3, 4 was OK, and since then it's going steeply down.
And don't get me started on Material Design...! Good luck figuring out what's a button and what's a label...
And what's up with the "let's keep all apps running all the time to save a few ms on start" philosophy!? Who thought that is a good idea!? Yeah, System.exit(0) works, but... Is it so hard to determine when it's not needed anymore (has no services running etc.)? Why should a web browser (for example) stay in memory after I quit? Minimize is a thing (Home button), why make it so confusing?
Another thing - feedback-less async tasks - why? I like to know when it is working in the background... How the hell am I supposed to find out if it is supposed to do this or if it is frozen?
And Android deciding to kill your process whenever it pleases without any callback... Happened to me once with an Activity in the foreground (no exceptions anywhere in my app, it just quit). How do you do IO properly? It seems you can't guarantee some file or socket or something that must be closed doesn't stay open (requiring to restart Bluetooth 'cause the socket wasn't closed, for example)...4 -
Over the last week I've slowly grown to fucking hate IMAP and SMTP. You'd think after so many years we'd have come up with better servers to manage email but no we still rely on fucking decades old protocols that can't even batch requests.
To make things worse I need to attach to IMAP through node and that has been a nightmare. All the libraries suck ass and even the ones tailored towards Gmail don't work for Gmail because Google decided one day to fucking out the header at the bottom of some emails and split into mimeparts. Also why the fuck is fetching email asynchronous? There's no point at all since we requests are processed line by line in IMAP, and if the library actually supported sending asynchronous requests it wouldn't require a new object to be created for each request and allow only a single listener.
Also callbacks are antiquated for a while and it pisses me off that node hasn't updated their libraries i.e. TLS to support async/await. I've taken to "return await new Promise" where the resolve of the promise is passed as the callback, which let's me go from callback to promise to async/await. If anyone has any other ideas I'm all ears otherwise I might just rewrite their TLS library altogether...
And this is just IMAP. I wish browsers supported TLS sockets because I can already see a server struggling with several endpoints and users, it would be much easier to open a connection from the client since the relationship is essentially:
Client [N] --- [1] Server [1] --- [1] IMAP
And to make the legs of that N : N which would fix a lot of issues, I would have to open a new IMAP connection for every client, which is cool cause it could be serverless, but horrifying because that's so inefficient.
Honestly we need a new, unifying email protocol with modern paradigms...8 -
Ripped apart nice class, which had nice asynchronous callback interface, add sleep() where needed.Renamed it as sync class.WTF
-
Are native Android apps easier to write now than like back in KitKat days?
I need a app that gets root permissions and reads a db file of another app (Yes my phone is rooted).
Anyone can give a gist, I forget do I need to create a Service background worker to do the DB reads... Or just need to send the op to a bg thread with a UI callback sorta like Node...
I did try writing a ReactNative app maybe last year just to try it out but can't seem to easily get root access... And the SQLite package is buggy, couldn't npm install on Win10...14 -
Help, again! I’m doing a simple ajax using jquery’s load function but for some reason it results in a refresh of the entire page! There’s no callback or any other values being passed, it’s just the url to the html file. Btw even if i reduce the html file I’m sucking in to an innocent <p>hello</p>, it still fucks up and the page reloads so it’s not like there’s some bad javascipt going off. This is part of a project being done using codesandbox, so I’m not sure if there’s something going on with it. This is my first ajax in this environment8
-
Neat trick that I discovered today:
Because React.useCallback is a thing, you never need a custom react hook to take a dependency array. You can always express your dependencies by wrapping the callback in useCallback and having useCustom pass the callback itself as its own dependency. -
I wish I could finish the game I have worked on (solo, on and off alongside regular job) for many years now. It's a callback to online gaming days of old (think BBS games) wrapped in a modern, nice looking package.2
-
I'm porting an OpenGL project to work with WebAssembly, I'm using emscripten to compile/generate the 'glue' to JS. Sofar I'm able to render my gl code properly through the glfw3 framework. I know you can use emscripten callbacks for input, however I was hoping to keep my existing glfw3 callback setup, that said the only callback that seems to be working properly is mouse position, window resize, keyboard, etc never get called. If anyone knows how to enable these I'd be super greatful!1
-
reading the project's code, following "save" callback in jvascript, i find this comment "IMPORTANT : this is a workaround to solve memory leak" and below it code that basically removes all elements from th DOM and adds them again.
so basically, someone could not find a cause to a memory leak and decided "solve it" in a specific place by reloading almost an entire page -
During my career I have found that if you *don't use lambdas it will be harder for you to create callback hell. You don't NEED to use something everywhere just because you CAN.
"But lambdas are cool, our clients dig it".
Go fuck yourself.
*minimize the usage of2 -
So our app uses some service to validate users & the validation response is received either by a callback url or by polling. Since their documentation states callbacks are rather unstable and "should not be completely relied upon", we only use polling. Client, however, wants to use the callback url and use polling only "after we are sure that callback has not been received". WTF. When we asked how will we know callback has not been received because it has not been received, we were told to start polling after like 1 hour.
?!?!?!?!?!?! -
So tokio-rs had me really confused on how to properly use split streams and sinks to read and write io, so I made a simplified interface to save others (and myself) some trouble.
Check it out, it's called tokio-simplified, and it's on https://crates.io/crates/...
I like it, you can place as many callbacks as you want to respond to each frame from the stream, and use as many mpsc::senders as you like to write to the sink.
And as a bonus, you can have a filter callback called before any other, to choose whether or not a frame should make it to the others, and bonus feature: that callback is 0 cost against just passing it as a for_each on your stream.
Hope it helps some of you on your journeys to Rust -
I don't think today is my day--i'm making alot of silly mistakes: forgot to call callback at end of function, forgot the () to complete the IIFE, copied a SQL querystring and forgot the change the fieldname from 'date' to 'created_at' and wondering why it's returning an empty array.
Self, please get your head in the game -
Some background:
About 2 months ago, my company wanted to build a micro service that will be used to integrate 3 of our products with external ticketing systems.
So, I was asked to take on this task. Design the service, ensure extendability and universality between our products (all have very different use cases, data models and their own sets of services).
Two weeks of meetings with multiple stakeholders and tech leads. Got the okay by 4-6 people. Built the thing with one other guy in a manner of a week. Stress tested it against one ticketing service that is used in a product my team is developing.
Everyone is happy.
Fast forward to last Thursday night.
“Email from human X”: hey, I extended the shared micro service for ticketing to add support for one of clients ghetto ticketing systems. Review my PR please. P.S. release date is Monday and I am on a personal day on Friday.
I’m thinking. Cool I know this guy. He helped me design this API. He must’ve done good. . . *looks at code* . . . work..... it’s due... Monday? Huh? Personal day? Huh?
So not to shit on the day. He did add much needed support for bear tokens and generalized some of the environment variables. Cleaned up some code. But.... big no no no...
The original code was written with a factory pattern in mind. The solution is supposed to handle communication to multiple 3rd parties, but using the same interfaces.
What did this guy do wrong? Well other than the fact that he basically put me in a spot where if I reject his code, it will look like I’m blocking progress on his code...
His “implementation” is literally copy-paste the entire class. Add 3 be urls to his specific implementation of the API.
Now we have
POST /ticket
PUT /ticket
POST /ticket-scripted
PUT /ticket-scripted
POST /callback
The latter 3 are his additions... only the last one should have been added in reality... why not just add a type to the payload of the post/put? Is he expecting us to write new endpoints for every damn integration? At this rate we might as well not have this component...
But seriously this cheeses me... especially since Monday is my day off! So not only do I have to reject this code. I also have to have a call now with him on my fucking day off!!!!
Arghhhhhh1 -
Rails after_create callback hooks... ofc callbacks with a name starting with `create_` get ignored1
-
Typescript is my new favorite and my grudge is the stupid scoping of type assertions. I have an async function that checks whether a variable is set and awaits a change event if it's undefined. This function is working javascript but invalid according to typescript, because it relies on the exact type changing while the function is running. I had to convert it to a mess of promises to bypass this because (and this is the best) the callback-based syntax of identical meaning will reset all type assertions, even locals that are never written after the callback's creation.8
-
Rant/question:
httpDoSmth1().subscribe(x =>
...then(y =>
httpDoSmth2(x).subscribe(z =>
//do smth with z
return z
)
)
)
Isn't this (not my code) callback hell all over again? The 2. http call expects results from the 1. http call. I feel like this could be solved cleaner using async await/switchMap/etc. ... but not like this.13 -
Architecture for Java REST API going to build/port from existing NodeJS one.
So Spring Boot + *
Lots of concurrent requests and large MongoDB calls. Current APIs use like 4GB memory for each instance because they don't use stream/pipe the response. Hold all data in memory and then return it all at once to user.
And well we expect more load in the future, so want to do this the right way.
So my understanding since this morning, is there's the blocking? MongoClient, (find* returns List) and now a Reactive MongoClient which is very async and like JS promises. Based on Pub, Sub model.
But the downside of JS promises was callback hell.
So actually 2 questions.
1. For each request, the db call done using the same MongoClient/db connection such that if there are 2 requests one would block the other?
2. Reactive Mongo would be non-blocking by design so would be better to support streamed responses?8 -
Multer is shit.
Do you know how to validate file size + mime type of the file before saving it to the disk?
Here is an instruction:
1. In one place you provide a it a fileFilter function that will validate the mime type, but this function can not validate file size or send user response.
2. In second place provide it a config limits file, that will validate file size, but can not validate mime type
3. In third place you provide middleware to capture any errors caused by previous 2 places and send response back to the user.
4. Go google for what is cb in multer because their shit documentation says nothing about it
Such simple thing as request->validation->response is split into 3 different parts, each of different type: callback, config file and middleware.
Why do so much people use this shit written by a braindead retarded morons?3 -
Assured the boss that the app will be ready in minutes and only a simple callback implementation is yet to be made. Immediately discovered that the library is inconsistent with the docs and only thing possible is to file an issue. Way to go Facebook Fresco!
-
Axios docs recommend me to use catch() callback for server error
- Not working
Then in git issue someone told to provide error callback as second parameter in then()
- Not working
And I just sit here wondering why it return undefined result when the server return 400 :s6 -
Hey my bros. I’m trying to create a simple messenger bot just for fun using this tutorial:
https://medium.com/crowdbotics/...
But it seems that I’m kinda stuck with setting up the webhook on the fb page, it displays an error
“the url couldn’t be validated, callback verification failed...”
I googled for answers but it seems that it doesn’t work for me. Can you please help me? Thank you so much.4 -
i always get sucked into this "cute code" hell whenever i am working with a b2c codebase, and especially with kotlin code.
here's a scenario:
task : build a debounce logic for an input view where each user input is currently triggerring an api call.
my steps
1. read what debouncing is.
2. see if any code is available on the internet
=> found a code piece on the internet with some level of abstraction ( basically a simple final class that implements the input event callback and encapsulates the debounce logic)
3) copy it, run it , it wokrs
------
for any sane coder, these steps are hardly 10-30 mins and they can move on with life. but its your truly that made this task into a 6hour research only to come up at similar solution. my curiosity led me to stupid places
1) why this class is final? what if someone else wanna use it but with a different behaviour? lets try open(non final class) .
2) why even use a class? it extends an interface, lets try to wrap the logic in interface itself (kotlin supports interfaces that don't require implementation)
3) umm , the interface works but it looks ugly, with all its global overridden variables. what about we make it extension?
4) yeah the extension approach is also not very good, lets go back to open class.
5) but extend is super nice to look! lets keep the extension and open class too
6) can we optimise the implementation? why it uses an additional handler? what if we provided everything in constructor? how about builder pattern?
FUCK MY BRAIN! there are so much fucking options that i forgot that i spent 4 hours on this small thing
the simplest approach would have been tk just shove all the listeners and everything in activity and forget about it :/
senior devs on this platform, how do you stop yourself from adding every concept that you know into the smallest possible task?6 -
Why is laravel so poorly documented? Take \Illuminate\Mail\Mailer::send() as example. The third parameter is a callback. Nothing more. No info in the docblock what that callback does, when it is called or what the signature looks like. You have to go into the code and hope to find it out without climbing through a dozen classes.
If they are so sparse with the information in the docblock, they can leave it away completely. -
```
Error: Resolution method is overspecified. Specify a callback *or* return a Promise; not both.
```
(ノ≧∇≦)ノ ミ ┸┸)`ν゚)・;’. -
[typescript] Should I use a promise to represent an event that can occur at most once, may never occur but can never fail? If not, what else should I use? Callbacks?5
-
I got to a point where I have a multi-level recursive promises within loops and my mental map is by far not enough to process this. I wish there were some visualisation tools for this - though I don't even know how it could look like. All I know is that at some point I'm returning a wrong promise and the recursion is not correctly handled.7
-
Ugh trying to refactor a Node.js MUD codebase to use mongodb. It currently accesses/stores it's data in json files via synchronous FS operations. Callback and/or .then hell, here I come!undefined callback hell async mongo javascript async hell node asynchronous promises muds mongodb nodejs
-
Being new to NodeJS, I wanted to use the framework for a small script that involved connecting to a MySQL database and updating 1500+ records.
With NodeJS's preference towards functional programming over sequential, I wanted to do things the NodeJS way with callback functions instead how I'm used to doing it, using loops (and all the MySQL functions were async).
I couldn't update all the rows at once, so I wrote a callback function that calls back itself after the SQL statement is executed. A recursive callback function... am I doing this right?7 -
I am setting 5 stores and need paypal to notify each store during a transaction and make an IPN callback. However paypal allows adding only one IPN URL. Can you advice some plugin/framework to handle this properly?