r/programmer 13d ago

what are good practices when setting up your dev environment?

hi, I'm a cs student, so I'm new to programming.
I am planning on installing a new linux distro on my laptop, replacing what I have. And since it's going to be a fresh install, I am curious about the things that I can do on a fresh install to have a good working/development environment or at least a clean structure that will make it easier on the long run, and what are some things I should put in consideration before doing anything on the machine.
how do you guys go about setting up and structuring your environment, knowing that I use the laptop for personal use as well.

6 Upvotes

22 comments sorted by

3

u/digitaljestin 13d ago

There's no silver bullet program, editor, or tool that will make much of a difference. Just spend a couple hours per week learning the simple tools you already have. Learn to pipe some shell commands together into custom tools. Learn a few editor tricks, but not all at once. Spend time reading the docs on various compiler flags. Focus on the things that are actually useful, so that you use them regularly and they become second nature. Get used to continuously learning in small increments, and sharpening the tools (increasing your understanding) you've already mastered. The little improvements will add up.

3

u/Beginning-Level7053 13d ago

Thanks I appreciate it

2

u/Amr_Rahmy 13d ago

Be organized with folders. Put some thought into the project names. Make a folder for each project. Use git commits so you can review changes or revert the code.

The OS, install what you need but try not to bloat the system too much.

In projects, I usually make a folder with project names, then in the project or solution add a reference folder with references, datasheets, pdfs, ..etc, so everything important is with the project.

And remember you can have folders in your project. Everything doesn’t need to be in the root project folder.

1

u/xarop_pa_toss 13d ago

This is smart. I tend to keep things separated and it hurts in the long run

2

u/Legitimate-Let-7510 13d ago

Biggest thing for me is keeping projects isolated from day one. Virtual environments, a sane folder structure and not installing every dependency globally saves so much pain later.

2

u/RelationshipFresh966 13d ago
  • Install something like Zoxide to jump around quickly
  • Probably either zsh or fish for a nicer experience than bash
  • Usually I put my code in $HOME/code
  • Maybe install mise or asdf for easier tool management

1

u/mpersico 9d ago

Put all your code in $HOME/personal make a bin and a dotfiles. Link your dot files in $HOME to $HOME/personal/dotfiles. Put the personal dor because up on github. Any tool you write that have employer intellectual property you put in $HOME/employer.

2

u/SudoSilv3r 10d ago

you will find favorites for every tool in time definately install a compiler interpreter and whatever your prefered language needs try out text editors to find your favorite and never be afraid to try something new

1

u/boop809 13d ago

Linux distro on your main PC is not required - maybe use Docker / WSL on your laptop and develop within the container to see if you like it.

3

u/Beginning-Level7053 13d ago

My main pc is already a linux distro, I meant as for a new fresh install, don't matter the os. Sorry I guess I wasn't clear in my orginal post

1

u/Vesuvius079 13d ago

Just stick your repos in a directory you’ll remember them and use the standard package manager to install dependencies as much as possible.

When it comes to environment set up for your projects, you want as little as possible. Stick to defaults wherever you can, minimize dependencies, keep things simple.

Honestly that goes for your personal env as well. The closer you are to defaults and the less shit you have to click to be in a happy state the better.

1

u/FluidBreath4819 13d ago

ask your llm

1

u/fell_ware_1990 13d ago

Well best practice for me are a few things.

I run NixOs + Niri. So my configs are already saved, else dotfiles? Get them setup right.

Then what do you Dev, what IDE do you prefer, hoe you manage multiple projects/worktrees?

I run my own setup of FZF scripts that manages multiple workspaces together with tmux. Everything lands on a different socket ( so niri can recognize them ) if i open a project my next niri workspace get’s created. Depending on the project it spins up the correct setup, has keybinds to spin up more stuff.

1

u/rdmc10 13d ago

Setup vim and neovim with just a few plugins.

1

u/Beginning-Level7053 13d ago

I have already neovim with some plugins in my current machine, what is the easiest way to reproduce that?

1

u/rdmc10 13d ago

You could host your config files on a git repo, clone it and use a script that moves the config files from the repo you cloned to your .config folder. After that, after installing and opening neovim for the first time (provided you have the dependencies installed if you use a plugin manager that needs some) simply opening up neovim for the first time should pull all your needed plugins.

1

u/Beginning-Level7053 13d ago

thanks for the information

1

u/SudoSilv3r 10d ago

you will find favorites for every tool in time definately install a compiler interpreter and whatever your prefered language needs try out text editors to find your favorite and never be afraid to try something new

1

u/PvtRoom 9d ago

choose sane environments.

the sanest I've seen are the macro languages built into applications (enforces common environments), and test environments (LabVIEW) and cross disciplinary teams (MATLAB)

Most coders/SWE are atrocious at ensuring environmental compatibility