Should I create functions/methods for packages/libraries that allow optional parameters to accept null as a value?
  • RonSijm RonSijm 4d ago 100%

    Having to pass in null values seems a bit weird. You can define functions and optional parameters like this:

    function myFunction(a = 1, b = 1, c = null, d = null, e = true) {
      return a * b;
    }
    

    Then people don't have to call your function with

    myLibrary.myFunction(1, 7, null, null, true);
    

    they just call your library with

    myLibrary.myFunction(1, 7);
    

    You could add a default inside the method signature, like:

    function myFunction(a = 1, b = 1, c = null, d = null, e = true) {
      if (c === null) {
        c = 5;
      }
      return a * b * c;
    }
    

    because if you define it in the method:

    function myFunction(a = 1, b = 1, c = 5, d = null, e = true) {
      return a * b * c;
    }
    

    then if people still call it with

    console.log(myFunction(5, 2, null));
    

    Then the default c = 5 is overwritten by null, and results in 0.

    I don't know if you really need to handle all that though, instead of just doing c = 5 - if people intentionally call your library with null, and things go wrong...? well yea ok, don't do that then.

    But it depends on the use-case. If this is some method deep within a library, and some other calling method might be unintentionally dumping null into it, you could default it inside the method, and handle it

    2
  • The ongoing feud between Wordpress and WP Engine is threatening open-source principles and good name
  • RonSijm RonSijm 1w ago 100%

    Because Wordpress is also hosting 1000s of plugins that WP engine users can install.

    I'm not sure what the license regarding those things is, WP engine could probably just mirror it -

    But they basically got locked out of the default ecosystem infrastructure.

    7
  • Any recommendations/tips for mentorship services?
  • RonSijm RonSijm 1w ago 100%

    Since others already suggested mostly on-topic suggests, here's an alternative suggestion:

    Instead of looking specifically for a mentor - look for an open source project that you can help with. Ideally one with a discord or something to it's easy to be in contact the the lead dev. A lot people don't mind mentoring juniors, but in my experience it doesn't happens that explicitly - "be my mentor" - and it might sound like you're asking them a lot.

    If you invert it into "Hey I wanna help you with your open-source project, but I don't really know what to do, what your expectations are, how to implement a specific feature" - then you're offering to do work them, instead of asking for something. And implicitly you'll get mentorship in return.

    And "real" projects probably also look better on your github / portfolio than only some dummy projects for learning purposes

    11
  • The JetBrains Developer Recognition Program is expanding! Recognized #GitHub Stars can now enjoy free access to all JetBrains IDEs.
  • RonSijm RonSijm 2w ago 100%

    Sorry to be skeptical - but does this really do anything? It's nice, I guess, but it mostly just seems like marketing.

    They already had a program for Open-Source Projects and a program for Developer Recognition - And maybe some other programs that I've missed.

    And if you check the Github Stars Profiles - it's just 76 people. A lot of whom I suspect would already quality through one of their other programs

    2
  • Registration opened for Hacktoberfest 2024
  • RonSijm RonSijm 4w ago 100%

    Yea, I agree.

    Also what's the point now? At least a couple years ago we got a pretty cool t-shirt. Now we're just getting a digital badge..?

    1
  • 60% of Open-Source Maintainers Are Unpaid: It's Concerning & What We Can Do About it
  • RonSijm RonSijm 4w ago 97%

    40% of you are getting paid for this...? 🫠

    41
  • The technology behind GitHub’s new code search
  • RonSijm RonSijm 4w ago 100%

    That doesn't really work all the time, because large files or large commits are lazy loaded on scroll, so what you're searching might not have loaded yet

    The code search does a server side search

    6
  • Oopsie, Visual Studio License expired, so the build server stopped working
  • RonSijm RonSijm 1mo ago 100%

    No, not some internal company, just Microsoft being Microsoft. So all Windows pipelines. They also have Linux based pipelines so not completely all pipelines.

    But given that a lot of people build dotnet stuff on Azure, the 'windows-latest' image is usually the default. So a lot of pipelines

    10
  • Oopsie, Visual Studio License expired, so the build server stopped working
  • RonSijm RonSijm 1mo ago 100%

    That's not a Discord bot, it's a Slack RSS App / RSS subscription.

    Event Source: https://status.dev.azure.com/_event/543117809

    It's pretty useful 'for work' because occasionally you'll get notifications when parts of infra might be down (like your build server)

    15
  • Oh no, not just my build server, Microsofts build server... Everyones' Azure build server - (if you're building on windows)

    421
    91
    so my friend asked me to explain whats an rss feed
  • RonSijm RonSijm 1mo ago 72%

    It’s more the fault of the implementation and documentation.

    Yea sure. Though it's slightly XMLs fault for allowing that kinda implementations. Every random thing is in it's own obscure namespace with 20 levels of nested objects in different namespaces, and if you get anything wrong it barely explains what's wrong, and just refuses to work.

    It's mostly WCFs fault. I just automatically associate XML with nightmare flashbacks of implementing WCF stuff

    5
  • so my friend asked me to explain whats an rss feed
  • RonSijm RonSijm 1mo ago 80%

    Uh-huh... ever tried to integrate with a poorly implement WCF service? Like communication from a Java service to a dotnet service through a WSDL?

    I'll take a json API over XML any day

    12
  • Psychopath Dev
  • RonSijm RonSijm 1mo ago 100%

    At some I added logging to a thread pool, when it gave up on child-threads, it would be logging things like

    "Child 123 is being aborted"

    Not the best of phrasing for people that didn't know what that was about...

    21
  • Anyone having acceptable performance with SQL Server + odbc?
  • RonSijm RonSijm 1mo ago 100%

    Omg it’s sooo daammmn slooow it takes around 30 seconds to bulk - insert 15000 rows

    Do you have any measurements on how long it takes when you just 'do it raw'? Like trying to do the same insert though SQL Server Management Studio or something?

    Because to me it's not really clear what's slow. Like you're complaining specifically about the Microsoft ODBC driver - but do you base that on anything? Can you insert faster from Linux or through other means?

    Like if it's just 'always slow' it might just be the SQL Server. If you can better pinpoint when it's slow, and when it's fast(er) that probably helps to tell how to speed it up

    3
  • I need help getting back into development
  • RonSijm RonSijm 1mo ago 100%

    When I stopped, subversion was what we used. I’m trying to understand Git, but it’s a giant conceptual leap.

    It's probably not 'that much of a leap' as you imagine. If you're looking at Git tutorials, they're usually covering all kinda complex scenarios of how to 'properly use Git'. But a lot of people barely care about 'properly using Git' and they just kinda use it as a substitute for SVN... You create branches, you merge them back and forth, and that's about it.

    Like if you want to contribute to an open source project, all you have to do is create a fork (your own branch in SVN terms) - commit some stuff to it, and create a pull request (request to have your changes merged) back to the original branch. git pull is just svn update - getting someone elses commits

    Not saying there aren't more complex features in git, or that learning git properly isn't worth it, just saying, I don't think you have to see it as a 'giant conceptual leap' that's preventing you from jumping back into programming. Easiest approach just to get started would be probably to just download a GUI like Sourcetree or Fork, and you just kinda pretend you're still using SVN - approach wise

    21
  • Java Was The Future
  • RonSijm RonSijm 1mo ago 96%

    That laser at the end should have been Java Technology™ ;

    You point it at anything, and end up with a huge dumpster fire... Sounds like Java to me

    31
  • Avoiding Test-Case Permutation Blowout (2021)
  • RonSijm RonSijm 2mo ago 100%

    In C# I'm generally using Verify for these happyflow tests - So instead of explitly testing every individual property, you just do Verify(state); and compare the entire state against a json saved state.

    A little bit for the same reason of "testing fatigue" - having to manually rewrite assertions of a lot of tests is getting annoying. With that approach you just do a merge compare between results, accept them, and you're done

    2
  • Is it a good idea to build out a no-code platform for an API
  • RonSijm RonSijm 2mo ago 100%

    It's a bit of a vague question, generally an API is backend - and you're kinda asking "should I make a frontend for this?" - hard to tell without context...

    If you just want a "semi-developer-ish" frontend, you could look into just making an OpenAPI spec for it, and using something like Swagger as a frontend. Then at least you have some kind of GUI

    7
  • Which protocol or open standard do you like or wish was more popular?
  • RonSijm RonSijm 2mo ago 100%

    Problem Details for HTTP APIs - I have to work and integrate with a lot of different APIs and different kinda implementations of error handling. Everyone seems to be inventing their own flavor of returning errors.

    My life would be so much easier if everyone just used some 'global unified' way to returning errors, all in the same way

    15
  • Is it better to check if a file exists before trying to load it, or to try to load it, and catch the error and move on?
  • RonSijm RonSijm 2mo ago 100%

    Well you need to try and catch when getting the file anyways, it's probably very rare but imagine a scenario of:

    • Check if file exists
    • user deletes file in between
    • (try) opening the file

    Or the file could exist, but you don't have permissions to actually open it.

    So a bunch of languages / already have their own "try open file"

    9
  • www.codingame.com

    I started this challenge and it's pretty fun. - First round: Program a runner to jump over hurdles - Second round: Program runners to jump over hurdles. Problem here is that 4 games are running at the same time, and you can only give 1 input every game-loop that'll go to all 4 games - Third round: 4 different games are being played at the same time, and you have to give an input that'll be for all 4 of them every game-loop They have this graphical interface that'll actually show what your character is doing, which makes it more interesting than just a "code-only" leetcode or adventofcode challenge

    47
    4
    www.youtube.com

    Youtube Description: With an incredible trailer that came out of nowhere, marrying RTS elements with third-person modern vs medieval combat, Kingmakers has gone on to become one of the most eagerly anticipated games of 2024... and Digital Foundry has an exclusive interview with the developers. What tech is Kingmakers using? How does it work? How many enemies will you do battle with and what's the level of AI in play? Find out here as John Linneman discusses the game with developer Redemption Road. ----- Not sure if this fits the usual /c/gamedev content, but I thought it was really interesting - it's an interview with 4 devs, and they go pretty deep into the tech of how they're building this game, and how they're managing to have 4000 knights running around at the same time

    5
    3

    Hey there, I was using https://mlmym.org/programming.dev/ to browse programming.dev because I don't really like the default Lemmy UI. However, as of today https://mlmym.org just redirects to this gist: https://gist.github.com/rystaf/4d591ffdcbaab1c49efa406885efd814. When checking both https://old.lemmy.world and https://lemmy.world - they both resolve to the same IPs - So it seems like the intended use for this UI is not use it though https://mlmym.org anymore, but for the instances to host it themselves under the "`.old.`" subdomain. In a similar way reddit is doing. As for how it would look, have a look at https://old.lemmy.world - and probably enable dark mode in the settings. Was hoping programming.dev would consider supporting this UI as well, under old.programming.dev - It makes the transition from Reddit to Lemmy a lot easier You can find the repo of it over here: https://github.com/rystaf/mlmym

    16
    5

    Context: /r/ProgrammerHumor/ closed for a couple of days, then - "because mods have to listen to the community or otherwise they get replaced by more /u/Spez compliant mods" opened up again, and held a voting which new rules to enforce. The sub opened up with the new rule allTitlesMustBeCamelCase. I made the first post about 15 minutes after the sub re-opened (because I'm in their discord, I was aware it opened up again, it wasn't announced yet, I think) - and of course I just make a shit-post about John Oliver since it's the /r/pics (and a bunch of other) subreddits way to protesting the API changes. It wasn't even that good of a post to be honest, it got temporary taken down by the subs' mods since they mentioned "it's only anecdotally related [to programmer humor]" - but after messaging them explaining the context they put it back up. So it's basically approved by the moderators of the subreddit. And not against the content policy of the sub It got like 3k upvotes in about an hour, so I got a message from some bot that I was on the frontpage of /all/ as well. At the end of the day it had 13.5k upvotes About 48 hours later I got an automated message: > Your account has been permanently suspended for breaking the rules. > This account is permanently suspended due to violations of Reddit's content policy I posted an "appeal" basically just asking "Lol you banned me for posting John Oliver?" And the only response I got was: > Thanks for submitting an appeal to the Reddit admin team. We have reviewed your request and unfortunately, your appeal will not be granted and your suspension will remain in place. > For future reference, we recommend you to familiarize yourself with Reddit's Content Policy. > -Reddit Admin Team > This is an automated message; responses will not be received by Reddit admins. I posted another "appeal" yesterday asking "Could you clarify which Content Policy rule I broke?" To which they haven't responded yet. It's the only post I made in the last 2 weeks, so there wasn't any other reason to suddenly ban me besides this post... My reddit account was 12 years old at this point. I was going to leave anyways because the Reddit client I use (sync) already announced it would be shutting down June 30 - so I don't care that much that they banned me - just though it was a pretty weird approach from the Reddit Admins to start banning people for getting John Oliver on the front-page

    293
    120