Skip to content

callback #1398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aIbrahiim opened this issue Jul 27, 2018 · 7 comments
Closed

callback #1398

aIbrahiim opened this issue Jul 27, 2018 · 7 comments

Comments

@aIbrahiim
Copy link

Hello Geeks, could you please tell me how to master callback and callback hell ?

@gireeshpunathil
Copy link
Member

a detailed explanation on the event driven programming is available here: #1118 . If you have doubts on any specific area(s) please let me know.

callback hell is a meme and is neither defined nor documented within Node.js project. The wording originates from complete or partial inability to follow the control flow when large ( more than 3) number of callbacks are connected together. The perceived lack of readability and associated potential program(mer) error is generally referred to as callback hell.

Primary use case for callback is completion handing of an I/O work that happens asynchronously. While this is pervasively used in Node programs, chaining such callbacks deeply is not a common thing, and I am yet to see a real use case where more than 10 callbacks chain up to complete a common business logic. There could be one or two, but then those would probably the central part of an application (such as the composition layer of a webapp that follows microservice architecture) and would be carefully developed and reviewed with control flow well tested.

The meme largely come from programmers from other languages who perceive code sequences to be executed in the order in which those were written.

Promise is a way to circumvent callback chaining. Promise do not avoid callbacks, instead they hide the visibility of the chaining from the user program.

Usage of promise in large scale production systems may degrade overall performance.

@aIbrahiim
Copy link
Author

Thanks Sir,How can I improve my skills in node.js and Expressjs ? how can I practise on them ?

@gireeshpunathil
Copy link
Member

are you willing to be active in the community? then there are a number of things I can suggest:

Expressjs is not part of Node.js project, so I cannot comment on that.

Good luck!

@aIbrahiim
Copy link
Author

Thanks so much I really appreciate that.
Does nodejs is good path to work as web developer in big companies like in europe or usa ?

@gireeshpunathil
Copy link
Member

ah! although it is an honest and awesome question, I cannot answer it, something that influences your career decision.

However, I will copy @nodejs/community-committee to chime in and advise, assuming they are best placed to respond to that within this project.

If there is anything more on technical help and support, I am happy to assist! thank you.

@Bamieh
Copy link

Bamieh commented Jul 28, 2018

@Woodyinho I suggest that you take a look at the Node.js user survey report which will give you a general overview about the users of Node.js and understand how they use it.

To get a hint about the companies that use Node.js and the positions they are seeking, take a look at Stackshare's "companies using Node.js" section.

Finally, Stackoverflow's 2018 user survey report will give you a general overview about the place of node in the overall market, average salaries, positions, and how users rank it in comparison to other technologies and platforms.

I hope you find this helpful while still unbiased, Cheers!

@gireeshpunathil
Copy link
Member

Closing as answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants