DEV Community

Cover image for Are we "developers" gatekeeping "knowledge" from our juniors and peers? 🤦
Eugene Cheah for Uilicious

Posted on • Updated on • Originally published at uilicious.com

Are we "developers" gatekeeping "knowledge" from our juniors and peers? 🤦

Background Context

My startup co-founder recently wrote an article on what I previously considered "common knowledge", an article which went "viral".

Unfortunately, as per the rules of the internet. Anything "viral" will draw a fair bit of criticism and even personal attacks, especially outside dev.to; Some which I saw hurt my co-founder personally, as we look through them.

However, this is not about sexism, javascript, nor the internet rule (all which has valid problems worth highlighting separately).

This is about "developers", and our role in gatekeeping "knowledge" like the following from others

Personal attacks aside, what caught my attention, that drove me to write this article - was the following comment:

Isn't it obvious that ________________ are you a _____,
Never ever write such [ ] articles again.

Side note: As its not my intention to shame/attribute the original author. The quote is paraphrased to make it un-googleable and to remove expletives. To be clear, the exact wording is different

It struck me not only because of how cruel it was at the end - but how the statement, was something I was guilty of saying as well.

  • SL: Really?! push made such a big difference
  • EU: Well concat needs to create a new array, and copy everything
  • SL: Doesn't the javascript jvm, automatically optimize such execution? Seeing that I do not use the old array
  • EU: Well it doesn't, and unfortunately due to the spec ...
  • SL: I should write an article on this
  • EU: Isn't it very obvious, I doubt it's worth writing
  • SL: It wasn't obvious to me
  • EU: (in my head - I am surprised you didn't know)
  • EU: Ok, it's worth a try then
    SL stands for Shi Ling, my co-founder. While EU represents me, Eugene

While it's much lighter in tone, the line of reasoning to not write the article is the same.

In the position of seniority, even lightly brushing off of such content being written can have chilling effects on other junior developers and peers. Especially in a much larger organization. So while such statements may not have deterred Shi Ling (she wrote it in the end), it could however for the rest of my peers around me silence them.

And was I wrong in my criticism!

Looking at the number of positive retweets and comments on how "I need to rewrite my code", or "I never knew", occurred. It wasn't obvious, and it is an article worth writing.

However, what hit me really hard - was when out of "frustration" or immaturity. I regrettably looked into the commenter's profile.

I realized it wasn't just a simple careless statement by a young teenager.

It was from a well respectable senior engineer, in charge of a large team of developers, with a similar background to me. To me, it was terrifying.

I was looking into the mirror, of what could be me in the future

The evil in the mirror

And on further digging around the various comments, he was not the only one...

Which brings me to my next point...


PSA: What is common to you, may not be to another developer. So think twice before suppressing such content.

As an industry, programming is relatively immature, of being less then 200 years old (starting from Ada Lovelace). The web industry is even younger at being under 30 years old.

This pales drastically to

  • scientific medicine: ~2500 years old
  • architecture and construction: >5000 years old

As a result, the technology we learn seems to be constantly changing, with little in the way of a stable (think 12+ years) long term standard for anything.

By this definition: any assumptions you made on what is learned for your generation as "common knowledge" that isn't worth spreading, is a false assumption made to your junior and peers.

We should also kick out the notation that, if one does not "understand this", that individual is not deserving to be called a developer.

To clarify, my co-founder is by no means a "junior" developer. We both have very very different specializations.

While I may have really deep dive knowledge on the ES5 spec, and how V8 works internally, which distorted my view on what's considered "common knowledge" for javascript.

Inversely, she has really deep encyclopedia-like knowledge on the various quirks of CSS, and how modern front end frameworks like vue.js works. Something which I admittedly still make very fundamental novice mistakes till today.

So if my assumptions are wrong to a fellow "senior" developer with different specialization, wouldn't it be worse for a new "junior" developer. Especially with the rise of coding boot camps.

So until we can figure out a common stable universal engineering standard for programming, which we can assume as "common knowledge", like how architects or doctors do (which we probably will not for another 50 years). I am heavily ringing this bell now, as we are like no other industry out there.

Never make that assumption.

Heraclitus quote: There is nothing permanent except change

Heck, to the unconvinced old seniors. Many of us (including me) used to consider C style memory pointer manipulation as essential common knowledge, which in absence, we used as grounds for a "no hire" for juniors.

How wrong are we now in modern web development and the programming language they use?


Bro-grammer? Couldn't we be kinder?

Even with valid criticism...

  1. Ask yourself, would you have possibly made the same mistake?
  2. Would you like to have such things said to you, or your loved ones?
  3. Is it constructive criticism?

Instead of gatekeeping what should be written or not written on "superior grounds". We could instead encourage improvement with our criticism.

For example, one repeated criticism. Is regarding benchmarking methodology. However instead of statements like.

Worst benchmarking ever

A kinder, more constructive comment would be

We could improve the benchmark by doing ____ instead of ____

And to say it upfront, for most of the constructive criticism on benchmarking, you were right. While it probably will not change the end result, due to the large difference in between. It is a valid area of improvement, and both my co-founder and I do thank you for that.

Or as XKCD lovingly put it

XKCD #1053

Saying 'what kind of an idiot doesn't know about the Yellowstone supervolcano' is so much more boring than telling someone about the Yellowstone supervolcano for the first time.

So which would you rather be?


Bro-grammer?

When I said this is not about sexism, I mean it.

The suppression of knowledge probably happens regardless of gender. It definitely happens from senior to junior as well.

However, the phrase "Bro-grammer" is used intentionally.

I am sure there are exceptions (there always is), but this is more on us the majority, the male gender of the development community, then the other way.

And while I will not have any statistical numbers to back it up.

The minority groups within our community know very well how it feels like to have their voice heavily suppressed.

The minority groups are the ones most mindful on not gatekeeping "knowledge" from others.

For almost all the personal attacks / mean criticism I seen to my co-founder was from our side of the male development community.

And it's on us to improve ourselves on this, to improve our community. Consciously, in speaking out against it. Or sub-consciously in our words and actions.

I am not asking each one of us to achieve an unreasonable perfectionist standard (as there will be slips of tounges), nor am I criticizing of who you are now.

I am saying this, as someone who has made mistakes as well. To make small incremental personal, mindful changes in us individuals that will allow us to push the community forward.


So ask yourself the man in the mirror? Will you make that change?

To improve the community around you. In encouraging the sharing of knowledge (as trivial as it may seem to you, or even me). Or to share such knowledge yourself.


I have seen similar things happen to other articles/tweets, anything I can do to help?

Instead of fighting head on, and "feeding the trolls".

In cases of unconstructive criticism (eg. worse benchmark), in place of the author, asked politely

What do you mean by _____, how could the content be improved on?

This gives the individual, a chance to clarify as they may not always mean harm intentionally, sometimes it could simply be words being lost in translation.

Just keep in mind to remain respectful, constructive and clear to defuse any tension

For really harsh comments or personal attacks, it might be better to reply to the comment, or author, while ignoring the bully. To let them know that there are others who appreciated their work. While lightly pointing at the criticism.

Personally I found the content useful, regardless of what anyone else says. Thank you

The above is universal regardless of content type (it can be applied outside of the development community).

And finally, for the developer who engages in such criticism, and partly the reason I wrote this article - is so I can point to it in the future for others. As it happens to them.

Personally I think what you are doing is great, regardless of what anyone else says. Thank you. And for the developers who say otherwise, we should be encouraging instead of suppressing our peers.

Keep in mind while doing any of the above, as you run the risk of diverting the critical comment from the author and onto yourself. If it gets personal on you, do not feed into it. Be strong and ignore it.

Know you have done a part in letting the content creator, know that the criticism is not the only voice there. And as an observer to the receiving end, even if they end up in silence, I will say it helps go a long way in knowing there was someone there.

For all the unsung heroes, who did so. Thank you.


Keep doing your best!

To my co-founder, even if you face a double standard in your work previously, or the triple standards in investors as you fundraise presently, or the cruelty of the internet as you write content.

To all the other working moms, single moms, LGBTQ, and other minority groups.

  • keep on coding
  • keep on improving
  • keep on writing
  • keep on doing, the various great things you are working on
  • do not let the criticism suppress you
  • push that glass ceiling
  • and be great at what you do

Peace 🖖


Additional advice from comments

Also, consider reading up on recurse.com/social-rules.

Thanks for writing up this post @picocreator !

Along these lines, I am a big fan of the Recurse Center's social rules -- particularly in this case the one about "no feigning surprise." Their explanation of this:

Feigned surprise is when you act surprised when someone doesn’t know something. Responding with surprise in this situation makes people feel bad for not knowing things and less likely to ask questions in the future, which makes it harder for them to learn.

No feigning surprise isn’t a great name. When someone acts surprised when you don’t know something, it doesn’t matter whether they’re pretending to be surprised or actually surprised. The effect is the same: the next time you have a question, you’re more likely to keep your mouth shut. An accurate name for this rule would be no acting surprised when someone doesn’t know something, but it’s a mouthful, and at this point, the current name has stuck.

Feigning (or actually being) surprised is definitely not as mean spirited as some of the examples you referenced, but it can still discourage folks that are new to an area from speaking up or reaching out for help. Just wanted to note this as well since I think it's pretty easy for (otherwise well-intentioned) people to do this without meaning to.

And understand the difference between passive/active gate-keeping

I think the problem is two-fold.

One part is the active gate-keeping. People running around telling everyone they or the tools they use aren't good enough.

How can you use PHP when there is Java? How Java when there is C#? Why switch to JavaScript when PHP finally became a real programming language?

Even my programming techniques professor said JavaScript was a toy and nothing compared to Java.

People shitting on each others' work for all kind of senseless reasons instead of helping each other out. That needs to stop and I have the feeling that more women and minorities in the industry will just lead to that. CoCs are spreading like a wildfire and people become generally kinder. The few old-school uber-nerds I saw here on dev.to didn't stay for long.

On the other hand, we have passive gate-keeping or simply ignorance. I guess that is what you're talking about. This can have many reasons and I can only talk about the ones I encountered.

I often had the impression I'm a bad-to-mediocre developer, so I didn't value most of the stuff I knew and this lead me to think I was one of the last in the industry to learn stuff. Took me a year to understand functions, took me a few months to understand closures, took me another year to understand monads, etc. I was always a slow learner, swimming with 9, biking with 14, so I guess that's where the impression came from that everyone else already knew the stuff I just learned.

I also had to work with many of such old-school uber-nerds who choose tech for projects and generally acted like they had it all figured out. Took me a few years of freelancing and blogging to find out most of them are just talking big and there are a whole bunch of people out there who don't know half as much as I do and would love to work with or learn from me.


History sidetrack

For those interested in the accuracy of the yearly figures used above.


I have been sitting on this piece for some time, it is intentionally written in a way to not blame individuals for their past action, but to encourage them to reflect back on how to do better.

As writing is hardly my biggest strength, and I am sure my approach to this topic may be flawed as well. Any discussion, for similar experiences on this issue, either to encourage others, or to suggest other possible ideas, or even amendments that should be made to this article. Will be gladly appreciated.

Oldest comments (38)

Collapse
 
cdaracena profile image
Christian Aracena

Thanks for posting this, I completely agree with your sentiment throughout this piece. The tech industry is demographically changing but it still lags behind in terms of emotional and social intelligence. Not everyone can be socially aware but everyone is capable of improving the way they provide feedback to others (and especially those of us who are newer). Always keep in mind that everyone starts somewhere and no one, not a single person on this planet knows everything about the particular field or hobby that they partake in.

A lot of juniors already suffer from debilitating imposter syndrome (especially those of us that don't come from traditional computer science backgrounds or from communities of color) as it is, and I would expect most seniors to be aware and understanding of that.

Collapse
 
david_j_eddy profile image
David J Eddy

"...programming is relatively immature, of about 3 decades old." A grammical correction here if you would. 'Programming' as the act of instructing a machine to execute a series of steps dates back to the 1940's (en.wikipedia.org/wiki/History_of_p...). where as 'Web programming/development (JS/PHP/Ruby/C#/et al.' is indeed about 3 decades old. As Tim BL released the HTTP 1.x in 1991 (en.wikipedia.org/wiki/Hypertext_Tr...).

Enlightening bit of information: The first 'computers' where female, the first 'programmers' where female, the first 'bug' was logged by a female, and the 'calculators' that landed man on the moon and back...female.

Collapse
 
picocreator profile image
Eugene Cheah • Edited

Ooo, didn't realize the web development one. And that HTTP was in 1991 (I can now claim to be as old as the internet, haha).

Was not sure what to use as the benchmark, and was originally using the SCAMP / IBM 5100 as the baseline of 1975. (how that became 3 decades is my dumb math error)

But I like your Ada Lovelace reference better. Amended it, and thrown in additional references for contrast

Collapse
 
david_j_eddy profile image
David J Eddy

"...e as old as the internet, haha)." As old as the "world wide web". The 'internet', in terms of computers connected via wires, is from the mid 60's with the build out of the ARPA network.

The "web" is that you see in a browser. It is a very very very small sub-section of the "internet".

Glad I could assist in enriching your article. Keep up the effort!

Collapse
 
peterwitham profile image
Peter Witham

I think your arguments are well thought out and presented, it's sad that this situation still exists after all this time.

Given the nature of our industry, so many comments are 'hit and run' these days, even if they have good intention. I feel that if someone is going to comment on other persons work they should give it some thought and time, and if that time is not available right then either come back and comment or just leave it alone.

I have come across so many great articles on sites that I'd like to comment on, only to find that the comment system is turned off completely, perhaps to prevent this kind of issue from occurring, and I confess I have started to think the same way about my blog. I love and welcome interaction, but not at the cost of moderating less desirable comments, and by that, I don't mean negative, I just mean unhelpful.

It would be great if everyone would stop and think 'am I contributing to the conversation with my feedback' before they do it.

As an aside, I write and share as much as time permits to prevent the lockin and gatekeeper problem. To do that it means I have to write content that is understandable by all levels of experience. In the past, I have had comments questioning why I share so many very basic things.

The answer, in my opinion, is simple, we all have different levels of understanding and that's the beauty of what we do, to share and learn together whilst helping those that need it without judging.them.

The last paragraph is the very reason I have become so fond of dev.to compared to other virtual hangouts.

Collapse
 
adamiito profile image
Adam Horváth • Edited

I have created an account just to thank you for the article. (About time, I know)

I don't know if I have been so naive or StackOverflow coddled me, but I have always viewed IT as relatively open and welcoming field. When I look for something no matter how obscure it is, there is always some good and patientSamaritan to help, answer questions no matter how stupid or basic or at least show the way to the solution.

Lately I have noticed the ugly spectrum of IT as you describe. Sexism, arrogance or just unpleasantness and it still baffles me. Thanks for speaking out.

I just wanted to say thanks to all the helpful and amazing people who still make me proud of being in the same field. I hope to repay one day once I stop being an imposter.

Collapse
 
picocreator profile image
Eugene Cheah • Edited

Worry not, to quote a founder of dev.to

We all are, and still is at times today (including me) 🖖
~ Welcome onboard

Collapse
 
adamiito profile image
Adam Horváth

Haha, yeah, I have read the article some time ago. It really helped with my mental health at work.

Collapse
 
mshappe profile image
Michael Scott Shappe

Every time I find myself on the verge of asking a co-worker -- especially a junior co-worker, "How did you not know that?!" I realize that the answer is very simple: nobody ever told them, and they never had any reason to know until that moment.

That's a pivotal moment. A moment when feeling clever about a moment's snark can instead turn into a moment of constructive mentorship. And as much as I like to be known for clever snark, I also know I owe my own success to constructive mentors, and try to pay that forward.

Collapse
 
kayis profile image
K

I think the problem is two-fold.

One part is the active gate-keeping. People running around telling everyone they or the tools they use aren't good enough.

How can you use PHP when there is Java? How Java when there is C#? Why switch to JavaScript when PHP finally became a real programming language?

Even my programming techniques professor said JavaScript was a toy and nothing compared to Java.

People shitting on each others' work for all kind of senseless reasons instead of helping each other out. That needs to stop and I have the feeling that more women and minorities in the industry will just lead to that. CoCs are spreading like a wildfire and people become generally kinder. The few old-school uber-nerds I saw here on dev.to didn't stay for long.

On the other hand, we have passive gate-keeping or simply ignorance. I guess that is what you're talking about. This can have many reasons and I can only talk about the ones I encountered.

I often had the impression I'm a bad-to-mediocre developer, so I didn't value most of the stuff I knew and this lead me to think I was one of the last in the industry to learn stuff. Took me a year to understand functions, took me a few months to understand closures, took me another year to understand monads, etc. I was always a slow learner, swimming with 9, biking with 14, so I guess that's where the impression came from that everyone else already knew the stuff I just learned.

I also had to work with many of such old-school uber-nerds who choose tech for projects and generally acted like they had it all figured out. Took me a few years of freelancing and blogging to find out most of them are just talking big and there are a whole bunch of people out there who don't know half as much as I do and would love to work with or learn from me.

Collapse
 
picocreator profile image
Eugene Cheah • Edited

I like the terms active and passive gatekeeping really well. Was trying to make the distinction between the two, but failed to find those exact two words on it.

Active gatekeeping is something that is much more vocal, and easier to identify. Something that a great many wonderful people is talking and working on.

Passive gatekeeping is exactly what I am much more worried about, especially with more and more individuals making their mid-career switch.

These days, the starting line from programming is all over the place, with everyone learning at their own pace. So dun feel bad if you feel like your slow, as long as you are constantly learning and improving. The instinctive subconscious notion of using age as a benchmark for development experience is shattered. Keep going 👍

Passive gatekeeping, is also something much more common in Asian society in certain regions (japan / singapore / etc). While you will find it very hard to find loud vocal sexism or racism, the numbers do not lie (pay scale, high-ranking leadership positions, etc). And by its nature, much harder to talk about.

Collapse
 
nuuou profile image
Zeth Schlenker

Wonderful article.

I struggle with this more often than I'm comfortable with. With rapidly changing libraries and approaches to development, it's so easy to sit on a high horse when you know something and someone else doesn't.

This line especially hit me:
"Isn't it very obvious, I doubt it's worth writing"

Man, that simple statement (or thought, even) has the potential to kill any motivation of someone who's riding the "I just learned something new" wave. And that's not cool. We're all trying to make cool dev stuff together, and we all win when people learn new stuff. :)

Collapse
 
picocreator profile image
Eugene Cheah

Keep that "I just learned something new" wave going! Woosh!

And keep on surfing and learning!

Collapse
 
dkull profile image
Tanel Liiv

There is no such thing as "javascript jvm". JVM is Java Virtual Machine, a name for a specific virtual machine meant to run Java bytecode. Javascript has specific VMs - eg. SpiderMonkey and V8. Or just call it a "javascript vm".

Collapse
 
picocreator profile image
Eugene Cheah

Thanks! I changed it to "javascript engine" to avoid confusion

Memory is a bit foggy - but I do believe the original line was more like "Doesn't the javascript engine, automatically optimize such execution, like the Java JVM?"

Edited for clarity =)

Collapse
 
lagerenas profile image
lagerenas

This is a great article. You said that you are not a great writer but I disagree. You found a good balance of entertaining images to pair with this important topic. The tone of your words is perfect for an open dialogue free of blame.

Collapse
 
downey profile image
Tim Downey

Thanks for writing up this post @picocreator !

Along these lines, I am a big fan of the Recurse Center's social rules -- particularly in this case the one about "no feigning surprise." Their explanation of this:

Feigned surprise is when you act surprised when someone doesn’t know something. Responding with surprise in this situation makes people feel bad for not knowing things and less likely to ask questions in the future, which makes it harder for them to learn.

No feigning surprise isn’t a great name. When someone acts surprised when you don’t know something, it doesn’t matter whether they’re pretending to be surprised or actually surprised. The effect is the same: the next time you have a question, you’re more likely to keep your mouth shut. An accurate name for this rule would be no acting surprised when someone doesn’t know something, but it’s a mouthful, and at this point, the current name has stuck.

Feigning (or actually being) surprised is definitely not as mean spirited as some of the examples you referenced, but it can still discourage folks that are new to an area from speaking up or reaching out for help. Just wanted to note this as well since I think it's pretty easy for (otherwise well-intentioned) people to do this without meaning to.

Collapse
 
picocreator profile image
Eugene Cheah

Really like the Recurse Center's social rules, wish I knew about it earlier.

I embedded your whole comment to the end of the article to highlight it much better!

Collapse
 
jtblackstone profile image
Jason

As the junior developer trying to negotiate and navigate the waters of where can I go for help, this article was a wonderful read. I haven't personally experienced the feign surprise. I have, however, gotten the cold, superior brush-off. 'if you don't know that then you shouldn't be calling yourself a developer.' 'If you don't know x then I can hardly be expected to explain y.'

I avoid stack overflow for those very reasons. Unfortunately it has served to slow me down, as I am now resorting to pouring through my books or the countless sites for one specific fix. And when you aren't even sure what to ask to fix your problem, then Google will fail you. And taking that sort of question to stack or forums is guaranteed to bring the 'we have no time for such trivialities' crowd of responses. Sadly, I have honestly gotten those responses above. Almost word for word.

So thank you!

Kindest regards,

Jason Blackstone

Collapse
 
antonrich profile image
Anton • Edited

You look at this in a bubble.

What if that senior was just rejected by another girl. He is just being a jerk in places where he can be a jerk. In others words he is just getting out his frustration in an aggressive form.

By the way, I started out my comment wrong. Instead of excluding I should added to what you said. Like in improv with an "and" exercise.

Collapse
 
picocreator profile image
Eugene Cheah • Edited

If so, especially if it is someone I know in person.

I would want to treat him to a beer (or anything else culturally appropriate if one does not drink alcohol), to hear out the frustration. And if it's not enough, play some board games.

To let him/her know, there are other healthier ways to let out that frustration, with friends. And not be a jerk at the same time.

Collapse
 
katieadamsdev profile image
Katie Adams

This is an absolutely fabulous article and I'm so grateful to you for writing it. You're incredibly self-aware both as a programmer who has previously made these comments and as a man aware of his privilege. It's wonderfully refreshing. However, as is often the case, the people who need to read this sort of thing will likely not do so. What advice would you give to somebody who hears this sort of comment? How can we stand up for our own knowledge (or lack thereof)? What can we say to a 'bro-grammer' to make them aware of their damaging effect?

Collapse
 
picocreator profile image
Eugene Cheah • Edited

If challenged directly in person (while lacking the context), I would suggest something like the following.

Everyone has moments, where they are lost, confused, and needs help learning something new. And for some of us, it is now.

The key thing is to avoid "you" or "me" and to generalize it, to normalize the feeling of being lost.

As this feeling is universal for all individuals. (Personally, a non-programming example would be kicking a football in soccer).

Naturally, this takes incredible courage. And personally as an introvert, before I built my skills and experience, it can be terrifying to make a stand. And I would consider myself lucky. As such I understand such action is not for everyone.


Which is why I feel it is more on those within the community or the workplace. Those in between "senior" and "junior", the majority in most workplace, and have gone through the hurdles. To step in, and make the stand above, when they see it applied to others.

A situation that I understand not everyone would be lucky enough to be in.


Alternative: Find a safe space to ask such questions

Look outside your current workplace.

A huge shout out (in Singapore) is for junior dev community.
For those in other areas, try searching meetup.com for the keyword JuniorDev to find fellow peers who are struggling, and mentors willing to help.

And if all else fail - reach out to the nearest JuniorDev from your location, and ask them if they know anyone in your area who is willing to provide mentorship. And finally the internet itself


However, as is often the case, the people who need to read this sort of thing will likely not do so.

I really wish I have a simple answer to this. Especially on those within the extremes.

The way I feel about it personally is there is a spectrum of those who are being inclusive and supportive of others, to outright hostility. And everyone else in between, who is the majority.

And as naive as it sounds, it is my wish that through highlighting this to those around me, through articles like these as it gets shared to them. That it can help make those in-between slightly more inclusive and supportive of others.

Just as how "bro-grammer" culture is normalized in several places. The same is possible to normalize a supportive and inclusive culture. One workplace, one community at a time.


I hope the above helps!

Collapse
 
katieadamsdev profile image
Katie Adams

Fab response. Really helpful, thank you. I love the idea of normalising the language used to express the problem - so thoughtful!

Collapse
 
dennismohan profile image
Dennis Mohan

First thing that popped to mind with the concat vs push was similar to your first reaction. This should be some basic comp sci, so it's somewhat surprising people aren't aware.

Interesting write up and probably something I can be more conscious about. Sometimes even very knowledgeable people will misunderstand certain implementation details. These mistakes can happen to anyone, and code reviews could/should be used to question all things. Its supposed serve as a medium for constructive criticism and learning. Unfortunately, all to often I see people looking at code reviews and PRs as a chore to get over with.

On a side note, I'm curious if you run into cases like this more with informal training/education vs a more formal comp sci degree.

Collapse
 
picocreator profile image
Eugene Cheah • Edited

Unfortunately, all too often I see people looking at code reviews and PRs as a chore to get over with.

Sadly very true, due to various constraints

On a side note, I'm curious if you run into cases like this more with informal training/education vs a more formal comp sci degree.

I would say, it really depends on the company culture, maturity of product, and/or process.

Personally, I will admit that even I would make such a "performance issue" and would let it be approved in a PR. I would comment on it, but I will not force it. Personally, I run by the statement...

premature optimization is the root of all evil (or at least most of it) in programming.
~ Donald Knuth (The Art of Computer Programming)

Something I learned, first hand. Is that in the process of creating an application where everyone has strong formal education, is that we can end up endless chasing for O(1) or O(n). It can be a huge time sink, especially on more complex problems.

Because until you have real data and real use cases: sometimes counter-intuitively when n is a small number, u can have O(n^2) performing faster than the O(n) solutions.

Personally, I have spent time on a team, which did a whole 2 weeks on changing a system from O(n^2) to O(n), only to revert it back after launch a month later. Because it was much slower (oversimplifying the problem, the O(n^2) had cachable steps in between, while the O(n) did not.

Since then, learning the hard way, for new features I run by the following in sequence.

  • Is it under <500ms? (For API calls for example)?
  • If not why?, is it a quick fix using cache?, is it good enough for now to ship (UI loading bars, etc)?
  • Do we have actual use case data?
  • How do we make it better then?

Internally we are constantly monitoring our user flows, and looking into areas to improve based on actual usage. Which is precisely how this whole "concat" vs "push" came about, as it was detected in our monitoring process.


It's also something that can happen in not so obvious ways for even a skilled team.

function addCustomObjX( inArray, objX ) {
    // ... does some obj processing
    return inArray.concat(objX)
}

The above would be approved as a merge request. Because if anything its safer to assume one should never modify the input array. If a function does so, it is required for the developer, to do the additional step of commenting and documenting so due to the potential unintended side effect.

What was not predicted (or even in the scope) of the above function was that the resulting usage was ...

while( some condition is true ) {
    // ... does some complex stuff
    domArray = addCustomObjX( domArray, objX )
}

Which caused the huge performance hit! - and it's ok because all we needed to do then next, was make the slight change and document it.

/** 
 * [Original comments]
 *
 * Note: This modifys the input array, and returns it. The developer is expected to 
 * clone the input array if they expect it to be unmodified.
 **/
function addCustomObjX( inArray, objX ) {
    // ... does some obj processing
    return inArray.concat(objX)
}
Collapse
 
swfisher profile image
Sam Fisher

Isn’t it obvious that (programmers are jerks who love to feel smarter than you)? Are you a (n00b who I get to feel smarter than)? Never write such articles again.

Just Kidding! This was an absolutely fantastic read that I hope to apply wherever possible moving forward.

Collapse
 
picocreator profile image
Eugene Cheah

Having one more person, to help on this behavior. Makes this article: worth it!