Programming

22170 readers
25 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 2 years ago
MODERATORS
276
 
 

It seems that GitHub is being blocked in my region as well as other options from U.S. based companies (e.g. GitLab)

Where should I migrate my repos? Codeberg is an option as it’s Europe based so isn’t blocked in my region. Codeberg Pages is also nice to have. However, Codeberg seems to push for excluding proprietary software dependencies, which might limit the kinds of projects I can do.

Another option is to self-host Gitea, I could use my old laptop for that. Gitea doesn’t have a GitHub pages, but there seems to be third-party plugins that allow that. The downside with self-hosting (for me) is that it means I’m unable to collaborate with others (since it’ll be local) and I can’t easily share my projects. It will also probably be harder to set up.

What other options are there, or are these two the best options for me?

edit: decided on Codeberg, how do I make my static pages to work with Codeberg Pages? I've switched to a "pages" branch and the website doesn't work (https://username.codeberg.page/repo-name/)

How do I make static pages work with Codeberg???

277
278
279
 
 

https://github.com/thingsiplay/crc32sum

# usage: crc32sum [-h] [-r] [-i] [-u] [--version] [path ...]

crc32sum *.sfc
2d206bf7  Chrono Trigger (USA).sfc

Previously I used a Bash script to filter out the checksum from 7z output. That felt always a bit hacky and the output was not very flexible. Plus the Python script does not rely on any external module or program too. Also the underlying 7z program call would automatically search for all files in sub directories recursively when a directory was given as input. This would require some additional rework, but I decided it is a better idea to start from scratch in a programming language. So I finally wrote this, to have a bit better control. My previous Bash script can be found here, in case you are curious: https://gist.github.com/thingsiplay/5f07e82ec4138581c6802907c74d4759

BTW, believe it or not, the Bash script running multiple commands starts and executes faster than the Python instance. But the difference is negligible, and the programmable control in Python is much more important to me.


What is this program for?

Calculates the CRC hash for each given file, using Python's integrated zlib module. It has a similar use like MD5 or SHA, but is way, way weaker and simpler. It's a quick and easy method to verify the integrity of files, in example after downloading from the web, to check data corruption from your external drives or when creating expected files.

It is important to know and understand that CRC-32 is not secure and should never be used cryptographically. It's use is limited for very simple use cases.

Linux does not have a standard program to calculate the CRC. This is a very simple program to have a similar output like md5sum offers by default. Why use CRC at all? Usually and most of the time CRC is not required to be used. In fact, I favor MD5 or SHA when possible. But sometimes, only a CRC is provided (often used by the retro emulation gaming scene). Theoretically CRC should also be faster than the other methods, but no performance comparison has been made (frankly the difference doesn't matter to me).

280
 
 

Healthy open source communities don’t just form around code, but also around shared values and a vision for how their work can improve the world. The true measure of the success of open source is its impact— how the technologies we develop are leveraged to bring about positive social, cultural, and political change.

281
282
 
 

cross-posted from: https://lemmy.world/post/28442844

cross-posted from: https://lemmy.world/post/28384872

This is a showcase of combining vibe coding with the Fediverse and attempto controlled english (ace).

I'm fascinated by vibe coding, but I'm also highly critical of it. It fascinates me, because it enables people, who normally cannot code to be able to generate running code. What I don't like, is that it just isn't actual programming. It's closer to a wishing well. It fosters a quasi-magical understanding of programming and computer science, which is already too common in current society (I wrote a paper about it here: https://philpapers.org/rec/BINAKR). That's why, in my opinion, the Fediverse should set a counter-point here with something like a first-order logic language like ACE, which actually brings people closer to an actual understanding of computer science concepts like modeling and logic without hiding the complexity behind seemingly "magic", and could also result in better code.

The above demo shows a glimpse of how this could look like on the Fediverse. Imagine communities being able to form their own spaces on the social web through language! Simply using natural language will probably not be specific enough here. We always imagine everything getting much easier, but that's just the logic of digital capitalism that tries to sell us innovation as inventing yet a more easy way to get your coke handed to you, which can only lead to more and more environmental destruction. So, what will the language interface for the future digital look like? I think it will be more something like the semi-formalic language found in technical manuals, cooking recipes and judicial texts. Something like ace, in between coding, domain specific languages, modeling and natural language. And people who are experts at this and know the old technical stuff that no one understands anymore will be the new "coders". But maybe I'm wrong.

Repo: https://github.com/bluebbberry/AceCoding.social.

283
284
20
Making Software (www.makingsoftware.com)
submitted 3 months ago by who@feddit.org to c/programming@programming.dev
285
 
 

I made something to try out for "funtional webcomponents" with vanillaJs. I'm working towards a UI framework for my personal projects. It's far from finished but i thought it might be an interesting concept to share.

286
287
288
 
 

I left Github a while ago and have been relying on simple pre-push scripts in my workflow, but would like to be able to test PRs from others without putting my machine at risk. Besides codeberg and radicle (neither of which have reliable CI), I also have a build machine, where I could run CI jobs, however it is important that the CI jobs can also run locally so that external people do not require access to the build machine.

Is there a CI that can do those things (run locally and remotely)?

Anti Commercial-AI license

289
290
291
292
 
 

Creativity is either exploited by AI or capitalized for growth. It just depends on the game you play, and how you play it.

How does AI influence our creativity in our work?

The answer is that it depends.

In this post, I explore that question through the lens of chess vs. programming and how AI thrives in clarity but struggles in ambiguity.

Let me know what you think!

(Note: This is a link to my own blog)

293
294
295
59
submitted 4 months ago* (last edited 4 months ago) by andioop@programming.dev to c/programming@programming.dev
 
 

A bit different from the audiobook request 2 years ago, as I'm not looking for audiobooks (so it does not have to be nice to listen to, I can see code examples) but regular books you read. Let me know which books helped you out the most, or that you just found fun to read!

EDIT: Thank you to everyone for helping me inflate my reading list! I was wondering what question I should ask to get answers including books on databases, cybersecurity, basically any topic that might fall under "computer science" and not just programming. In hindsight I maybe should have posted somewhere other than Programming and said something other than "Programming book recommendations" if I wanted that, but since I am also interested in programming and software engineering all these books will definitely be eaten soon. Thank you!

Oh, and !books@programming.dev for programming books exists but is sadly not getting much attention.

296
297
298
 
 

There's a big caveat to Tailwind: It generates styles at build time.

So if you try styling your elements with dynamic classes like bg-${color}, it just won't work, you need to write out the full class name for Tailwind to pick it up.

That's fine for a lot of apps, but it becomes a real challenge when you're building things like visual editors, customizable dashboards, or anything that needs dynamic, interactive styling.

The good news is that you can still make it work if you understand how Tailwind works under the hood.

That's why I wrote this blog post, where I show how to:

  • Understand how Tailwind generates styles
  • Mix inline styles with utility classes
  • Use safelisting in v4.0
  • Apply all this for visual editors like Puck
299
 
 

I work at Red Hat on GCC, the GNU Compiler Collection. I spent most of the past year working on how GCC emits diagnostics (errors and warnings) in the hope of making it easier to use. Let's take a look at 6 improvements to look forward to in the upcoming GCC 15.

  1. Prettier execution paths
  2. A new look for C++ template errors
  3. Machine-readable diagnostics
  4. An easier transition to C23
  5. A revamped color scheme
  6. libgdiagnostics
300
 
 

Twenty years ago, Linus Torvalds created the basis for Git in just 10 days, forever changing how developers collaborate on code. In this candid interview, Linus Torvalds discusses Git's unexpected journey from a Linux kernel management tool to the foundation of modern software development. Learn about the technical decisions, community contributions, and evolving philosophy behind the version control system that powers millions of projects.

Edit: I did not notice that a post about this topic already existed. The official GitHub blog post/interview transcript can be found here and discussion about it can be found here.

view more: ‹ prev next ›