DEV Community

Masaud Ahmod
Masaud Ahmod

Posted on

2

๐Ÿ› ๏ธ 2 Simple VS Code & Debugging Hacks Every Developer Should Use! ๐Ÿš€

1๏ธโƒฃ One VS Code Setting That Speeds Up Your Workflow โšก

Many developers donโ€™t realize how much time they waste on manual saving, mismatched brackets, and repetitive coding. Try these simple settings:

โœ… Auto Save: Automatically saves your work after a short delay.

"files.autoSave": "afterDelay"
Enter fullscreen mode Exit fullscreen mode

โœ… Bracket Pair Colorization: Highlights matching brackets for better readability.

"editor.bracketPairColorization.enabled": true
Enter fullscreen mode Exit fullscreen mode

โœ… AI-Powered Code Suggestions: Install Tabnine AI or Codeium to boost coding speed with smart autocompletions.

2๏ธโƒฃ Stop Using console.log() โ€“ Try These Instead! ๐Ÿ”

console.log() is great, but there are better ways to debug your JavaScript code. Here are some game-changing alternatives:

๐Ÿš€ Format data properly with console.table()

const users = [{ name: "John", age: 25 }, { name: "Jane", age: 30 }];
console.table(users);
Enter fullscreen mode Exit fullscreen mode

๐Ÿš€ Use debugger; to pause execution and inspect variables in Chrome DevTools

function fetchData() {
  debugger; // Opens DevTools and pauses execution here
  return fetch("https://api.example.com").then(res => res.json());
}
Enter fullscreen mode Exit fullscreen mode
function fetchData() {
  debugger; // Opens DevTools and pauses execution here
  return fetch("https://api.example.com").then(res => res.json());
}
Enter fullscreen mode Exit fullscreen mode

๐Ÿš€ Measure execution time with console.time()

console.time("fetchData");
fetchData().then(() => console.timeEnd("fetchData"));
Enter fullscreen mode Exit fullscreen mode

๐Ÿ’ก Bonus Tip: If youโ€™re not using these yet, start now and watch your debugging and workflow efficiency skyrocket! ๐Ÿš€

๐Ÿ‘‰ Which trick did you find most useful? Let me know in the comments! ๐Ÿ”ฅ๐Ÿ’ฌ

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, weโ€™ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, weโ€™ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

๐Ÿ‘‹ Kindness is contagious

Dive into this thoughtful article, cherished within the supportive DEV Community. Coders of every background are encouraged to share and grow our collective expertise.

A genuine "thank you" can brighten someoneโ€™s dayโ€”drop your appreciation in the comments below!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found value here? A quick thank you to the author makes a big difference.

Okay