I’ve been reading a lot of comments over the past week and a half, and one consistent problem I’ve noticed in peoples’ code is that they keep setting variables to be what the example showed.
For example, say we had to take two values and add them together.
The example might say something like this:
a = 1;
b = 2;
(this is very simple im not good at making examples bare with me)
A lot of people might look at this example and then instead of using the variables a and b in their function, they’d use 1 and 2 directly:
return 1 + 2;
So then when the values of a and b change during testing, they’ll end up getting the answer wrong. Not because their code is actually bad or anything, but simply because they hardcoded the values.
I’m not shaming anyone for this by the way, it’s not an uncommon mistake, and it doesn’t mean you’re incompetent or something. That’s not it. I just want you guys to be more aware of this
If you remember not to hardcode stuff and instead use the variables given, then you’ll save yourself a lot of trouble and frustration
Well, that’s it for this post. Keep up the good work everyone!