Have you ever learned a neat programming trick and thought to yourself, “Wow, I wish I knew about this earlier”? It’s happened to me countless times. There are some tips and tricks that you just don’t get taught in school and that no one really thinks to tell you until it comes up. But luckily for you, I’ve gathered some of these pieces of “tribal knowledge” that have made my life easier in the world of coding, and now I’m going to share them with you.
1. Autocomplete in Bash
I was manually typing out every single file or directory name character-by-character, oftentimes misspelling or mistyping, before a fellow student said, “you know you can just press tab, right?”. It’s true—simply start typing and hit the tab key to let Bash automatically complete it for you.
2. Seamless Remote Editing
I remember the first time I had to work on a school project hosted on a server and every student was in agony as we battled with Vim. The next year, I learned I could SSH into the server using good ol’ VSCode and edit files directly. You can even set up a connection such that you don’t need to enter a password each time. No offense to Vim, Nano, Vi, and Emacs fans, but I don’t understand why you’d want to torture yourself with all that when you don’t need to. Now I use VSCode’s remote SSH extension to seamlessly edit, debug, and run code on a VM without ever leaving the sanctuary that is VSCode. Even if you have a different preferred IDE, it probably has a remote SSH extension, too.
3. Making Code Pretty
Consistent code formatting not only makes your code easier to read and maintain, but also helps prevent bugs. We all know this, but do we know it’s actually super easy to automatically beautify our ugly code? Just use a code formatter like Prettier, which you can even install in VSCode.
4. GitHub Desktop
While the CLI is undoubtedly powerful, and it’s important to understand how to use it, sometimes a GUI is just more intuitive and helpful. People love making fun of me for using GitHub Desktop, but I will die on this hill–this tool has saved me so much time (and from tearing my hair out). I’m a visual person, so being able to see the files I’m committing or what branch I’m on at a glance is super helpful. It also makes my life easier when resolving merge conflicts or splitting one commit into multiple. If you’re new to Git or just think a GUI could make your life a little easier, consider giving it a try.
5. More Bash Shortcuts
I know I already gave you a Bash trick but I’ll throw another one at you while we’re at it. Ctrl+A and Ctrl+E are keyboard shortcuts that you might find handy when you’re working in the terminal. Ctrl+A moves the cursor to the beginning of the current line, while Ctrl+E moves the cursor to the end of the line.
6. CI/CD with GitHub Actions
I didn’t know CI/CD was a thing until I was about to graduate (and now I’m in a career where that’s my whole job–go figure). The acronym stands for continuous integration and continuous delivery/deployment, and I really wish I knew about this concept sooner, because tools like GitHub Actions opened my eyes to a whole new realm of development. In my senior year of college, we used it to run some automated unit tests, and the amount of time it saved from having to do that all manually was incredible. Since then, I’ve used tools like this to automate various tasks like running integration tests, building and deploying applications, and sending notifications—all directly within a GitHub repository.
7. Utilizing RegEx
You may have used RegEx in your code, and if you haven’t yet, you should look into that. Regular expressions are powerful tools for pattern matching and text manipulation that were especially helpful for homework assignments or LeetCode problems that asked me to do tasks like validating email addresses, web scraping, or extracting dates. I like using RegExr or Regex101 to test out patterns before using them in my code. Both of those sites give you a handy cheatsheet to help you get the basics down.
8. Python Version Management
If you’re using Python but haven’t heard of pyenv, I’m about to change your life right now. I didn’t start using this Python version management tool until a senior developer at my current job told me about it, but if I’d had this during college, I’d have been unstoppable. Before this, I’d always installed packages globally on my system. But then I’d be switching between two different Python projects, and some of the packages required by one would clash with versions required by the other, turning into a mess of dependencies and a frenzy of uninstalling and reinstalling and crying and throwing my whole computer away. Anyway, check out pyenv and avoid the pain I went through.
9. Matching Delimiter Highlighting
I never noticed this until someone pointed it out to me, so I don’t blame you if you didn’t notice it, either. In most IDEs (or at least VSCode and JetBrains IDEs, in my experience), any opening parenthesis, bracket, brace or quote are highlighted with color or outline whenever you place your cursor at the corresponding closing delimiter, and vice versa. See if your IDE does this, and if it doesn’t, see if there’s a setting you need to enable. And if you’re still on Notepad++—well, my first question is, why? But if you are, I believe you can use Ctrl+B to move your cursor to the matching delimiter. This can be pretty helpful if you’re trying to figure out where you’re missing a curly brace in your jumbled soup of code.
10. Mermaid Magic
If you’re a student, you probably have to make a lot of UML diagrams. Ew, gross. The worst part was using Draw.io or even Google Drawings to make and edit my diagrams. I literally wasted hours trying to match up the arrows to the boxes and getting the formatting and symbols right. Don’t even get me started on how difficult it was to collaboratively make changes when working in a team. That’s why I fell in love with Mermaid after my senior capstone professor introduced it to us. Now, I can represent charts and diagrams as code, which not only makes creating them more efficient, but allows them to be easily tracked in version control. There’s even a live editor you can play around with in-browser. I use this tool often in my current job to create system diagrams and flowcharts, too.
Conclusion
If any of these tricks are new to you, I hope they help make our life a little easier, too. And if you have any of these pieces of “tribal knowledge”, please feel free to share in the comments; I’d love to gather some more tidbits of wisdom! Work smarter, not harder, right?
Leave a Reply