DEV Community

loading...
Cover image for AYDT - 01 ( Are You Doing This❓ ) - One step towards Ninja Land.

AYDT - 01 ( Are You Doing This❓ ) - One step towards Ninja Land.

chintukarthi profile image Karthikeyan Dhanapal Updated on ・2 min read

When you make a mistake, change your perspective to view that in a different angle. Mistakes are the one that makes you wise.

Master oogway once said,

master oogway quotes

Accidents make you stronger when you move forward with the lessons it taught you, no matter what the field is. So is coding.

During my initial stages when I started to code, I've faced hard times in understanding the underlying concepts of coding.

Along the way, I learned bits and pieces that made me one step ahead of my previous version.

In this coding series, AYDT I'll explain the basic things to keep in mind while writing a piece of code.

Are You Doing This❓- Clearing the Console!

Most of the developers use logs to test whether their code is working the way it was supposed to be. It's a good way of debugging but, some of us fails to clear the logs while moving the code to production.

something like this,

In Javascript

console.log("I failed to clear my logs ☹️");
Enter fullscreen mode Exit fullscreen mode

In Java,

System.out.print("I failed to clear my logs here too!!! ☹️");
Enter fullscreen mode Exit fullscreen mode

You can find a lot more debugging ways once you start mastering the language.

You can Push the code to production without clearing the logs. Of course, it won't make any difference in the functionality nor it is going to affect it. But, is it a good practice?

Ask yourself.

Consider yourself as a user. Which one of the following console will you appreciate?

This?

Bad Console Representation

Or this?

Good Console Representation

"Make your code clean by clearing the logs. Just because the user can't see, doesn't mean we can take that for granted."

Bonus tip :

While going through the portfolio of a Web Developer I came across this.

Good Console

Awesome right? 😉

You can check it out the same in the dev tools of the site over here: http://seanhalpin.io/

This is how you engage your user 😎

Next time you try to log something in the console,

Remember: A fellow developer living somewhere in the world is going to look at your code. 🤪

Cover image courtesy: https://www.codeninja.com.sg/

Discussion (0)

pic
Editor guide