clean-code-javascript | : bathtub : Clean Code concepts adapted for JavaScript | Architecture library
kandi X-RAY | clean-code-javascript Summary
kandi X-RAY | clean-code-javascript Summary
Software engineering principles, from Robert C. Martin's book Clean Code, adapted for JavaScript. This is not a style guide. It's a guide to producing readable, reusable, and refactorable software in JavaScript. Not every principle herein has to be strictly followed, and even fewer will be universally agreed upon. These are guidelines and nothing more, but they are ones codified over many years of collective experience by the authors of Clean Code. Our craft of software engineering is just a bit over 50 years old, and we are still learning a lot. When software architecture is as old as architecture itself, maybe then we will have harder rules to follow. For now, let these guidelines serve as a touchstone by which to assess the quality of the JavaScript code that you and your team produce.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of clean-code-javascript
clean-code-javascript Key Features
clean-code-javascript Examples and Code Snippets
Community Discussions
Trending Discussions on clean-code-javascript
QUESTION
I'm trying to call to the Google PageSpeed Insights API with mutliple input urls read from a .txt
file and to output the results to a .csv
.
I wrote a console app to try to fire these requests off, and then as they come back to add them to a list, and when they are all done, to write the list
to the .csv
file (async got a little nutty when trying to write the responses immediately to the .csv
).
My code it below, and far from optimized. I come form a JavaScript background, where I usually don't use web workers or any other managed new threads, so I was trying to do the same in C#.
- Can I run do these multiple
WebRequest
s and write them to a collection (or output file) without using multiple threads and have them all run in parallel, not having to wait for each request to come back before handling the next one? - Is there a cleaner way to do this with callbacks?
- If threads or
BackgroundWorker
s are needed, what's a Clean Code way of doing this?
ANSWER
Answered 2017-Jul-12 at 14:16Can I run do these multiple WebRequests and write them to a collection (or output file) without using multiple threads and have them all run in parallel, not having to wait for each request to come back before handling the next one?
Sure thing.
Is there a cleaner way to do this with callbacks?
You can always iterate over the input lines and grab a collection of the tasks that are all running.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install clean-code-javascript
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page