Design comparison
Solution retrospective
How to know what I write in code is right?
Community feedback
- @BikeInManPosted almost 3 years ago
Congratulations! It looks perfect.
About your question, there is no right answer here for these challenges.
I think, if you don't have "issues" in the report, that is one way to confirm your code is right. Other than that, I think following best practices will ensure you are writing quality code.
In your code, you have mixed ids and classes in css. Most people use classes for styling and IDs to program in Javascript. IDs can't be repeated in a page, but classes can.
Good Luck.
0@Hade21Posted almost 3 years ago@BikeInMan thankyou, i'm just newbie here so i think that should be one of the right answer. So, everything we write in the code is right as long as no issues on our code?
0@BikeInManPosted almost 3 years ago@Hade21 No, that's not what I meant in all cases and all programming languages. But when it comes to HTML and CSS, they are a declarative and do not have language constructors as in JavaScript or other programming languages. For these two, it partly answers your questions. For larger projects, companies have their own style guides for each languages to ensure we write code in a consistent manner for future developers to support them.
I think, simplicity, consistency, meaningful comments and choice of variable names go a long way in terms of good code.
For CSS, you may want to check out, http://getbem.com/naming/, which is quite popular among seasoned frontend developers.
If you are talking about efficiency and performance, that is a different topic.
Marked as helpful0@Hade21Posted almost 3 years ago@BikeInMan okay, thakyou for new lesson. i"ll read more about that. thankyou very much
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord