So you think you can code?
There are many skills developers don't realize they don't have. You might think you know how to code when in reality you only know the tip of the iceberg. Here are a few things that you absolutely should know!
Fixing Bugs
When fixing bugs, fix the disease not the symptoms.
Symptomatic treatment, supportive care, or supportive therapy is any medical therapy of a disease that only affects its symptoms, not the underlying cause.
— Symptomatic_treatment (wiki)
When trying to fix something, just trying to make it work without solving the issue is problematic. Putting a band-aid on an infected wound won't heal it. You need to treat the infection. If you don’t, the wound will fester over time causing a chronic infection.
Now, read the paragraph above replacing medical terms with developer terms, let me help you:
When trying to fix something, just trying to make it work without solving the issue is problematic. Using a workaround on buggy code isn’t going to resolve the issue. You need to treat bugs. If you don’t, over time the code will pile up, becoming full of workarounds, becoming impossible to understand and/or change.
Fundamentals
Some people say that they can work on any project, considering themselves to be senior developers. However, when you see their code (JavaScript) and it’s like:
const quarterOf = (month) => {
let quarter
if (month <= 3) {
quarter = 1
}
if (month >= 4 && month <= 6) {
quarter = 2
}
if (month >= 7 && month <= 9) {
quarter = 3
}
if (month >= 10) {
quarter = 4
}
return quarter
}
You could just do
const quarterOf = (month) => Math.ceil(month / 3)
The difference between when a developer knows what they’re doing vs when they think they know, is very easy to see.
We can check out another example (also in JavaScript). If you ask someone to validate some form fields and check if the name is not empty, you might see:
const validateName = (name) => {
if (name === undefined || name === null || name === '') {
return false
}
return true
}
Again, if you understand JavaScript, you know that Falsy is a thing. Lets assume, in this example, that the return type should be boolean and you’ll code this validation function as
const validateName = (name) => !!name
Knowing the language and tools that you’re going to use everyday can significantly impact your work. Instead of writing paragraphs of code, potentially you can reduce them to 1 line, making it easier to read and understand what’s being done.
By writing good code, you can easily scale a project and be able to implement new features or fix bugs really quickly.
Matrix of Knowledge
Being aware of the different states of knowledge in your mind can significantly help you find things that you take for granted and question more.
The image below depicts the different states of your knowledge.
A) I know that I know: You are aware of the knowledge you have.
B) I know that I don’t know: You are aware of the knowledge you don’t have.
C) I don’t know that I know: You are not aware of the knowledge you have. You do something automatically without realizing that what you’re doing is something other people might not even know about.
D) I don’t know that I don’t know: You don’t know that something exists, or think you understand something that you don’t.
One of the biggest issues that can be observed today, is that people take things for granted, trying to force their knowledge into (A) “I know that I know” which actually becomes (D) “I don’t know that I don’t know”.
Some Bad Arguments (these arguments are WRONG, they don’t know that they don’t know)
> I know React
People that study the framework/library but they don’t learn the language.
> I use MongoDB
People who don’t know or can’t explain why they use it, instead of another database.
> I use MongoDB because I can store anything
People that don’t know that many databases nowadays support a JSON type in a column. For example, you can store a JSON object in Postgres or mySQL.
> I know Clean Code
People who can’t speak about various concepts or best practices that they know, but they try to sound like they know what they’re talking about.
> I consider myself to be a senior developer
People that can’t talk about the fundamentals. They do trivial stuff, using things they learned in college or some, or a “Learn how to program in 5 days” thing instead of using the language’s full potential.
> I don’t like [insert thing here] because it [does something that is not true]
People who make arguments that are factually incorrect. You can easily prove that they’re wrong with official documentation.
> I use [insert thing here] because it’s popular
People that use things just because they’re popular. However, they can’t make an argument about the PROS and CONS of the chosen thing.
You should realize you know nothing
When you’re truly wise you start to realize that there’s so much that you don’t know. You can see this in quotes from philosophers and geniuses.
I know that I know nothing
— Socrates
The more you know, the more you know you don’t know.
― Aristotle
The more I learn, the more I realize how much I don’t know.
― Albert Einstein
So bottom line
Recognize where you are, question everything, start coding wisely!
Resources
- A brief summary of Clean Code
- MDN | JavaScript
- Quarter of the year
- Truthy / Falsy
- The Value Of Knowing What You Don’t Know You Don’t Know