• 0 Posts
  • 29 Comments
Joined 11 months ago
cake
Cake day: August 15th, 2023

help-circle

  • Well, there’s modern C++ and it looks reasonable, so you start to think: This isn’t so bad, I can work with that.

    Then you join a company and you find out: They do have modern C++ code, but also half a million lines of older code that’s not in the same style. So there’s 5 different ways to do things and just getting a simple string suddenly has you casting classes and calling functions you have no clue about. And there’s a ton of different ways to shoot your foot off without warning.

    After going to C# I haven’t looked back.





  • Vlyn@lemmy.ziptoProgrammer Humor@lemmy.mlLeave it alone
    link
    fedilink
    English
    arrow-up
    16
    ·
    6 months ago

    Yeah, I’ve worked with the leave it alone types. What do you get in return? Components of your system which haven’t been updated in the last 20 years and still run .NET 3.5. They obviously never stopped working, but you have security concerns, worse performance (didn’t matter much in that case) and when you actually need to touch them you’re fucked.

    Why? Because updating takes a lot of time (as things break with every major revision) and on top of that if you then decide not to update (yeah, same coworker…) then you have to code around age old standards and run into bugs that you can’t even find on Stack Overflow, because people didn’t have to solve those in the last 20 years.




  • Git is mainly tracking and saving changes, which works great for text, but not that well for data (especially binary). You won’t lose your data, but the Git repo will keep growing too fast.

    The big question here is: How often does the data change? If you just use it as a convenient format and rarely change things, it should be fine. Though as mentioned: It might make sense to export to SQL before putting it in Git then. As long as the size is reasonable too (Not storing gigabytes of data).

    Alternatives can be other sync services (Dropbox, Seafile, …) to keep your Git repo lean or even better: Set up a SQL server so the data is always in the same spot. Of course that depends on if you have internet everywhere you work (but you probably do).


  • You can’t trust the result if you only do one pass, because the result could be compromised. The entire point of the first pass is a simple: Safe, yes or no? And only when it’s safe do you go for the actual result (which might be used somewhere else).

    If you try to encode the entire checking + prompt into one request then it might be possible to just break out of that and deliver a bad result either way.

    Overall though it’s insanity to use a LLM with user input where the result can influence other users. Someone will always find a way to break any protections you’re trying to apply.





  • I still haven’t found a proper command or tool to do a multi-commit git blame.

    Like I want to know who changed the logic in this line. But the last commit was a format refactor. And the commit before that just changed a tiny detail. So now I’m digging through the entire file history just to find the spot where this one line was introduced or actually changed.

    If you have any tips for that, I’m all ears.


  • That works for newer projects, but on older projects there’s a dozen commits for any given line and a handful of Jira tickets that have something to do with it, but none that say “Change exactly this”. A comment why you made an interesting design decision costs a lot less time than trying to unwrap the commit history… Especially when you can’t even find a clue on why this was done as the commit might simply be “Implemented feature XY”


  • Vlyn@lemmy.ziptoProgrammer Humor@lemmy.ml*Permanently Deleted*
    link
    fedilink
    English
    arrow-up
    12
    ·
    9 months ago

    The code shows what happens. But comments should explain why it was done this way.

    Sometimes the code started simple and readable, till you ran into a weird edge case a year ago. Now the code no longer looks as obvious and another developer might scratch their head when they read over it. A small comment can help out there quite a bit.

    Or you’re doing something stupid in code not because you want to, but because management forced you to. So you put a comment there that the code isn’t wrong, management wanted that behavior.



  • I’ve worked in a company that used linear code most of the time. And at first it felt really easy to read and work with. If you wanted to know what happened, just jump to the entry point, then read over the next 200 lines of code, done. No events, no jumping around between 10 different interfaces, it worked at first.

    But over time it became a total mess. A new feature gets added, now those 200 lines get another if/else at several spots, turns into 250 lines. Then a new option is added that needs to be used for several spots, 300 lines. 400 lines. 500 lines… things just escalate.

    You can’t test that function and bugs sneak in far too easily. If you want to split it up later into new functions it’s going to be a major hassle. There also was no dependency injection or using interfaces, other classes were often directly called or instantiated on the spot. Code reuse was spotty and the reused functions often got 5+ parameters for different behavior.

    It was horror after a while.

    The company I work for now uses interfaces, dependency injection, unit tests, but all the way down a function might still have 50 lines tops or so. It’s slightly tougher to find out where things happen, but then much easier to work with. You need a certain balance either way.



  • One big reason might be Windows Home vs Professional licenses. I don’t see 80% of the crap Home license users complain about. The other 20% might be settings (I’ve turned everything off).

    Even so Windows is getting plenty annoying nowadays, but it has been this way since Windows Vista. No, Windows 7 wasn’t all sunshine and roses either. And Windows 10 had the same issues (for those Windows 11 deniers).

    I’d love to permanently switch to Linux, but it’s not there for me yet. At least in the areas of gaming (especially multiplayer) and part of my work (Software development in .NET, can’t beat a full fledged Visual Studio application so far. Rider has a subscription even for personal use, blegh).