BANKI icon indicating copy to clipboard operation
BANKI copied to clipboard

[WIP] Functional question awnsered.

Open MichaelPachec0 opened this issue 2 years ago • 4 comments

Waiting for comment and review from @curtisbarnard

MichaelPachec0 avatar Jun 09 '22 22:06 MichaelPachec0

Did not know what to write for source (since my sources are embedded in list). I can see the need for some sources for the Pros. Since some of the pros apply for PTC/TCO enabled languages, it makes a bit difficult to get sources on that (since I am guessing we are specifically talking JavaScript).

MichaelPachec0 avatar Jun 09 '22 22:06 MichaelPachec0

@MichaelPachec0 thanks for the contribution. Could you slightly revise with some info from this site (see question #4): https://medium.com/javascript-scene/10-interview-questions-every-javascript-developer-should-know-6fa6bdf5ad95

I think that maybe removing some of the TCO info and putting in some of the info from the above link would be beneficial.

curtisbarnard avatar Jun 10 '22 20:06 curtisbarnard

@MichaelPachec0 thanks for the contribution. Could you slightly revise with some info from this site (see question #4): https://medium.com/javascript-scene/10-interview-questions-every-javascript-developer-should-know-6fa6bdf5ad95

gotcha, considering one the points

OOP Typically depends on shared state. Objects and behaviors are typically tacked together on the same entity, which may be accessed at random by any number of functions with non-deterministic order, which may lead to undesirable behavior such as race conditions.

i wanted to bring up how JavaScript is a single threaded language, which this point didn't make much sense considering race conditions are a problem with concurrency. In concurrent languages you would use either atomics or mutexes to block access of a variable from multiple threads. I am all ears if i got this wrong (and theres a very fair chance that i do i will admit) on how this applies to javascript, or if the bank applies to programming in general.

When writing multi-threaded/process programs care needs to be taken when writing programs that manipulate the same object (ideally they shouldn't or if they do at least have a concrete sequence of steps where thread x does this to object y and then hands over the object to thread z to do more processing/output)

I think that maybe removing some of the TCO info and putting in some of the info from the above link would be beneficial.

fair enough, some of TCO info is redundant anyways.

I will amend it when i have a chance

MichaelPachec0 avatar Jun 12 '22 02:06 MichaelPachec0

That makes sense. I'm not really familiar with multi-threaded languages so you definitely know more than me on this topic. I would exclude info that doesn't pertain to JS. Or if you were going to include it then say something like. "If using a multithreaded language like X race conditions may occur"

curtisbarnard avatar Jun 13 '22 16:06 curtisbarnard