This is good advice, thanks. I will definitely get it written down and approved eventually, but the issue is with
It looks very open in your case. Is there no standard or precedent for what you are doing? Something you could lean on?
We're treading new water and doing stuff that nobody in the company is experienced with. We're getting some ideas thrown at us but that's the reason for this topic, I don't feel knowledgeable yet to decide if they are in the right or if they are selling us hammers they like while we actually need something else.
On the other hand, if I just do the simplest dumbest thing for an MVP, I am again just being a hammer and seeing everything as a nail when I should be learning, adapting and applying the correct tool? I kinda want to use the opportunity and do it better or learn something new.
Were your project managers always so technically capable? In my experience they represent the business and while they have to ultimately sign off for the development to start, they don't come up with architecture and design of the solution itself - that should come from the developers/engineering team. At the very least the devs propose possible options and their costs/tradeoffs and then the management picks one, but it's not like they will come down and tell you whether you should use SQL, Postgres, Mongo or w/e database.
(Customer) specifications rarely have technical implementations described down to the most basic detail though. It also won't account for every possible technical problem that could arise, customers generally don't know or care about those.
Maybe if you're a junior in a very professional and experienced company, you can expect the perfect documented jira ticket that could be at that point solved by putting it into chat gpt, but in most cases you will be expected to solve and anticipate the unknowns, especially if you're in a more senior position.

How do you know if you are overengineering? Specific example in mind
I will frame the question in terms of a specific C# objective that I am working on right now but I imagine the question is a pretty general one related to the Dunning-Kruger effect, in a way - how do you know how to build an application when you don't know all the issues you are supposed to prevent?
There is a message hub and I am developing a consumer for it. The original plan was to just create a few background services that get initialized alongside the application, that have a loop to load new messages/events and then process them.
Some time has passed and it feels like I am knees deep in Wolverine, Quartz, Hangfire, MassTransit, transactional outbox and all manner of different related things now. The potential issues are dealing with downtime, preventing loss of messages by storing them in a separate table before processing them, and everyone on the planet has a different idea on how to prevent and solve them and none of them sound simple and straightforward.
Honestly at this p
You are probably right and I just misunderstood fixtures / collections and how they work. I am now trying to configure it using postgres testcontainers and just letting each test create its own but facing a bunch of other issues so not even sure how this works anymore, seems like every tutorial has a different approach. Some just put all the code for creating containers in the setup/dispose of the test class itself instead of trying to be smart with the WebApplicationFactory fixtures and maybe I just end up doing that
My first intent was to just have one local sqlite test db that would get reset to empty state before the tests run (EnsureDeleted+EnsureCreated), and then they all run concurrently on it. It sounded simple to setup and simple enough for my small crud app that only had a few tests.
My second intent was for the framework to create a new in-memory sqlite db for each test so I could fix the problem with tests failing when I'd run all of them at the same time, presumably because they all referenced the same db.
I am currently trying to complicate my life further in the hopes it helps with this by using a postgres database instead, and then in the IntegrationTests project I'm using TestContainers to get a PostgreSqlContainer. I am currently suffering because of some change I made so my tests aren't even being found anymore now, despite being listed in the test explorer when I run them I get "Test discovery finished: 0 Tests found" in output. Honestly I think I'm just gonna give up integration testing like this, it's been a complete waste of time so far.
Dunno what else I could say about my project that is relevant, it's a standard webapp crud with 2 controllers and the integration tests projects has facts like this. Very basic stuff I'd say. Unit tests are a separate project and will just be for simple method checks, no mocking (or at least as little as possible)
Configuring a DbContextFactory in the WebAppFactory instead of a DbContext breaks my services, they can't resolve DbContext anymore so all requests from my test classes fail. Either I misunderstood you or how this works, but it makes sense - I need to properly fix the injectable DbContext so it fixes it everywhere and not just add a DbContextFactory for test classes while the actual code still injects a DbContext.
Configuring the DbConnection service scope as Transient didn't change anything.
I might consider efficiency and speed later but for now I'd be happy to just get it working on this simple CRUD app with 2 test classes, I've spend hours trying various google solutions and I'm a bit frustrated there is no simple guide for something that should be so seemingly simple at this point.

Need help with setting up integration tests using sqlite
I'm a bit confused whether I'm doing this right because every resource I google for has a different way of setting it up.
Some of them initialize the dbContext right in the test class, some do in the WebAppFactory's ConfigureServices (or is it ConfigureTestServices?).
Some do it in the IAsyncLifetime's InitializeAsync, some do it as a dependency injection and other examples just put it as a member variable in the factory.
I don't wanna code dump my project here and ask for someone to solve it but I am not sure anymore what to do. My current attempt is using an sqlite database and it is breaking when I try to run all the tests at the same time due to this.
Makes sense since they are all using the same db in this case so I tried following a guide and just letting them use the :memory: one but that one, for some reason, doesn't seem to initialize the database at all and tests fail because the database doesn't ha
Ohh I mixed it up with FluentValidations, you are right. I never liked unit tests depending on libraries like that either tbf, vanilla xunit aint that bad either
This whole thing is just a nice reminder to not go overboard and use a 3rd party library when it's completely unnecessary. I never had a need to use sth like fluent validations when you can do pretty much the same thing by writing the validation method directly in your Dto, it's a bit verbose but at least it also lets you have more control over the whole thing. Maybe I just never used it on a scale enough to justify the library but it seems completely superfluous, dunno
I only used obsidian for a few weeks so i didnt get that used to it, but what you mean could be the mental switch from hierarchical file structure in obsidian to logseq's journaling/time based one? You're supposed to organize data with tags rather than remembering their location and structure in folders. I spend most time searching for tags, not specific files, and in that way it's functional enough for me, although I do not really understand the query syntax yet so I am unable to create more complex searches in this way. Tbh I'm hoping the sqllite switch lets me just write direct SQL
For a specific example, instead of having folders like Software > Programming > csharp > my projects > projectx ... I will just have a page for the project that has tags #programming #csharp #myprojects etc. And then I can search for #myproject and see all relevant info for it, even sorted by the date when i added it which adds some nice historical context
I switched to Logseq from Obsidian since I preferred FOSS and it's been a good experience so far. They are working on a big update to switch to an sqlite db for storage which should help with performance (and I hope improve the search experience) so that's exciting too.
It's no reddit in terms of quantity but honesty I've had higher quality topics and discussions here than there. Lemmy/kbin might not have taken off in the mainstream to offer a variety of subjects but when it comes to tech and software I think it's covered well enough and people are generally nicer about it. The main problem is lack of (remotely) good seach function, I dont think the threads are getting indexed by google and the on-site search is atrocious.
I don't know of any discord programming communities, I wish forums were still a thing but the only live one I know of is the jellyfin one after they moved from reddit. Other than that it's here or the various subreddits
Doesn't that imply you still have to open up your phone to temporarily share to your pc whenever you need it?
Is this something like the overseerr but for phones?
If I do all that then my feed is going to be even emptier than it is now
Similar experience here. I have a nicely curated list of people I follow on twitter, they often retweet other users that are similar and I have a nice feed of good content that slowly grows without ever running into toxic assholes. On mastodon I couldn't get anywhere close to that no matter how much I tried.
I have a mastodon account, I still check it occasionally and I've tried making it work a year ago, being active on it and following either people or hashtags. I also tried other networks like bsky and cara, or mastodon through kbin integration. None of them really worked out.
I didn't have an issue with the technical side as much as with the community and its mentality. They all have this persecution complex where everyone is out to get them and destroy their way of living. They simultaneously claim it's better and more morally superior than twitter while also responding to any questions or feedback with "if you don't like it GTFO". Most of the posts I've seen on mastodon seemed masturbatory and/or talking about other social networks and why are they bad than why is mastodon actually good. In many ways it was more toxic and negative than my carefully curated twitter feed. There's also as much doom and gloom as on twitter, if not more, when it comes to politics (or at least, it's harder to hide it).
The content in general was bad and boring but I don't know if this is because of the type of people that are on it or just because the lack of algorithm means I will see any random person's ramblings next to the biggest breaking news that I'm actually interested in. There is a lack of innovation in this area and it makes discoverability and content curation terrible, I don't need an algorithm to read my mind but at the very least I wish it could separate trash from actual popular topics.
I found some interesting niches when it comes to FOSS developers and tech but I found next to no actual game devs, artists or content creators on it and even the usual "copy content from twitter" bots were unreliable and uncommon.
TL;DR Mastodon seems very very niche and is not currently viable as a general replacement for other social networks, and IMHO due to the community culture there it's never going to grow into anything else either.
I was aware of some people trying to get it working on wine but last I checked it wasn't really going anywhere, there were some big blockers there, and I didn't know the developers were interested in it at all.
Fork and VS are probably the top 2 pieces of software I'm missing to fully migrate to linux so I'd be very happy if they developed an official port that works as well as it does on win.
although they are experimenting with it)
Do you have a source for this maybe? This is very exciting news but I don't wanna get my hopes up if it's not true
VScodium
I tried this but it seems that VSCodium is missing many of the extensions that are available on VSCode, it has something to do with them using different extension registries?
In any case thanks for the advice but they don't seem to be completely equal in terms of features
How will manually retyping git pull
or checkout
30+ times a day, or using the terminal log instead of a nice GUI with VSCode integration, teach me to solve other complicated issues? I just don't really see the benefit of struggling for most of the time for something that might or might not happen later

Is there a good, modern, widely accepted, learning Linux resource?
cross-posted from: https://programming.dev/post/18636248
I've always approached learning Linux by just diving into it and bashing my head against problems as they come until I either solve them or give up, the latter being the more common outcome.
I wouldn't take this approach with other pieces of software though - I'd read guides, best practices, have someone recommend me good utility tools or extensions to install, which shortcuts to use or what kind of file hierarchy to use, etc.
For example, for python I'd always recommend the "Automate the boring stuff with Python", I remember learning most Java with that "Head first Java" book back in the days, c# has really good official guides for all concepts, libraries, patterns, etc.So... lemme try that with Linux then! Are there any good resources, youtube videos, bloggers or any content creators, books that go explain everything important about linux to get it running in an optimal and efficient way that are fun and in

I don't grok repositories and services and where's the cut-off point for them
I understand the basic principle but I have trouble determining what is the hard line separating responsibilities of a Repository or a Service. I'm mostly thinking in terms of c# .NET in the following example but I think the design pattern is kinda universal.
Let's say I have tables "Movie" and "Genre". A movie might have multiple genres associated with it. I have a MovieController with the usual CRUD operations. The controller talks to a MovieService and calls the CreateMovie method for example.
The MovieService should do the basic business checks like verifying that the movie doesn't already exist in the database before creating, if all the mandatory fields are properly filled in and create it with the given Genres associated to it. The Repository should provide access to the database to the service.
It all sounds simple so far, but I am not sure about the following:
- which layer should be responsible for column filtering? if my Dto return object only returns 3 out of 10 Movie

Making a database identifier unique per user?
Let's say I am making an app that has table Category and table User. Each user has their own set of categories they created for themselves. Category has its own Id identity that is auto-incremented in an sqlite db.
Now I was thinking, since this is the ID that users will be seeing in their url when editing a category for example, shouldn't it be an ID specific only to them? If the user makes 5 categories they should see IDs from 1 to 5, not start with 14223 or whichever was the next internal ID in the database. After all when querying the data I will only be showing them their own categories so I will always be filtering on UserId anyway.
So let's say I add a new column called "UserSpecificCategoryId" or something like that - how do I make sure it is autogenerated in a safe way and stays unique per user? Do I have to do it manually in the code (which sounds annoying), use some sort of db trigger (we hate triggers, right?) or is this something I shouldn't even be bothering with in the

Question regarding generic type and Type
Let's say I have a method that I want to make generic, and so far it had a big switch case of types.
For an simplified example,
csharp
switch (field.GetType()) { case Type.Int: Method((int)x)... case Type.NullInt: Method((int?)x)... case Type.Long: Method((long)x)...
I'd like to be able to just call my GenericMethod
<T>
(field) instead and I'm wondering if this is possible and how would I go around doing it.csharp
GenericMethod(field) public void GenericMethod<T>(T field)
Can I use reflection to get a type and the pass it into the generic method somehow, is it possible to transform Type into
<T>
?Can I have a method on the field object that will somehow give me a
<T>
type for use in my generic method?Sorry for a confusing question, I'm not really sure how to phrase it correctly, but basically I want to get rid of switch cases and lots of manual coding when all I need is just the type (but that type can't be passed as generic from parent class)

What's your preferred code generation tool in 2024?
To clarify, I mean writing scripts that generate or modify classes for you instead of manually writing them every time, for example if you want to replace reflection with a ton of verbose repetitive code for performance reasons I guess?
My only experience with this is just plain old manual txt generation with something like python, and maintaining legacy t4/tt VS files but those are kind of a nightmare.
What's a good modern way of accomplishing this, have there been any improvements in this area?

Need help understanding how to get around port-forwarding with tailscale
I don't have access to my router and my ISP charges for port forwarding (I think they might have a CGNAT setup?).
I'm trying to work around that since I want to start hosting some apps and game servers from my PC. I'm seeing a lot of talk about tailscale as a possible solution to this but honestly I'm a bit confused with all the options and whether this is actually the proper tool for the job.
Assuming it is, do I go the route of setting up a "tailscale funnel" or a "subnet"? Will other people have to install tailscale too if they want to join my servers? People also mention Netmaker or Cloudflared Tunnel, although it also seems like cloudflare doesn't want their tunnels used for game and media traffic?
The more expensive option I guess would be just paying for protonvp premium since it offers port forwarding in that case, but I'm not sure about performance and whether it's worth it, at that point I might just rent a server instead.
Hoping

Is preloading/caching data before the actual method call an (anti)pattern?
cross-posted from: https://programming.dev/post/6513133
Short explanation of the title: imagine you have a legacy mudball codebase in which most service methods are usually querying the database (through EF), modifying some data and then saving it in at the end of the method.
This code is hard to debug, impossible to write unit tests for and generally performs badly because developers often make unoptimized or redundant db hits in these methods.
What I've started doing is to often make all the data loads before the method call, put it in a generic cache class (it's mostly dictionaries internally), and then use that as a parameter or a member variable for the method - everything in the method then gets or saves the data to that cache, its not allowed to do db hits on its own anymore.
I can now also unit test this code as long as I manually fill the cache with test data beforehand. I just need to make sure that i actually preload everything in advance (which is not al

Is preloading/caching data before the actual method call an (anti)pattern?
Short explanation of the title: imagine you have a legacy mudball codebase in which most service methods are usually querying the database (through EF), modifying some data and then saving it in at the end of the method.
This code is hard to debug, impossible to write unit tests for and generally performs badly because developers often make unoptimized or redundant db hits in these methods.
What I've started doing is to often make all the data loads before the method call, put it in a generic cache class (it's mostly dictionaries internally), and then use that as a parameter or a member variable for the method - everything in the method then gets or saves the data to that cache, its not allowed to do db hits on its own anymore.
I can now also unit test this code as long as I manually fill the cache with test data beforehand. I just need to make sure that i actually preload everything in advance (which is not always possible) so I have it ready when I need it in the method.
Is this

What's your favorite DB editor software?
Was just wondering what's popular nowadays, maybe I find something new and better - what kind of tools are you using to access and manage databases?
I'm personally using Dbeaver a lot but honestly it feels increasingly more buggy and unreliable as time passes, every installation and update has had (unique) issues so far and there's little support. However the ease of use and some powerful, convenient, utilities in it make it preferable to others.

So what is actually the issue with (npm) dependency management?
It is a common sentiment that managing dependencies is always a big issue in software development and the reason why so many apps come pre-bundled with all the requirements so it reliably works on every machine.
However, I don't actually understand why is that an issue and why people generally bash npm and the way it's done there. Isn't it the simplest and most practical solution to a problem - you have a file which defines which other libraries you need, which version, and then with one command you can install them and run the program?
Furthermore, those libraries and their specific versions can be stored elsewhere and shared across all apps on a system so you can easily reuse them instead of having to redownload for each program individually.
I must be missing something since if it were that easy, people would have solved it years ago and agreed on a standardized best way, so I'm wondering what is the actual issue and a cause of so many headaches.

How do you improve your "pattern application" knowledge?
I see this often with both new and old developers, they have one way of doing a thing and when presented with a new problem they will fall back to what they are used to even if it's not the optimal solution. It will probably work if you bruteforce it into your usual patterns but sometimes, a different approach is much easier to implement and maintain as long as you are willing to learn it, and more importantly - know it exists in the first place.
On a less abstract level, I guess my question is - how would I go around learning about different design patterns and approaches to problem solving if I don't know about their existence in the first place? Is it just a matter of proactive learning and I should know all of them in advance, as well as their uses?
Let's for example say I need to create a system for inserting a large amount of data from files into the db, or you need to create some service with many scheduled tasks, or an user authentication system. Before you sit down and start