DEV Community

Masaud Ahmod
Masaud Ahmod

Posted on

๐Ÿ› ๏ธ 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! ๐Ÿ”ฅ๐Ÿ’ฌ

Top comments (0)