Quest989900 / supermart

A supermarket checkout app
0 stars 0 forks source link

Some checks #1

Open lassbon opened 2 years ago

lassbon commented 2 years ago

So I check out the code base and here are my feedback

  1. I am happy seeing the thoughts around the various implementation of the functions
  2. I saw some things that won't let the code run, maybe because you have not tested the code too😌, because i am sure the error would have popped. You can look at the printInvoice() function
  3. yea, i got the logik perfectly but found some code repetition , if that needed , then writing it as a function would have worked.This below
    while(Number.isNaN(userProductChoice)|| userProductChoice > 7 || userProductChoice < 0) { userProductChoice = Number(prompt("Input can only be a number (0-7). \nKindly select(1-7) from the list of items to purchase, \nand press 0 to display the invoice. \n \n1. Dettol soap - #200 \n2. Juice - #550 \n3. Body Cream - #2000 \n4. Plantain chips - #2500 \n5. Crispy Chicken - #1250 \n6. Chocolate - #120 \n7. Plantain - #300 \n0. Exit"))
    }

I saw it the same in 2 different places. In fact a do-while loop would have solved that repetition

✌🏽🥳

Quest989900 commented 2 years ago

Thank you for your informed feedback.

  1. I apologize for this delayed acknowledgement. I somehow missed your mail.

  2. I'm surprised you noted that the code doesn't run. I tested it severally and it gave the output that I expected before I pushed it to my remote repo.

  3. I recognize that the code could do with a lot of cleanup. In fact of you read the repo readme, I called attention to that fact. I left the repeated and commented code because I intended to elicit discussions and comments with them.

I intend to clean up the code after discussing it and push the clean version.

I intend to also build the user interface after the project review session is over.

Thank you.

On Thu, 30 Dec 2021, 18:32 rosh, @.***> wrote:

So I check out the code base and here are my feedback

  1. I am happy seeing the thoughts around the various implementation of the functions
  2. I saw some things that won't let the code run, maybe because you have not tested the code too😌, because i am sure the error would have popped. You can look at the printInvoice() function
  3. yea, i got the logik perfectly but found some code repetition , if that needed , then writing it as a function would have worked.This below while(Number.isNaN(userProductChoice)|| userProductChoice > 7 || userProductChoice < 0) { userProductChoice = Number(prompt("Input can only be a number (0-7). \nKindly select(1-7) from the list of items to purchase, \nand press 0 to display the invoice. \n \n1. Dettol soap - #200 \n2. Juice - #550 \n3. Body Cream - #2000 \n4. Plantain chips - #2500 \n5. Crispy Chicken - #1250 \n6. Chocolate - #120 \n7. Plantain - #300 \n0. Exit")) }

I saw it the same in 2 different places. In fact a do-while loop would have solved that repetition

✌🏽🥳

— Reply to this email directly, view it on GitHub https://github.com/Quest989900/supermart/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIY2PPQTRKE5Y6ZIHIIOT3TUTSJRZANCNFSM5LABZ3QQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>