I recently joined a local "boot camp" that's teaching C#, and then JS, HTML, CSS. These snippets are "projects" from the boot camp, but I am doing a little extra homework to try to get better so it's beyond what I've learned from them so far. How does all of this look? And any help or guidance on how to improve and good at-this-level projects I can explore to deepen my understanding would be beautiful, thank you!
#New to coding as a whole: How do these snippets look?
65 messages · Page 1 of 1 (latest)
That's some very colorful code
i might have let my ADHD get the best of me in the extensions
Code looks alright, a couple of things regarding the first (left) screenshot:
- I'd probably change the name on the
KiloConmethod toConvertKilogramsToMiles - I'd probably use verbs on the methods (since they're actions), e.g.
CalculateSalesTaxinstead ofSalesTax, that makes it a bit easier to immediately see what a function does - Rename the parameter to
SalesTaxfromtaxtooriginalAmountor something, thedouble totalAmount = totalTax + tax;looks a bit weird to me
(- I'm not sure if returning an Array from SalesTax is the best way to do things because I as a user of the function would have to constantly check what order the values are returned in - it might be worth it to create a new class here (maybe something like InvoiceTaxInfo or whatever that holds the data)
Also you don't really need the valid variable in the Req class since you're not using it except for stopping the loop -> might as well use the break keyword here
And I'd probably throw the tax rates and kilometer-to-mile conversion rate in some constants with clear names - I just guessed it's miles to kilometers but the code doesn't actually tell me anywhere
ah, yeah, sorry about that, it's in the main, but i didn't include that to keep from having too many screenshots 😬 sorry
No need to be sorry lol
What's in the main?
I'm being very picky on purpose because you probably weren't looking for "yeah looks good to me have fun" lmao
main looks like the third screenshot, calling each of the functions
it's supposed to be function practice (i really only start learning about a week or so ago, so still very early days of just getting the basics drilled in)
and it's ok! i want to learn (: thank you!
As for the second screenshot:
- You don't need to declare, assign and return variables in separate lines when you're immediately returning them (for example in the
BMIfunction that I'd callcomputeBmiyou could just return the calculation directly, same for theAutoCostfunction) - This one has a lot of magic numbers in it too
- Not sure if passing all of the car variables into the function as arguments is the best option here, possibly a class holding that info (
CarCostInfo?)
And for the last one:
- Looks alright, variable names give me a headache though (
AutoCostprobably shouldn't even exist and I'd renameReqto something likeGetInputDouble) - As for the
ReqI'd probably rename the argument topromptor something similar since you're passing in something that gets displayed to the user, not a response
That's about everything I can complain about I guess
Looks very good for being this early in your career though
thank you i'll try to figure out how to implement the things you told me vv helpful
and i am sorry my naming conventions are crap, i am lazy
naming all stray cats cat and kitty mentality
Kek
I think we all use shitty names
Just trying to prepare you for your first PR at work because you'll probably get slaughtered (everyone has this experience)
Think it took me a week (after writing the code) to get my changes accepted at my first job haha
And it was like what 10 or 20 lines of code
only 10 or 20 is impressive, though
i think
i don't know what's impressive, honestly, because i barely understand any code i read as is
i am trying to slog through C# in a Nutshell to help understand what you told me
Just ask questions if you have any
i will thank you 
OH do you know of any other projects i can follow to help drill in all the stuff you said? right now i struggle to understand how to return to stuff, use break without it ending the program, and using loops effectively to maintain user-friendly flow
break just hops out of the current loop
As for projects, we have a graphic that we stole from somewhere with a list of projects with varying difficulty
But in the end you have to work on something that motivates you
i might just suck then
because last i tried it it ended the whole ass program
Probably because you had nothing after the loop?
I'd suggest you only look at the green (easy) ones for now
maybe
i don't remember i just remember immediately removing it
@fallen kraken Here's our official list of project ideas!
Then once you can comfortably solve most of the easy ones you can probably move on
The graphic is ripped from 4chan, just FYI
cope
ask 4chan for advice, got it 
especially on political and social issues.
i am sure they will have the most balanced, healthy takes
A lot of those "easy" projects are very involved and complex
Yup, a few of them look pretty easy, some of them I'd probably have put into semi-advanced
Which is why it's not officially endorsed by this server
"Easy"
"Fizzbuzz (BONUS: In Assembly)"
"Design a Game Engine in Unity"
i sort of did fizzbuzz once in js, but barely and i had to search up a ton of stuff
i'd like another shot at it because i don't remember it at all
Pst: #🏋coding-challenges
👀
Lots of fun cödering challenges
There's 800-something projects for you in there, heh
i am ready for the suffering