You are viewing a single comment's thread from:
RE: Block.ops - An Analysis Tool - Account Creation, Account Claiming, Follows, Unfollows, Reblogs, Power Ups, Power Downs and More!
Thank you very much for this intensive contribution.
- In
blockOps.js
you are using async/await - which is great but inmongoblock.js
you are using Promise - which makes the code a lot messier. - sometimes you are using
==
to compare the boolean values (you should stick to===
). - and there is inconsistency of using semi-colon or not at each line. After JS-Minified, the JS code without semi-colons may have a problem.
- Despite
let
in most places, you are also usingvar
sometimes, in a for loop, please be noted that thevar
will lift up the variables and create unpredicted problems. It is in general a good practice to start usinglet
orconst
. - Most functions are too big... You might want to break down a little bit - remember One function should only does one thing (Single Responsibility)
Overall, this is a nice piece of work!
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]
Thanks @justyy. That's some great feedback. And very prompt!
Just a question on 4. (let vs var)...
I use atom as my code editor. When I start a for loop it automatically prompts with this default code:
for (var i = 0; i < array.length; i++) {
array[i]
}
I've now had feedback on both the var being a bad choice and the i++ being dangerous. Is it just bad code?
There are different opinions, I wouldn't consider this is a bad code. The JS is evolving quickly, especially the ES6, ES7 or even ES8, so you will find some syntax sugars e.g. even to replace the
for
loop with map, reduce and filter.. The old-style JS still works but depreciated.Thank you for your review, @justyy! Keep up the good work!