Rules to Better Code
- Do you refactor your code and keep methods short?
- Do you know when functions are too complicated?
- Do you use AI pair programming?
- Do you look for duplicate code?
- Do you maintain separation of concerns?
- Do you follow naming conventions?
- Do you use the testing stage, in the file name?
- Do you avoid using spaces in folder and file names?
- Do you start versioning at 0.1 and change to 1.0 once approved by a client or tester?
- Do you know how to avoid problems in if-statements?
- Do you avoid Double-Negative Conditionals in if-statements?
- C# Code - Do you use string literals?
- Do you add the Application Name in the SQL Server connection string?
- Do you know how to use Connection Strings?
- Do you store your secrets securely?
- Do you share your developer secrets securely?
- Do you avoid clear text email addresses in web pages?
- Do you always create suggestions when something is hard to do?
- Do you avoid casts and use the "as operator" instead?
- Do you avoid Empty code blocks?
- Do you avoid logic errors by using Else If?
- Do you avoid putting business logic into the presentation layer?
- Do you avoid "UI" in event names?
- Do you know when to use switch statement instead of if-else?
- Do you avoid validating XML documents unnecessarily?
- Do you change the connection timeout to 5 seconds?
- Do you declare member accessibility for all classes?
- Do you do your validation with Return?
- Do you expose events as events?
- Do you follow the boy scout rule?
- Do you follow naming conventions for your Boolean Property?
- Do you format "Environment.NewLine" at the end of a line?
- Do you have the time taken in the status bar?
- Do you import namespaces and shorten the references?
- Do you initialize variables outside of the try block?
- Do you know that Enum types should not be suffixed with the word "Enum"?
- Do you know how to use Connection Strings?
- Do you know what to do with a work around?
- Do you know when to use named parameters?
- Do you know where to store your application's files?
- Do you name your events properly?
- Do you pre-format your time strings before using TimeSpan.Parse()?
- Do you know not to put Exit Sub before End Sub? (VB)
- Do you put optional parameters at the end?
- Do you refer to form controls directly?
- Do you know how to format your MessageBox code?
- Do you reference websites when you implement something you found on Google?
- Do you store Application-Level Settings in your database rather than configuration files when possible?
- Do you suffix unit test classes with "Tests"?
- Do you use a helper extension method to raise events?
- Do you use a regular expression to validate an email address?
- Do you use a regular expression to validate an URL?
- Do you use Enums instead of hard coded strings?
- Do you use Environment.NewLine to make a new line in your string?
- Do you use good code over backward compatibility?
- Do you use Public/Protected Properties instead of Public/Protected Fields?
- Do you use resource file to store all the messages and globlal strings?
- Do you use resource file to store messages?
- Do you use String.Empty instead of ""?
- Do you use "using" declaration instead of use explicitly "dispose"?
- Do you warn users before starting a long process?
- DRY - Do you wrap the same logic in a method instead of writing it repeatedly whenever it's used?
- Do you know the difference between a 'smart' and a 'clever' developer?
- Use Enum Constants instead of Magic numbers?
- Do you avoid using magic string when referencing property/variable names
- Do you use null condition operators when getting values from objects
- Do you use string interpolation when formatting strings
- Do you use the new C# 7 language features to slash the amount of boilerplate code you write?
- Do you declare variables when you need them?
- Do you know that no carriage returns without line feed?
- Do you document "TODO" tasks?
- Do you monitor your application for vulnerabilities?
- Do you keep your code consistent using .editorconfig?
- Do you know how to read source code?
- Do you check before installing 3rd party libraries?
- Do you keep a package audit log?
- Do you use package managers appropriately?
- Do you know the best package manager for Node?
- Do you use local copies to resolve race condition?
- C# Code - Do you use primary constructors to keep your code clean?
- C# Code - Do you use collection expressions to keep your code clean?
- Reading Source Code - Do you understand the importance of interfaces and abstract classes?
- Do you use "var"?
- Code - Do you handle all possible scenarios?
- Do you know how to get code line metrics?
- Do you know how to use single codebase for multiple domains with TinaCMS and Next.js?