Skip to main content

Context Is Important

Published on . Updated on .

When getting advice, context is important.

You may have received advice to put all the CSS in a separate file.

Do not use internal styling. You should put all the styling in a separate stylesheet.

That is good advice but it does not always true.

If you only have one HTML page, internal styling is the best choice. The browser only needs to download a single HTML page. That is good for performance.

If you use Eleventy and have little styling, you can use internal styling for the production code.

Another piece of advice is to follow best practices. This is another good piece of advice but does not always true.

Following best practices are not necessary for beginners. Best practices can make them feel overwhelmed.

Imagine, if you never type a single line of code and starting to learn HTML. Then, an accessibility expert gives you a list you must follow to ensure the HTML is valid and accessible. You may start thinking web development is hard. Even worse, you give up.

In real life, "never give up" is a good advice. But, it is not always good.

For example, you start falling in love with a person. Later, you find out that the person is already married. The best thing that you should do is to give up.

Your first love is not your last love.

The most important context is you. You know yourself. You know your exact situation.

The next time you get advice, always keep the context in mind.