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 - "global functions"
-
There should be a communist programming language.
- There are no classes.
- There is no inheritance.
- All code is executed simultaneously, since it's equal.
- All variables are global, since everything belongs to everyone
- There are no private functions
- Every function must have side effects, for the 'greater good'
- As soon as it is written, you no longer own the code
- Instead the code owns you
- And your machine
I slowly get why this thing didn't work out on society either.9 -
Just got BUGS list from our Client and fuck- 95% of bugs are not even bugs :|
- No, changing the (not pre-decided) verbiage is not a bug
- Adding two more pages in the app is not a bug (what the fuck :|)
- No, APK file not running in iPhone is not a bug (goddamn :|)
- No, adding these "fuckin new" functionalities is not a bug (seriously ? :/)
AND
Mr "used to be a good coder" PM,
Getting "504 Timeout Gateway" error because Server is temporarily down is NOT a fuckin frontend bug
And No, writing Javascript with a proper design architecture is not a "complicated" way of coding
and fuckin No, Global variables and functions without any architecture don't make the programming "kind of better"
ps: And VB dot net is not a fuckin scripting language, VBScript is.
Thank you,
"buggy average coder"9 -
The nightmare continues.
Currently dealing with a code review from a “principal” dev (one step above senior), who is unironically called a “legendary dev” by some coworkers. It’s painfully obvious he didn’t read the code, and just started complaining and nitpicking.
It’s full of requests to do things that make absolutely no sense, and would make the code an unmaintainable mess.
• Ex: moving the logic and data collection from the module’s many callers into the module instead of just passing in the data.
• Ex: hiding api endpoint declarations by placing them in the module itself, and using magic instance variables to pass data to it. Basically: using global functions and variables instead of explicit declarations and calls.
• Ex: moving the logic to determine which api endpoint to use, for all callers, into the view.
More comments about methods being “too complex” (barely holds water) right next to comments saying “why are these separate? merge them together!”
Incredulously asking how many times I’m checking permissions and how ridiculous it all is. (The answer? Twice.)
Conflating my “permissions” param and method names with a supposedly forthcoming permissions system overhaul, and saying I shouldn’t use permissions because my code will all have to get rewritten. Even if that were true, and it’s likely not, the ticket still needs to use the current permissions. I can’t just ignore them because they might be rewritten someday.
Requests to revert some code cleanup because the reviewer thought the previous heavily-nested and uncommented versions (with code duplication) were easier to read. Unsurprisingly, he wrote them.
On the same ticket, my boss wants me to remove all styling and clientside validation, debouncing, and error messages from a form. Says “success” and “connection failed” messages are good enough. The form in question sends SMS and email using arbitrary user input for addresses. He also says it shouldn’t be denounced on the server, and doesn’t want me to bother checking permissions. Hello, spam!
Related: the legendary dev reviewer says he can’t think of a reason why we would want to disable the feature for consumers, so I should remove the consumer feature flag.
You can’t make this stuff up.7 -
Me: I can fix that workflow in about five minutes, In fact I can do it right now as we are speaking on the phone.
Customer: okay well... let me contact the director and make sure it’s okay that you fix it.
Me: I won’t make any changes to how it functions I’m only going to make it work again as it used to
Customer: we might need to schedule a meeting to talk about this because I’m not sure that we should be changing the site without permission
Me on the inside: I literally have global admin rights, unlimited power in Sharepoint, am responsible for making sure this stuff works, and BUILT this fucking thing, so now that I’ve been alerted of an issue I’m going to fix it. You are welcome to blame me if your boss is upset about it but I’m not going to wait for a fucking meeting to make sure it’s okay that I update a god damn email address in a workflow.
Me IRL: okay sounds great let me know when it is :)5 -
I met this girl and told her, she's the global variable to all my functions.. She gave me a dirty slap5
-
I told a guy to implement an algorithm in cpp. He wrote this weird 600+ lines of code which contains only global variables and void functions then I told him to make it object oriented and he just put all those garbage in the class and gave me back and on top of that class name is Template and file name is template.cpp. I don't have words to describe his code. May be this picture can help you understand my state. Oh, if you think this matchOn_r1, r2,r3 are different then you are mistaken they are just different with one argument (one global argument). This is just part of the code. He has this shit all over the place. Why the fuck this kind of people exists?13
-
I've been lurking on devrant a while now, I figure it's time to add my first rant.
Little background and setting a frame of reference for the rant: I'm currently a software engineer in the bioinformatics field. I have a computer science background whereas a vast majority of those around me, especially other devs, are people with little to no formal computer background - mostly biology in some form or another. Now, this said, a lot of the other devs are excellent developers, but some are as bad as you could imagine.
I started at a new company in April. About a month after joining a dev who worked there left, and I inherited the pipeline he maintained. Primarily 3 perl scripts (yes, perl, welcome to bioinformatics, especially when it comes to legacy code like is seen in this pipeline) that mostly copied and generated some files and reports in different places. No biggie, until I really dove in.
This dev, which I barely feel he deserves to be called, is a biology major turned computer developer. He was hired at this company and learned to program on the job. That being said, I give him a bit of a pass as I'm sure he did not have had an adequate support structure to teach him any better, but still, some of this is BS.
One final note: not all of the code, especially a lot of the stupid logic, in this pipeline was developed by this other dev. A lot of it he adopted himself. However, he did nothing about it either, so I put fault on him.
Now, let's start.
1. perl - yay bioinformatics
2. Redundant code. Like, you literally copied 200+ lines of code into a function to change 3 lines in that code for a different condition, and added if(condition) {function();} else {existing code;}?? Seriously??
3. Whitesmiths indentation style.. why? Just, why? Fuck off with that. Where did you learn that and why do you insist on using it??
4. Mixing of whitesmiths and more common K&R indentation.
5. Fucked indentation. Code either not indented and even some code indented THE WRONG WAY
6. 10+ indentation levels. This, not "terrible" normally, but imagine this with the last 3 points. Cannot follow the code at freaking all.
7. Stupid logic. Like, for example, check if a string has a comma in it. If it does, split the string on the comma and push everything to an array. If not, just push the string to the array.... You, you know you can just split the string on the comma and push it, right?? If there is no comma it will be an array containing the original string.. Why the fuck did you think you needed to add a condition for that??
8. Functions that are called to set values in global variables, arrays, and hashes.. function has like 5 lines in it and is called in 2 locations. Just keep that code in place!
9. 50+ global variables/hashes/arrays in one of the scripts with no clear way to tell how/when values are set nor what they are used for.
10. Non-descriptive names for everything
11. Next to no comments in the code. What comments there are are barely useful.
12. No documentation
There's more, but this is all I can think to identify right now. All together these issues have made this pipeline the pinnacle of all the garbage that I've had to work on.
Attaching some screenshots of just a tiny fraction of the code to show some of the crap I'm talking about.6 -
Everyone talks about their hate of js but like python is honestly just as bad.
- shitty package manager,
* need to recreate python environments to keep workflows seperate as oppose to just mapping dependencies like in maven, npm, cargo, go-get
* Can't fix python version number to project I.e specify it in requirements
- dynamic typing that gets fixed with shitty duck typing too many times
- no first class functions
- limited lambda expressions
- def def def
- overly archaic error messages, rarely have I gotten a good error message and didn't have to dive into package code to figure it out
- people still use 2.7 ... Honestly I blame the difficulty of changing versions for this. It's just not trivial to even specify another python version
- inconsistent import system. When in module use . When outside don't.
- SLOW so SLOW
- BLOCKING making things concurrent has only recently got easier, but it still needs lots of work. Like it would be nice to do
runasync some_async_fcn()
Or just running asynchronous functions on the global scope will make it know to go to some default runtime. Or heck. Just let me run it like that...
- private methods aren't really private. They just hide them in intelisense but you can still override them....
I know my username is ironic :P11 -
Lets create a library.
Lets use that library in a project.
Lets wrap the library call in a wrapper functione to remove duplicate code.
Lets add an overloaded wrapper call that wraps the wrapper call that calls the library to partially undo the duplicate code removal.
Lets add another overloaded wrapper call that wraps the wrapper call that wraps the wrapper call that calls the library to partially undo the duplicate code removal.
How I love it. Not.
Sometimes redundancy makes sense, especially when it are two lines which make it obvious whats going on vs a single line that leads to a fuckton of overloaded wrapper functions.
Sheeesh.
Today in "code monkeys deserve divine punishment".
Another funny thing is creating a Helper class for Junit 5 tests, making it instantiable and adding to it all kinds of shit like testcontainer creation, applications instantiation, mocks, ....
... Then " crying " why the tests are so slow.
Yeah. Logic. Isolation of concerns, each test should be a stand alone complex.
But that would lead to redundancy... Oh no.
Better to create a global state god object.
Some devs... Really amaze me, especially when they argument in ways that makes one really wonder whether they are serious or just brain dead.14 -
Good guy teacher doesn't care if you write Javascript global functions wrong on a test because "your editor will fix that for you"
-
I don't know if I'm being pranked or not, but I work with my boss and he has the strangest way of doing things.
- Only use PHP
- Keep error_reporting off (for development), Site cannot function if they are on.
- 20,000 lines of functions in a single file, 50% of which was unused, mostly repeated code that could have been reduced massively.
- Zero Code Comments
- Inconsistent variable names, function names, file names -- I was literally project searching for months to find things.
- There is nothing close to a normalized SQL Database, column ID names can't even stay consistent.
- Every query is done with a mysqli wrapper to use legacy mysql functions.
- Most used function is to escape stirngs
- Type-hinting is too strict for the code.
- Most files packed with Inline CSS, JavaScript and PHP - we don't want to use an external file otherwise we'd have to open two of them.
- Do not use a package manger composer because he doesn't have it installed.. Though I told him it's easy on any platform and I'll explain it.
- He downloads a few composer packages he likes and drag/drop them into random folder.
- Uses $_GET to set values and pass them around like a message contianer.
- One file is 6000 lines which is a giant if statement with somewhere close to 7 levels deep of recursion.
- Never removes his old code that bloats things.
- Has functions from a decade ago he would like to save to use some day. Just regular, plain old, PHP functions.
- Always wants to build things from scratch, and re-using a lot of his code that is honestly a weird way of doing almost everything.
- Using CodeIntel, Mess Detectors, Error Detectors is not good or useful.
- Would not deploy to production through any tool I setup, though I was told to. Instead he wrote bash scripts that still make me nervous.
- Often tells me to make something modern/great (reinventing a wheel) and then ends up saying, "I think I'd do it this way... Referes to his code 5 years ago".
- Using isset() breaks things.
- Tens of thousands of undefined variables exist because arrays are creates like $this[][][] = 5;
- Understanding the naming of functions required me to write several documents.
- I had to use #region tags to find places in the code quicker since a router was about 2000 lines of if else statements.
- I used Todo Bookmark extensions in VSCode to mark and flag everything that's a bug.
- Gets upset if I add anything to .gitignore; I tried to tell him it ignores files we don't want, he is though it deleted them for a while.
- He would rather explain every line of code in a mammoth project that follows no human known patterns, includes files that overwrite global scope variables and wants has me do the documentation.
- Open to ideas but when I bring them up such as - This is what most standards suggest, here's a literal example of exactly what you want but easier - He will passively decide against it and end up working on tedious things not very necessary for project release dates.
- On another project I try to write code but he wants to go over every single nook and cranny and stay on the phone the entire day as I watch his screen and Im trying to code.
I would like us all to do well but I do not consider him a programmer but a script-whippersnapper. I find myself trying to to debate the most basic of things (you shouldnt 777 every file), and I need all kinds of evidence before he will do something about it. We need "security" and all kinds of buzz words but I'm scared to death of this code. After several months its a nice place to work but I am convinced I'm being pranked or my boss has very little idea what he's doing. I've worked in a lot of disasters but nothing like this.
We are building an API, I could use something open source to help with anything from validations, routing, ACL but he ends up reinventing the wheel. I have never worked so slow, hindered and baffled at how I am supposed to build anything - nothing is stable, tested, and rarely logical. I suggested many things but he would rather have small talk and reason his way into using things he made.
I could fhave this project 50% done i a Node API i two weeks, pretty fast in a PHP or Python one, but we for reasons I have no idea would rather go slow and literally "build a framework". Two knuckleheads are going to build a PHP REST framework and compete with tested, tried and true open source tools by tens of millions?
I just wanted to rant because this drives me crazy. I have so much stress my neck and shoulder seems like a nerve is pinched. I don't understand what any of this means. I've never met someone who was wrong about so many things but believed they were right. I just don't know what to say so often on call I just say, 'uhh..'. It's like nothing anyone or any authority says matters, I don't know why he asks anything he's going to do things one way, a hard way, only that he can decipher. He's an owner, he's not worried about job security.13 -
Don't hire monkeys that write shitty code that cause production issues.
Just spent the entire morning with our global team (10+ ppl) looking into the cause of a production issue.
Root cause: shitty code that anyone that has read an algorithm book (array resizing costs) and understanding how DB functions should be used and why (bulk inserts vs one at a time) would never write.
Even the code itself is a mess...8 -
So for almost all of my c++ assignments I've recieved various emails from the instructor about things like "incorrect header guard" and "library inclusions out of order".
The first being that I didn't include the namespace inside of the guard (I did "FILENAME_H" instead of "NAMESPACE_FILENAME_H")
The second is that I accidentally included header files from my project before any of the standard libraries. This one wasn't even intentional, it was caused by vscode when it formatted/prettified the file.
EX:
#include "test.h"
#include <iostream>
In my opinion these seem pretty nitpicky and, especially that first one, appear to be more like naming conventions or best practices than something to deduct marks for.
On the flip side though I did accidentally store a couple functions in the global namespace which I understand isn't particularly safe. I also made a couple one line conditional statements that simply never evaluate to true, but I didn't think this was a huge deal.
I don't normally code in any of the c languages outside of college so I'm not sure how important these are to actually follow. I've apparently been deducted an entire 10 percent off the assignment because of the head guard. I know that every professor has different criteria for deducting marks, but even this seemed rather unnecessary.
What does everyone think?11 -
Just spent an entire night eaning up my codebase...
I optimized some of the functions got rid of unnecessary global variables and changed up the whole file hirearchy so it would be easier to read. After spending all night doing this I went to run the program and for once it seemed everything worked right the first time! However a portion of my application that is supposed to happen at a certain date and time never would run. After spending all night comparing each and every line for what I changed versus my last commit I couldn't find the fallacy in my logic. Everything should still work like it did before. After spending more time looking for bugs I finally realized I didn't break anything when I switched over to this new structure it was the old code that was broken. I went through the old code and after some debugging eventually found the culprit an extra continue statement that prevented my loop from fully executing. Lesson learned sometimes the biggest bugs can spawn from one line of code.4 -
My coworker claimed to have experience with R programming on their resume.
Now I don't know R myself but I'm pretty sure what actually happened was they were handed an R program and told how to run it...
Cause they doesn't use functions without being told to, I've had to explain global vs local variables multiple fucking time, and the worst fucking offense in my opinion
THEY DOESN"T READ FUCKING ERROR MESSAGES, so many times there's been an issue in the scripts and when I go to look at what's wrong it's 3 fucking lines down from what they fucking screenshot and spam me on teams with5 -
300 global variables.. THREE HUNDRED FUCKING GLOBAL VARIABLES?
Are you for real?
Now let me check the line numbers again..
hmm.. line 97 to .. yep line 410, just a few new lines to seperate some of them or.. group? Idk, I've given up on trying to understand those.
Now you may ask "But ThatPerlDeb, where did you see this and what was the intention?"
Low and behold, take a chair and I may explain this to you.
First of all: Fuck the dev that wrote this!
Second: Fuck all the devs that kept up with this practice or whatever you want to fucking call this!
Now, the application is our POS system that our customers can use for a monthly fee (That this piece of garbage even requires payment is disgusting) but anyway..
The global variables sometimes are declared for labels, sometimes for some frames, sometimes just for random values to be there.
We're using Perl for the POS system and Perl ain't the best at OOP, so in the dev's defense I can understand why you'd use a few global variables, but not fucking 300!! FUCK OFF WITH THIS BULLSHIT!!
So now I'm going through this torture slowly but surely deleting globals and putting them into some sort of scope and always MANUALLY test if something broke. Again, this company sucks ass and there's nothing that could even be considered a "unit test" or something like that, so fuck that, too.
After two hours I've brought down the count of global variables to about 260, so there's progress being made..
But then, there comes more!
"But how???" you may ask, and you're right, I've asked that myself.
Now to resolve the global stuff in each file some of the initial globals are used, we got about 20-30 files which do different stuff, all fair and square, at least there was an attempt at seperating functions but god this mess is so fucking fucked up. So in order to "safely" delete a global variable I have to check if any of the variables are used in another file, and if so, in which scope and how they are used.
Spaghetti would be a compliment for this fucking disgusting piece of utter bullshit.
Let alone the code quality of this "code"
Indendation? Dafuq is dat?
Scope? Nah, we got everything global anyway
Function size? Well, some are 5 lines, some are 900 lines, who cares anyways, right?
I'm so fucking glad once I leave this shithole, for real.6 -
In PHP, constants can only be of simple data types like strings or floats.
You can't make a database connection a constant because it's not a simple data type.
That makes the only way of accessing complex "constants" within functions using the keyword global... which is not encouraged and forces you to make the database connection global (that may not be convenient in some software patterns).
The last option is passing the database connection as a parameter (either to the function or to the constructor of the instance whose methods will use the connection)... which would be good if I didn't want to go full OO. Because it's a pain to do so.
So all in all, constants are not well supported by PHP.
Come on, constants...12 -
What do you think about class-based OOP vs. Prototype-based OOP?
I think that class-based OOP is an unnecessary abstraction of structs, functions and global variables most of the time.16 -
You can say you know a computer language to a decent level when you can in fact make useful programs with it.
For example, I can say I know JavaScript to a basic level. I know its basic core functionality by heart (which can't be said for some people I know), such as:
- it manipulates the DOM, the DOM has Element, Nodes, TextNodes (all to be found on W3C documents with its own specs)
- useful functions are:
getElementById()
getElementsByClassName()
Also knowing that these return either HTMLElementCollection or NodeCollection because you have to iterate over it differently then
- element.textContent
- == and ===
- dynamic typing
- closures
- avoid global variables
- nodes have parentNodes
- isNaN, undefined
- arr.push()
- arguments don't have explicit types defined
- etc.
Using this knowledge I built an antispam script for a particular server. It's good to know the model of a language, that it sits in your head and that you can use and understand the constructs when you want and how you want.1 -
I have a JS module in the main thread, which can only import regular JS files using dynamic import(). This means that imported functions can never be global.
I also have a web worker (which isn't a module because Mozilla) which can only import other JS files using importScripts(). This means that imported functions can only ever be global.
Effectively I can't use the same code on the main thread and in a worker if it relies on objects defined in other files, because references to these will never be the same. -
(I'm not completely sure of what I'm saying here, so don't take this too seriously)
Settling on a language to write the api for ranterix is hard.
I'm finding a lot of things about elixir to be insanely good for a stable api.
But I'm having a lot of gripes with the most important elixir web framework, phoenix.
Take a look at this piece of code from the phoenix docs:
defmodule Hello.Repo.Migrations.CreateUsers do
use Ecto.Migration
def change do
create table(:users) do
add :name, :string
add :email, :string add :bio, :string
add :number_of_pets, :integer
timestamps()
end
end
end
Jesus christ, I hate this shit.
Wtf are create, add and timestamps. Add is somehow valid inside the create, how the fuck is that considered good code? What happens if you call timestamps twice? It's all obscure "trust me, it works" code.
It appears to be written by a child.
js may have a million problems. But one thing I like about CJS (require) or ESM (import) is that there's nothing unexplained. You know where the fuck most things come from.
You default export an eatShit() function on one file and import it from another, and what do you get?
The goddamn actual eatShit function.
require is a function the same way toString is a function and it returns whatever the fuck you had exported in the target file.
Meanwhile some dynamic langs are like "oh, I'll just export only some lang construct that i expect you to specify and put that shit in fucking global of the importing file".
Js is about the fucking freedom. It won't decide for you what things will files export, you can export whatever the fuck you want, strings, functions, classes, objects or even nothing at all, thanks to module.exports object or export statement.
And in js, you can spy on anything external, for example with (...args) => debugger; fnToSpyOn(...args)
You can spoof console.log this way to see what the fuck is calling it (note: monkey patching for debugging = GOOD, for actual programming = DOGSHIT)
To be fair though, that is possible because of being a dynamic lang and elixir is kind of a hybrid typed lang, fair enough.
But here's where i drop the shit.
Phoenix takes it one step further by following the braindead ruby style of code and pretty DSLs.
I fucking hate DSLs, I fucking hate abstraction addiction.
Get this, we're not writing fucking poetry here. We're writing programs for machines for them to execute.
Machines are not humans with emotions or creativity, nor feel.
We need some level of abstraction to save time understanding source code, sure.
But there has to be a balance. Languages can be ergonomic for humans, but they also need to be ergonomic for algorithms and machines.
Some of the people that write "beautiful" "zen" code are the folks that think that everyone who doesn't push the pretty code agenda is a code elitist that doesn't want "normal" people to get into programming.
Programming is hard, man, there's no fucking way around it.
Sometimes operating system or even hardware details bleed into code.
DSLs are one easy way to make code really really easy to understand, but also make it really fucking hard to debug or to lose "programming meaning".7 -
Is there anything like React Context or Unix envvars in any functional language?
Not global mutable state, but variables with a global identity that I can set to a value for the duration of a function call to influence the behavior of all deeply nested functions that reference the same variable without having to acknowledge them.13 -
nothing new, just another rant about php...
php, PHP, Php, whatever is written, wherever is piled, I hate this thing, in every stack.
stuff that works only according how php itself is compiled, globals superglobals and turbo-globals everywhere, == is not transitive, comparisons are non-deterministic, ?: is freaking left associative, utility functions that returns sometimes -1, sometimes null, sometimes are void, each with different style of usage and naming, lowercase/under_score/camelCase/PascalCase, numbers are 32bit on 32bit cpus and 64bit on 64bit cpus, a ton of silent failing stuff that doesn't warn you, references are actually aliases, nothing has a determined type except references, abuse of mega-global static vars and funcs, you can cast to int in a language where int doesn't even exists, 25236 ways to import/require/include for every different subcase, @ operator, :: parsed to T_PAAMAYIM_NEKUDOTAYIM for no reason in stack traces, you don't know who can throw stuff, fatal errors are sometimes catchable according to nobody knows, closed-over vars are passed as functions unless you use &, functions calls that don't match args signature don't fail, classes are not object and you can refer them only by string name, builtin underlying types cannot be wrapped, subclasses can't override parents' private methods, no overload for equality or ordering, -1 is a valid index for array and doesn't fail, funcs are not data nor objects when clojures instead are objects, there's no way to distinguish between a random string and a function 'reference', php.ini, documentation with comments and flame wars on the side, becomes case sensitive/insensitive according to the filesystem when line break instead is determined according to php.ini, it's freaking sloooooow...
enough. i'm tired of this crap.
it's almost weekend! 🍻1 -
[Rust] What are alternatives to argument drilling for something like a string interner which is technically a memory leak so it really shouldn't be global but at the same time all but a couple top level functions depend on its existence? I'm aware of context objects and that's all ChatGPT could give me as well, but I'm wondering if there's more to this problem than that.1
-
I'm just beginning to learn about Javascript, and I'm not sure if I like the fact that variables, declared outside of functions, become global. How do other people feel about it?6
-
Why did I go broke?
Because every time I tried to cash in my promises, I’d end up nullifying my income with undefined deductions! I thought I could get by on short functions and quick closures, but in the end, I found myself callbacked into a corner with no scope for improvement.
I tried to debug my financial situation, but my stack overflowed with deferred payments, and I couldn’t even parse where all my money was going. The compiler of my life just kept throwing unexpected "expenses" errors.
In a final attempt, I refactored my entire approach, renaming myself Async to buy some time, but it was too late. My funds were hoisted to the global scope, and before I knew it, I was reduced to Boolean poverty.
Now, I live my life in strict mode, always awaiting the day I’ll finally get a return on my investment... but deep down, I know I’m just an object in a mutable state.
P.S : I'm a JS DEV1 -
It's so frustrating to explain rxjs pitfalls to the manager.
To avoid the diamond problems and glitches caused by combineLatest and debounceTime(0), I decided to use single stream with nested reactivity.
Then the manager asked me to use withLatestFrom instead of combineLatest.
Sure withLatestFrom makes sense to the original author, when the original author is able to remember the reactive graph and put proper dependencies to combineLasted/withLatestFrom accordingly, but anyone else who touches the component later needs to retrace the reactive graph to avoid the glitch. Sometimes it's just impossible when many dependencies are derived from combineLatest+debounceTime(0). When no one is trained to code reactively, I don't expect people to know where to put a dependency. After many trials and errors, the only way to avoid the diamond problem is to use nested reactivity where child streams are created within root stream each time root stream emits.
The mentioned manager put all sorts of side effects in observable chains. The manager keeps saying the stream is too large when their subscription functions (sometimes nested) are way worse with litered mutations everywhere. Anything in observable can be traced by go to definition but tracing side effects usually requires global searches.
Recently, he put startWith to the end of a synced stream to fix a bug where button would collapse when there is no content (initial null emission). Rather than fixing the default height, he thinks using startWith(defaultLabel) is a good idea. Of course, he doesn't know that a synced stream should only emit 1 value on new subscription and that extra emitted value will cause rxjs glich down the pipe.
I hate corporate jobs -
#Suphle Rant 9: verbatim exception scare
In multiple rants, I've bitched about laravel stealing suphle features. By some very weird coincidence, it appears I've been given a taste of my own medicine. Let me explain:
We're having a chat this morning on a laravel group chat when someone says he uses their notification component a great deal. Curious, I ask him what he uses it for since I only used it sparingly during my laravel days. To pry an answer out of him, I ask whether he uses them for sending app error alerts to a slack channel, and he responds with an eerily familiar term. I quickly look it up and the results on the docs are chilling: errors can be sent to bugsnag (which suphle has an integration for), sentry and Co. Errors can either be broadcast or disabled. Specific kinds of errors can be caught. My heart sunk. My brother called for something while I was going through it and I was struggling to pull myself together
Their exception component is almost identical to mine and I'm only just realising. It's shameful that I'm just learning about functionality present since 5.8. I thought my creation was novel. BUT! The good news is, the implementation differs
Too many errors went unnoticed during my time there because error broadcasting is optional. Since none of my colleagues read that part of the documentation, we were firefighting by pulling and wrangling production error logs. This informed their abolishment in suphle altogether
A relatively minor difference is in the APIs –their philosophy makes significant use of global functions, violating SRP, etc.
But the most important difference, that still cheers me up, is that they only catch known errors. Suphle has a construct for isolating calls to a decorated service. Any unforeseen error to occur during its execution will do a series of things before control is returned to the caller