DEV Community

The bane of every developer; spelling, casing, and random commas

Michelle Duke on September 01, 2020

I was recently playing Twilio Quest over on my Twitch channel. Twilio Quest is a coding game where you can learn to program Python, JavaScript, PHP...
Collapse
 
jmplourde profile image
Jean-Michel Plourde

Yesterday, I using AngularJS to make put requests. Because I forgot the second paramet of the http request, which is for request parameter and I didn't have any, my request would fail with a really weird and long link. Forgetting to put an empty array {} what interpreted by js like I was passing my whole function anonymous functioin as a parameter. Took me 15 minutes to debug.

I'm also notorious for typos that create bugs that block me for some time.

Collapse
 
mishmanners profile image
Michelle Duke

Yeah I feel you. This definitely makes me feel like a developer when I come across these things. But it's a good feeling when you finally figure it out!!!

Collapse
 
leirasanchez profile image
Leira Sánchez

This VSCode extension will help with spelling mistakes: marketplace.visualstudio.com/items...

it works with camelCase too! Not sure if there's something similar for atom

Collapse
 
mishmanners profile image
Michelle Duke

Yes I love this extension! Unfortunately this was being coded in the program itself so I couldn't add any extra extensions. The extensions in VS Code are legit awesome.

Collapse
 
vlasales profile image
Vlastimil Pospichal

Your code is wrong. You deserve it.

Collapse
 
mishmanners profile image
Michelle Duke

Hahahah, totally! I was just so confused that no one else could figure it out either. But hey, it's all a learning curve right? I am loving it though!!!

Collapse
 
vlasales profile image
Vlastimil Pospichal

If you show your code, I'll show you how to improve it.

Thread Thread
 
mishmanners profile image
Michelle Duke

I had about 30 developers looking at it live. You can see it in the video link (a link to the full live stream), and you can see a link to my GitHub repo (linked in the article).

Thread Thread
 
vlasales profile image
Vlastimil Pospichal • Edited

Sorry, unfortunately I don't see a link to your GitHub.
You used the method toLowerCase() six times, you need it two times only. It doesn't occur to the developer that there can be a typo in one of the six calls, everyone would see it in the two calls.

Thread Thread
 
mishmanners profile image
Michelle Duke

Linking here again: github.com/MishManners/Twilio-Ques...
We just did what the course told us to do. And yes, there were 30 different people arguing over how to best do it. This is what I love about live coding!

Thread Thread
 
vlasales profile image
Vlastimil Pospichal
const firstValue = process.argv[2].toLowerCase();
const secondValue = process.argv[3].toLowerCase();
if (firstValue < secondValue) {
    console.log(-1);
} else if (firstValue > secondValue) {
    console.log(1);
} else {
    console.log(0);
}
Thread Thread
 
mishmanners profile image
Michelle Duke

Thanks for this. Will check it out

Collapse
 
fristys profile image
Momchil Georgiev

Yikes - only double equals comparisons in JavaScript and this really strange code style...spelling is the least of your worries

Collapse
 
mishmanners profile image
Michelle Duke

Hahaha, 100%!

Collapse
 
jaydwayne profile image
Jay Dwayne

Hi Mish, I relate with your story on developer setbacks. I was coding a Project on C++ and ' : ' instead of ' ; ' messed me up lol.
I figured it out hooooooouuuuurs later.
Thanks for sharing .