this post was submitted on 21 Jul 2023
141 points (98.0% liked)

Linux

46750 readers
1941 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Hello,

I installed Ubuntu a few months ago on my work laptop and I've been running and loving it since.

However, I am used to VsCode, so this is what I am using in Ubuntu as well.

So I am curious, what kind of coding so you do? And what is your workflow.

I am an embedded firware developper and mainly use C. I am cross compiling my code in VsCode for a FPGA from Xilinx (dual core arm + PL)

Never dove into make files and cmake more than what I needed in the past, but I had an opportunity to learn CMake and build a project from it.

So my workflow is :

  1. Code in VsCode
  2. Build in CMake
  3. Transfer the app through scp on the target with a custom script (target is running petalinux, which is yocto + Xilinx recipes)
  4. Use gdb server to debug the code.

It's a pretty simple workflow, but I'd like to know what you guys are running so that I can maybe upgrade my workflow.

top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 26 points 1 year ago (3 children)
  • Code in VSCodium
  • Code in Kate to keep thing fresh
  • Code in Nvim because I still need to learn it
  • Cry while debbuging a React app because the error messages aren't very good
  • Wish I were working with Svelte or had enough backend experience to switch to being a backend dev
  • Play with terminal configs and shell scripting to distract myself from my woes
  • Rinse and repeat.

Aside from the (not so much) jokes, give VSCodium a try, it's to VSCode what Chromium is to Chrome, and works just as well.

[–] [email protected] 5 points 1 year ago (1 children)

Ooh. I did not know about vscodium! I've removed vscode and installed it on my Mac. Thanks.

load more comments (1 replies)
[–] Croquette 4 points 1 year ago (2 children)

I will look into VSCodium. I've heard a little about it, but I couldn't tell you what is the difference between the two.

[–] [email protected] 6 points 1 year ago (1 children)

Microsoft develops vscode as open source, but compiles it with proprietary telemetry tooling.

VSCodium compiles from the same source code but without the telemetry

[–] Croquette 4 points 1 year ago (3 children)

Then i will definitely switch. Are the VsCode addon compatible with VsCodium?

load more comments (3 replies)
load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 25 points 1 year ago (7 children)

Am I the weird one that just uses jetbrains for everything?

[–] Croquette 4 points 1 year ago (1 children)

Isn't JetBrains a paid suite? I've heard a lot of good things about it, but since my workflow is basic, VsCode was always the choice wherever I worked.

[–] [email protected] 6 points 1 year ago (2 children)

There is a "community edition" which is free.

load more comments (2 replies)
[–] [email protected] 3 points 1 year ago

Nope - that's exactly my workflow too.

[–] [email protected] 3 points 1 year ago

IntelliJ for Java and Rider for C#. VSCode for everything else.

load more comments (4 replies)
[–] [email protected] 13 points 1 year ago (1 children)
  1. Code in Emacs
  2. Create a Nix Flake for building my Environment
  3. Build with whatever buildsystem the language requires, often Stack or Cargo
  4. Package for nixpkgs
load more comments (1 replies)
[–] [email protected] 13 points 1 year ago (2 children)

I'm an old school emacs guy, I prefer that for c++/python/etc and run KDE Neon because I like KDE and I'm used to ubuntu (and Kubuntu has some issues). For c++ I use CMake, google test. Not really a fan of docker etc. but I have used Kubernetes and docker in the past. Those types of containers just create new and more complicated problems than just testing on the target platform, but in some niche cases it can be useful.

I can't stress enough how awesome emacs is, but it takes a serious investment to get efficient with it.

[–] [email protected] 7 points 1 year ago

emacs with magit and meow are just amazing efficiency add-ons to my workflow. when your tools just get out of your way and keep you in the flow, it's much easier to stay productive.

load more comments (1 replies)
[–] [email protected] 11 points 1 year ago (4 children)

Tmux + nvim for editing code and bspwm for a fully keyboard only workflow. I have some keybinds in tmux to open a new pane and run cargo or whatever command is necessary to run the code.

load more comments (4 replies)
[–] [email protected] 10 points 1 year ago (1 children)

Transfer the app through scp [...]

I use an ad-hoc while loop in a shell with inotifywait to wait for changes in the watched directory and then scp it.

[–] Croquette 4 points 1 year ago

That's clever. I'm not used to shell scripting yet, but I really like that it is easy to automate things in Linux. If you can run it in terminal, you can script it.

[–] [email protected] 8 points 1 year ago

arch with vsc or jetbrains

[–] [email protected] 7 points 1 year ago

I'm also running Ubuntu as my main machine at home. (I have a Mac and do Android development for my day job).

But at home, I do a lot of website and backend dev.

  1. Code in VSCode
  2. Build using docker buildx
  3. Test using a local container on my machine
  4. Upload the tested code to a feature brach on git (self hosted server)
  5. Download that same feature branch on a RaspberryPi for QA testing.
  6. Merge that same code to develop 6a. That kicks off a CI build that deploys a set of docker images to DockerHub.
  7. Merge that to main/master.
  8. That kicks off another CI build.
  9. SSH into my prod machine and run docker compose up -d
[–] [email protected] 7 points 1 year ago (1 children)

Neovim for me. There are so many plugins to make the editor behave exactly as you want.

load more comments (1 replies)
[–] [email protected] 6 points 1 year ago (1 children)

I work with backend web development, so running code could not be any easier, normally there's a docker image setup watch for changes, recompile and execute.

My text editor is Kakoune, after learning the keybindings I just cannot go back to vim or vscode, selection based editing just makes so much sense to me.

I use NixOS, which comes in handy for keeping my home and office computers in-sync. I also use nix shells to declare the tools necessary to develop each project.

As for window management I use sway, one big window for kakoune to the left, other terminals for docker/tests/git to the right.

load more comments (1 replies)
[–] [email protected] 6 points 1 year ago (3 children)

I usually hack stuff together with vim and tmux (I know, it's redundant but Ctrl b is just a reflex at this point) when on a remote machine, but I use vscode at work and recently discovered the remote mode for Linux development... It's pretty awesome, like not anything you can't set up with vim or emacs, but it's seamless remote development if you already like to use vscode

load more comments (3 replies)
[–] [email protected] 6 points 1 year ago* (last edited 1 year ago)

I'm the only Sublime Text guy here, I guess. Mostly with extensions for formatting, linting, and detecting compilation/type errors. I work with all kinds of languages, mostly interpreted. Python, Rust, Bash, JS/Typescript, Solidity, and a smidge of others so it's hard to pin down one workflow.

EDIT: Just wanted to add that it's really cool to see the diversity in the replies. This here is the power of Linux.

[–] [email protected] 6 points 1 year ago (1 children)
  1. Setup my vimrc.
  2. Clone the project, and realize that whatever repo managing system they started using 3 years ago requires setup steps not in the README and breaks everything at the slightest touch.
  3. Build the currently relevant project in whatever build system they started using 3 years ago (CMake is quite nice).
  4. Fix my vimrc to be compliant with whatever tabbing they use.
  5. Realize that for some reason, someone made a commit in the file I'm reading that uses 3 space tabs. And worse, someone approved that PR.
  6. Make changes via vim.
  7. Debug via print because setting up gdb or JTAG on embedded systems is usually more effort than its worth.
  8. Realize it's a timing issue and reluctantly go find the JTAG debugger.
load more comments (1 replies)
[–] [email protected] 6 points 1 year ago (1 children)

I mainly use Python, so my workflow is the same on every OS: Neovim and a shell, usually one of each in a vertical split. This transfers nicely to remote SSH sessions too, and even works in Termux on my phone!

Have you investigated whether it's possible to test your cross-compiled builds in Qemu, rather than copying them to the host?

load more comments (1 replies)
[–] [email protected] 5 points 1 year ago (1 children)

Rust and C development mainly with a bit of assembly language sometimes:

  • Debian Stable with Xfce
  • distrobox with podman for containers
  • xfce4-terminal with tmux
  • vim with plugins (coc.nvim, delimitMate, NERDTree etc)
[–] [email protected] 3 points 1 year ago (1 children)

when you start xfce, it start with tmux?

[–] [email protected] 4 points 1 year ago

when you start xfce, it start with tmux?

No. I use tmux only inside the distrobox / podman dev container (which is also Debian 12 Stable). I like a more conventional DE for non-dev related usage of the computer. If I wanted a totally tmux-like or terminal-based environment I would go with i3, but that is not something I prefer for my desktop usage for non-coding activities.

[–] [email protected] 5 points 1 year ago* (last edited 1 year ago) (2 children)

I vehemently dislike coding directly on my workstation and do all of my development in remote VMs via SSH, when possible. My work MBP is a glorified SSH terminal with a web browser. I got my start in the industry with remote SysAdmin stuff so, it feels pretty natural.

For an IDE, I use Neovim, currently with a plugin distribution - Neovim because I got used to the vim syntax as a SysAdmin and the distribution because I can't justify sinking more time into tuning my env for a bit but am intending to scrap it all around the holidays or so.

Most of my work is in Go or Python. At home, it's a mix of CircuitPython, C, and I'm picking up some Rust (mainly embedded for C and Rust). Will be starting to learn Verilog this weekend.

For Go and Python, I tend to lean towards a TDD approach, even if it gets a bit derided by coding streamers.

My workflow tends to be:

  1. Prototype desired functionality to get at least individual parts working.
  2. Start from scratch and rough out any classes/structs and test suite boilerplate.
  3. Start the red->green->refactor loop, giving extra granularity to parts of code that I am less confident in.
  4. Once all intended functionality is implemented, run manual tests (I generally develop tools).
  5. Fix bugs that unit tests failed to prevent or I failed to anticipate.
  6. Repeat 4 and 5 until acceptable.
  7. Prepare commit.
  8. Push commit and receive failure because I haven't fully configured my formatters to clean trailing whitespace and VT100-compatible line lengths.
  9. Push commit again and send for code review.

Currently, my build automation is kinda in CMake. Really, the Makefile is just calling a build in a docker container.

For C, Rust, and Verilog, I'm not yet familiar enough to have yet established workflows.

ETA: I think I just got the same FPGA as you! Xilinx Zync-7020 (Digilent Arty Z7-20).

load more comments (2 replies)
[–] [email protected] 5 points 1 year ago* (last edited 1 year ago)

I'm running Docker in Windows and have a mounted drive. I code in VSC using that mounted folder / volume, and the page shows up on localhost. Just a few simple apps to convert fixed width to csv's and back and gives analytics on the data using jStat and tables with dataTables. Nothing fancy, but I like it.

Edit: httpd 2.4 as the Docker container.

[–] [email protected] 5 points 1 year ago* (last edited 1 year ago) (1 children)

C and Lisp:

st -terminal

tmux -workspaces

vim -editor

vim-fugitive -git UI

make -did not require more power yet.

everything vanilla except some custom lines to have vim and tmux share the same pane/window navigation keys.

[–] [email protected] 4 points 1 year ago
[–] [email protected] 5 points 1 year ago

I mostly program in Rust and my main editor is VSCodium with the NeoVim extension but lately I've been experimenting with Alacritty + Tmux + Helix and I'm starting to like it quite a bit.

[–] [email protected] 5 points 1 year ago

Hobbyist programmer. When I switched to Linux, I started using the Atom editor for typing out my JavaScript projects (mostly Electron apps). Now I use Pulsar, because Atom development was cancelled.

https://github.com/pulsar-edit/pulsar

I also find nvm to be helpful for installing and using Node in the terminal.

https://github.com/nvm-sh/nvm

[–] [email protected] 5 points 1 year ago (1 children)

I use helix on NixOS. I have the most basic setup for c(++):

  • edit with helix
  • write custom makefiles with a script I made
  • test the program with the makefile
  • debug with cout or printf
load more comments (1 replies)
[–] [email protected] 4 points 1 year ago
  • kitty terminal emulator
  • Vim for editing
  • CMake for builds
  • A shell script based around entr for automatically running the build/test cycle when I modify files
[–] Boopdedoop 4 points 1 year ago

i3wm/sway - lets me navigate windows with vim-like keyboard motions Neovim - best power editor, hands down. But it takes a bit of tweaking. Tmux - lets me have multiple terminals up in one window. Make/CMake/whatever the project uses. I also write scripts for anything that causes friction which can be automated. Vimium/VimiumFF in the browser - lets me navigate most webpages with just the keyboard.

[–] [email protected] 4 points 1 year ago* (last edited 1 year ago) (1 children)

Do Data Scientists count? I run Bedrock Linux with Hyprland WM and Alacritty as my terminal manager.

I use Jupyter Labs for almost everything. Then Emacs for anything else. I don't like the default config at all, and I'm not that well versed in elisp, so I use Doom Emacs.

load more comments (1 replies)
[–] [email protected] 4 points 1 year ago* (last edited 1 year ago) (8 children)

Java dev, running opensuse Tumbleweed with KDE.

IntelliJ IDEA, maven, git, postman

Kate for quick edits and note taking works very well

Konsole is my terminal of choice

Teams for Linux because I have to

docker on the command line because there's no docker desktop for Linux. There is for windows and MacOS tho, although Linux is literally the thing where it runs on the kernel and whose concepts the whole thing is based upon. Fuck them.

Kind of sad to see still lack (for Linux in general) of apps that are often used in companies. E.g. Teams and docker desktop

[–] [email protected] 4 points 1 year ago* (last edited 1 year ago) (3 children)

Teams for Linux sucks and is not maintained anymore. Devs recommend using the web app and this is what I'm using in Chrome, works really well. Otherwise I'm also on Tumbleweed KDE :)

load more comments (3 replies)
load more comments (7 replies)
[–] [email protected] 4 points 1 year ago

I mainly write C. I really like Intellij Clion because it uses CMake as project files. It also makes tools like valgrind, perf and gdb available without having to go to the terminal.

[–] [email protected] 4 points 1 year ago* (last edited 1 year ago)

Neovim. I work in devops so it's terraform, ansible and aws cli right now... No need to compile anything or build anything. It's quite nice and simple. :)

The ability to do everything with shortcuts and no mouse means i get into a certain flow feeling that is really nice. When I need to web search, I use the mouse however. I don't like the vim like plugins for the browser. The mouse is way faster there.

[–] [email protected] 4 points 1 year ago

I mostly write rust now, but this workflow was finetuned over years. Use 2 terminals each on a diferent monitor, one runs neovim and the other is for building/running. If the project is a bit more complex, I will run it in a docker container( maybe mount the /etc/shadow and frieds so all artefacts are created using the same user as in the outside) . Developed a bunch of tools over the years to optimise this:

  • a 'package manager' in bash so I have a folder for each project/context. One for work, one common, one for the server stuff like this. All are in PATH.
  • parterm - remote control for the terminal so i can start a build from neovim in a different terminal.
  • 'ndock' - at work I use a bunch of branches, this script will set up a few envs and then start a docker in a folder coresponding to that branch.

At my old job had to work on a remote vm so I setup sshfs for a while, but was slow and just moved all my tools there.

I have a pattern where i put all my projects in ~/dev/<branch> and all info related to a task in ~/dev//bugs/<issue_nr>. This is usefull because I can have scripts the work similar for different projects with small changes. For example to run my binary with the config for a issue i just do

ndock <branch>
nr <issue nr>

This will start docker or connect to an existing one for that branch if available, compile the code, run my binary with the config present in the bug folder. In the last few month started running it with rr to be sure i can debug any random issue.

[–] [email protected] 4 points 1 year ago

I use Geany, so that's basically my whole workflow.

[–] [email protected] 4 points 1 year ago* (last edited 1 year ago)
  1. Code in Emacs or Jetbrains (depends on language and laptop cpu)
  2. Run make to build, run, debug, or clean (I like makefiles for documenting basic tasks)
  3. Commit with git when chunk of work is done

I tend to do everything locally on bare metal. I never liked putting stuff in containers or running a vm.

VS Code is a great editor, though. It actually feels a bit like Emacs.

[–] [email protected] 4 points 1 year ago* (last edited 1 year ago)

$mod+enter vim enter Ctrl+p [type a part of the name of the file I want] O [write code]

[–] [email protected] 3 points 1 year ago
  1. Code in Nvim
  2. At work we build using shell scripts, for personal stuff it's usually Make
  3. At work, deploy with Jenkins to Kubernetes or through Puppet to real/vm hosts. a. At home, I use Ansible 99% of the time
  4. Debugging?
load more comments
view more: next ›