this post was submitted on 05 Sep 2023
0 points (NaN% liked)

Programming

17278 readers
366 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
 

In a lot of projects, this is usually done via README. It tells you what running dependencies to install and how to run certain commands.

This can get harder to maintain as things change, the project grows, and complexity increases.

I see two parts to automate here: actually setting up the environment, and running the application or orchestrating multiple apps.

How do you address this?

top 7 comments
sorted by: hot top controversial new old
[–] wesker@lemmy.sdf.org 0 points 1 year ago* (last edited 1 year ago) (1 children)

My life changed once I discovered dev containers in VS Code. Basically developing within a bootstrapped Docker container.

[–] r1veRRR@feddit.de 0 points 1 year ago

How's the filesystem performance? Whenever I've mounted something into a Docker Container, the performance has suffered. For example, things like NPM/MVN suddenly take way longer.

[–] bahmanm@lemmy.ml 0 points 1 year ago (1 children)

I work primarily on the JVM & the projects (personal/corporate) I work w/ can be summarised as below:

  1. Building & running the repo is done on the host using an SCM (software configuration management tool) such as Gradle or SBT.
  2. The external dependencies of the repo, such as Redis, are managed via adocker-compose.yml.
  3. The README contains a short series of commands to do different tasks RE (1)

However one approach that I've always been fond of (& apply/advocate wherever I can) is to replace (3) w/ a Makefile containing a bunch of standard targets shared across all repos, eg test, integration-test. Then Makefiles are thinly customised to fit the repo's particular repo.

This has proven to be very helpful wrt congnitive load (and also CI/CD pipelines): ALL projects, regardless of the toolchain, use the same set of commands, namely

  • make test
  • make integration-test
  • make compose-up
  • make run

In short (quoting myself here):

Don't repeat yourself. Make Make make things happen for you!

[–] r1veRRR@feddit.de 0 points 1 year ago

How do you manage JVM versions? We have many older projects that use 8, and some newer ones using 17, for example.

[–] Kissaki@feddit.de 0 points 1 year ago (1 children)

Orchestration and containerization are heavy dependencies. I prefer few and simple requirements, especially on the environment.

That only works well with tech with a defined or prevalent environment. Then it's a matter of keeping docs up to date - like any doc.

Using small scripts if necessary, and splitting off non central dev workflows helps keeping it simple and focused.

[–] cyclohexane@lemmy.ml 0 points 1 year ago (1 children)

Containerization is only heavy outside of Linux, and orchestration only makes sense when manual orchestration becomes too tedious (it's easy to orchestrate a single app).

Keeping docs for those things is very troublesome imo. You can't feasibly consider everyone's different environment, C library used, their system's package manager and how it may package software differently than yours, and the endless array of things they may have already installed that may effect your app in some way. Sure, it's not super common, but it's hell when it does.

But I suppose if your use case is very simple, like "just have nodejs installed and run npm start" then sure. But things can get ugly very easily.

[–] Kissaki@feddit.de 0 points 1 year ago* (last edited 1 year ago)

For toolchains like rust, go, c#, typescript/nodejs how would "things get ugly very fast" when making the toolchain an env dependency?