Viewing a response to: @jestemkioskiem/adding-sqlite-support-and-reroll-functionality-to-the-discord-raffle-bot
I am really proud of your progress on your Python journey. :) A couple of minor feedbacks: - Indentation levels  I have counted almost 4 indentation levels in the code. For the reader, that makes the program hard to understand. You go into a different state in each if/for/ block. It reminds me [this](https://www.reddit.com/r/ProgrammerHumor/comments/27yykv/indent_hadouken/) :) You can alternatively check the opposite condition and make less levels of indentations. Instead of this: ``` if utils.permission_check(self.author, config.permitted_roles): # ... do stuff # other if/else condifitions ``` This: ``` if not utils.permission_check(self.author, config.permitted_roles): # send permission error return # ... do stuff # other if/else condifitions ``` This will help the code readers a lot since we don't have interpret/remember the code in our heads in every indentation level. - Using a **blocking** SQLite library Asyncio is a non blocking library, thus if you use it you should use all your companian libraries async. [Here](https://github.com/jreese/aiosqlite) is a asyncio portable SQLite library you can find. Running blocking functions in an async environments hurts the application reactivity very [bad on certain cases](https://docs.python.org/3.6/library/asyncio-dev.html#handle-blocking-functions-correctly). Even though, you won't feel the impact in small scale, it's good to use non-blocking libraries with asyncio. *** Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/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](https://review.utopian.io/result/3/2322211). ---- Need help? Write a ticket on https://support.utopian.io/. Chat with us on [Discord](https://discord.gg/uTyJkNm). [[utopian-moderator]](https://join.utopian.io/)
author | emrebeyler |
---|---|
permlink | re-jestemkioskiem-adding-sqlite-support-and-reroll-functionality-to-the-discord-raffle-bot-20180802t065609592z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"image":["https://cdn.steemitimages.com/DQmQTbV7xF5SFZQnVJSdx9VxiAY83fkghx3WSsNNsSgDsww/Screen%20Shot%202018-08-02%20at%209.42.55%20AM.png"],"links":["https://www.reddit.com/r/ProgrammerHumor/comments/27yykv/indent_hadouken/","https://github.com/jreese/aiosqlite","https://docs.python.org/3.6/library/asyncio-dev.html#handle-blocking-functions-correctly","https://join.utopian.io/guidelines","https://review.utopian.io/result/3/2322211","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"} |
created | 2018-08-02 06:56:09 |
last_update | 2018-08-02 06:56:09 |
depth | 1 |
children | 1 |
last_payout | 2018-08-09 06:56:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 2.274 HBD |
curator_payout_value | 0.753 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2,134 |
author_reputation | 448,535,049,068,622 |
root_title | "Adding SQLite support & reroll functionality to the Discord Raffle Bot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,846,270 |
net_rshares | 1,792,292,955,569 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
espoem | 0 | 17,021,257,979 | 15% | ||
utopian-io | 0 | 1,525,460,758,973 | 1% | ||
emrebeyler | 0 | 198,970,017,942 | 100% | ||
jestemkioskiem | 0 | 50,504,218,494 | 100% | ||
mops2e | 0 | 336,702,181 | 10% |
Hey! Your feedback, as always, is incredible. As a self-learner this provides feedback to the exact issues I'm facing without reading through pages and pages of text that addresses issues I am already aware of. Comments like this are the best part of contributing to Utopian! This is knowledge that will stick with me for the rest of my career when I take it to an actual job. Thank you so much! Stay awesome! Edit: Looked into the indetation, you can find the commit [here](https://github.com/Jestemkioskiem/discord-raffle-bot/commit/524cf045f1dcbf793aa8bf0470f770b0f38ce74b), I'll look into the asyncio issue later today. So expect to be positively surprised the next time you see my contribution here!
author | jestemkioskiem |
---|---|
permlink | re-emrebeyler-re-jestemkioskiem-adding-sqlite-support-and-reroll-functionality-to-the-discord-raffle-bot-20180802t122219931z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"busy/2.5.4","community":"busy","format":"markdown","users":[],"links":["https://github.com/Jestemkioskiem/discord-raffle-bot/commit/524cf045f1dcbf793aa8bf0470f770b0f38ce74b"],"image":[]} |
created | 2018-08-02 12:22:21 |
last_update | 2018-08-02 12:49:42 |
depth | 2 |
children | 0 |
last_payout | 2018-08-09 12:22:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 708 |
author_reputation | 41,292,066,961,817 |
root_title | "Adding SQLite support & reroll functionality to the Discord Raffle Bot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 66,871,759 |
net_rshares | 211,400,357 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
apocz | 0 | 211,400,357 | 100% |