Programming

25936 readers
247 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
1
 
 

Hi all, I'm relatively new to this instance but reading through the instance docs I found:

Donations are currently made using snowe’s github sponsors page. If you get another place to donate that is not this it is fake and should be reported to us.

Going to the sponsor page we see the following goal:

@snowe2010's goal is to earn $200 per month

pay for our 📫 SendGrid Account: $20 a month 💻 Vultr VPS for prod and beta sites: Prod is $115-130 a month, beta is $6-10 a month 👩🏼 Paying our admins and devops any amount ◀️ Upgrade tailscale membership: $6-? dollars a month (depends on number of users) Add in better server infrastructure including paid account for Pulsetic and Graphana. Add in better server backups, and be able to expand the team so that it's not so small.

Currently only 30% of the goal to break-even is being met. Please consider setting up a sponsorship, even if it just $1. Decentralized platforms are great but they still have real costs behind the scenes.

Note: I'm not affiliated with the admin team, just sharing something I noticed.

2
 
 

Why aren't people moving away from Github? There's Codeberg, Gitlab, and radicle. What's holding them back?

3
4
47
Sad about .NET (infosec.pub)
submitted 1 day ago* (last edited 1 day ago) by edm@thelemmy.club to c/programming@programming.dev
 
 

These last ten years I was really enjoying what Microsoft and its .NET teams were doing. Felt like a good community to be a part of. Huge strides to make things run anywhere and be more involved with the open source community.

While that hasn't necessarily gone away, jamming LLM's into everything is leaving a real sour taste. Pointless copilot button anywhere and everywhere. VS and VSCode pushing the GitHub copilot chats and agents.

We are quickly back to the corporate MSFT that doesn't listen to its users or employees. All that good will has been washed away and now I feel the need to switch off of Windows.

5
 
 

API-wise, native apps lost to web apps a long time ago. Native APIs are terrible to use, and OS vendors use everything in their power to make you not want to develop native apps for their platform.

6
7
 
 

Following in the footsteps of Hashicorp, Hudson, etc. Zed has chosen to cash in the good will of its now substantial user base and start going to full corporate enshittification. Among other things like minimum age nonsense, they have also added binding mandatory opt-OUT arbitration.

I find such agreements very troubling, because it gives up public funded dispute resolution for private which nearly unanimously benefits larger entities, it lowers transparency to near zero, and eliminates the abilities to act as a class and to appeal. But I worry most will just accept it, as is the norm.

You can however opt out by emailing arbitration-opt-out@zed.dev with full legal name, the email address associated with your account, and a statement that you want to opt out.

I'll just consider my days of advocating for Zed as an interesting new editor over and go back to Neovim bliss.

8
9
 
 

In the previous post, JADEx introduced a new feature ~~Immutability~~.
Through community feedback, several confusions and limitations were identified.

In v0.42, we have addressed these issues and improved the feature. This post explains the key improvements and new additions in this release.


Improvements

~~apply immutability~~ -> apply readonly

  • The previous term (Immutability) caused misunderstandings.
  • Community feedback revealed that “Immutable” was interpreted differently by different developers, either as Deeply Immutable or Shallowly Immutable.
  • In v0.42, we replaced it with readonly.
  • Meaning: clearly indicates final by default, preventing reassignment of variables.

Expanded Scope of final keyword: now includes method parameters

  • v0.41: final was applied only to fields + local variables
  • v0.42: final is applied to fields + local variables + method parameters
  • Method parameters are now readonly by default, preventing accidental reassignment inside methods.

Example Code

JADEx Source Code

package jadex.example;

apply readonly;

public class Readonly {

    private int capacity = 2; // readonly
    private String? msg = "readonly"; // readonly

    private int uninitializedCapacity; // error (uninitialized readonly)
    private String uninitializedMsg;    // error (uninitialized readonly)

    private mutable String? mutableMsg = "mutable";  // mutable

    public static void printMessages(String? mutableParam, String? readonlyParam) {

        mutableParam = "try to change"; // error
        readonlyParam = "try to change"; // error

        System.out.println("mutableParam: " + mutableParam);
        System.out.println("readonlyParam: " + readonlyParam);
    }

    public static void main(String[] args) {
        var readonly = new Readonly();
        String? mutableMsg = "changed mutable";

        readonly.capacity = 10; // error
        readonly.msg = "new readonly"; // error

        readonly.mutableMsg = mutableMsg;

        printMessages(readonly.msg, mutableMsg);

        System.out.println("mutableMsg: " + readonly.mutableMsg);
        System.out.println("capacity: " + readonly.capacity);
        System.out.println("msg: " + readonly.msg);
    }
}

Generated Java Code

package jadex.example;

import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import jadex.runtime.SafeAccess;

//apply readonly;

@NullMarked
public class Readonly {

    private final int capacity = 2; // readonly
    private final @Nullable String msg = "readonly"; // readonly

    private final int uninitializedCapacity; // error (uninitilaized readonly)
    private final String uninitializedMsg; // error (uninitilaized readonly)

    private @Nullable String mutableMsg = "mutable";  // mutable

    public static void printMessages(final @Nullable String mutableParam, final @Nullable String readonlyParam) {

        mutableParam = "try to change"; //error
        readonlyParam = "try to change"; //error

        System.out.println("mutableParam: " + mutableParam);
        System.out.println("readonlyParam: " + readonlyParam);
    }

    public static void main(final String[] args) {
        final var readonly = new Readonly();
        final @Nullable String mutableMsg = "changed mutable";

        readonly.capacity = 10; //error
        readonly.msg = "new readonly"; //error

        readonly.mutableMsg = mutableMsg;

        printMessages(readonly.msg, mutableMsg);

        System.out.println("mutableMsg: " + readonly.mutableMsg);
        System.out.println("capacity: " + readonly.capacity);
        System.out.println("msg: " + readonly.msg);
    }
}

New Additions

JSpecify @NullMarked Annotation Support

  • All Java code generated by JADEx now includes the @NullMarked annotation.
  • This improves Null-Safety along with readonly enforcement.

This feature is available starting from JADEx v0.42. Since the IntelliJ Plugin for JADEx v0.42 has not yet been published on the JetBrains Marketplace, if you wish to try it, please download the JADEx IntelliJ Plugin from the link below and install it manually.

JADEx v0.42 IntelliJ Plugin

We highly welcome your feedback on JADEx.

Thank you.

10
11
12
13
 
 

I am using rust, but this applies to many other languages, I get warnings like, dead code, unused variables, and etc, and while I remove most of them, there are some im not sure of, I like running my program and there being 0 warnings, or 0 warnings as i scroll down my code, so for things im unsure of, i mark them so the compiler doesn't put warnings there. I also add comments, starting with TODO:, it has some information about what to think about when i revisit it, also the todo's gets highlighed in my IDE with my extension, but is this bad practice?

14
 
 

I teach computer science at Montana State University. I am the father of three sons who all know I am a computer programmer and one of whom, at least, has expressed interest in the field. I love computer programming and try to communicate that love to my sons, the students in my classes and anyone else who will listen.

A question I am increasingly getting from relatives, friends and students is:

Given AI, should I still consider becoming a computer programmer?

My response to this is: “Yes, and…”

15
 
 

I'm trying to find a place where you can ask broader development questions, not just specific error messages.

StackOverflow and Codidact are way too restrictive, if your question isn't a precise technical issue with a reproducible example, it gets shut down immediately. Reddit and Lemmy seem more focused on news and memes; actual questions and discussions tend to just sink without engagement. And honestly, the kind of specific error-driven questions StackOverflow excels at are things AI can solve instantly now.

What I'm really looking for is a community (forum, Discord, whatever) where you can get help on broader topics related to software engineering.

Does anything like this still exist? Somewhere with actual humans willing to discuss the process of building software, not just fix syntax?

16
17
 
 

Sample with fibonacci:

⍥◡+9∩1 is the fibonacci in this language

18
19
20
 
 

I am trying to write my own string.h functions, my library currently have no dependicies and 11 functions completed. Has basic and readable code to understand. Small binary size. Freely distributable with BSD-3-Clause license. Have a look: mstrutils

21
 
 

I have created a tech content platform with thousands of tech feeds from individual bloggers, open source projects and enterprises.

The content is organised into spaces. In the Programming space, you can find the latest programming related articles. Each space is filtered by topic and with the threshold parameter you can even control the filtering.

The site has many more features that you can explore.

There is also an RSS feed that you can subscribe to:

https://insidestack.it/spaces/programming/rss

22
 
 

JADEx (Java Advanced Development Extension) is a safety layer that runs on top of Java.
It currently supports up to Java 25 syntax and extends it with additional Null-Safety and Immutability features.

In the previous article, I introduced the Null-Safety features.
For more details, please refer to:


Introducing the New Immutability Feature

If Null-Safety eliminates runtime crashes caused by null,
Immutability reduces bugs caused by unintended state changes.

With v0.41 release, JADEx introduces Immutable by Default Mode


Core Concepts

The Immutability feature revolves around two simple additions:

apply immutability;
mutable

apply immutability;

  • When you declare this at the top of your source file:

    • All fields
    • All local variables (excluding method parameters)
    • are treated as immutable by default.
  • When the JADEx compiler generates Java code:

    • They are automatically declared as final.

mutable keyword

  • Only variables declared with mutable remain changeable.
  • Everything else (excluding method parameters) is immutable by default.

JADEx Source Code


package jadex.example;

apply immutability;

public class Immutability {

    private int capacity = 2; // immutable
    private String msg = "immutable"; // immutable

    private int uninitializedCapacity; // uninitialaized immutable
    private String uninitializedMsg; // uninitialaized immutable

    private mutable String mutableMsg = "mutable";  // mutable

    public static void main(String[] args) {
        var immutable = new Immutability();

         immutable.capacity = 10; //error
         immutable.msg = "new immutable"; //error

         immutable.mutableMsg = "changed mutable";

        System.out.println("mutableMsg: " + immutable.mutableMsg);
        System.out.println("capacity: " + immutable.capacity);
        System.out.println("msg: " + immutable.msg);
    }
}

Generated Java Code

package jadex.example;

//apply immutability;

public class Immutability {

    private final int capacity = 2; // immutable
    private final String msg = "immutable"; // immutable

    private final int uninitializedCapacity; // uninitialaized immutable
    private final String uninitializedMsg; // uninitialaized immutable

    private String mutableMsg = "mutable";  // mutable

    public static void main(String[] args) {
        final var immutable = new Immutability();

         immutable.capacity = 10; //error
         immutable.msg = "new immutable"; //error

         immutable.mutableMsg = "changed mutable";

        System.out.println("mutableMsg: " + immutable.mutableMsg);
        System.out.println("capacity: " + immutable.capacity);
        System.out.println("msg: " + immutable.msg);
    }
}

This feature is available starting from JADEx v0.41. Since the IntelliJ Plugin for JADEx v0.41 has not yet been published on the JetBrains Marketplace, if you wish to try it, please download the JADEx IntelliJ Plugin from the link below and install it manually.

JADEx v0.41 IntelliJ Plugin

We highly welcome your feedback on the newly added Immutability feature.

Finally, your support is a great help in keeping this project alive and thriving.

Thank you.

23
24
 
 

I'm looking for advice on building a collaborative caching system for APIs with strict rate limits that automatically commits updates to Git, allowing multiple users to share the scraping load and reduce server strain. The idea is to maintain a local dataset where each piece of data has a timestamp, and when anyone runs the script, it only fetches records older than a configurable threshold from the API, while serving everything else from the local cache. After fetching new data, the script would automatically commit changes to a shared Git repository, so subsequent users benefit from the updated cache without hitting the server. This way, the same task that would take days for one person could be completed in seconds by the next. Has anyone built something like this or know of existing tools/frameworks that support automated Git commits for collaborative data collection with timestamp-based incremental updates?

25
view more: next ›