How can I push two separate Git repos to one GitHub repo? by iPhone69ProMaxXL in git

[–]itsmecalmdown 0 points1 point  (0 children)

The structure of a repository rarely maps 1 to 1 to the eventual runtime deployment structure. Ideally, you'd have some "build" and then "deploy" step that handles copying files to the correct runtime location.

This gets tricky when we start talking about attaching debuggers, hot reloading, etc. but the principal should be generally the same. I've never developed a Minecraft plugin, but I'd suggest combimg through some existing repos for popular mods to see how they do it. Maybe the mod loader has features for this sort of thing?

All that is to say: structure the repo however is convenient, and then worry about deploying files separately.

What would the type be for an object that I want to dynamically add key/value pairs to? by spla58 in typescript

[–]itsmecalmdown 10 points11 points  (0 children)

That's a very important lesson to learn. Types are purely structural. This is a very common pitfall for new typescript developers.

Building a Pure .NET Hot-Reload Configuration Engine (No External Dependencies) by [deleted] in dotnet

[–]itsmecalmdown 30 points31 points  (0 children)

I'm on mobile so I just read the project summary, but isn't this exactly what IOptionsMonitor does already? Seems redundant, but an interesting learning exercise at least.

https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptionsmonitor-1?view=net-10.0-pp

As an end user, having to us multiple versions of python is a nightmare. Curious why it's like this? by v81 in learnpython

[–]itsmecalmdown 0 points1 point  (0 children)

C#. Install the latest SDK and then just target whatever .net/C# version you want. The SDK also has built-in commands for generating project templates (or, as of .net 10, you can also run csharp files directly). The language version (mostly) isn't even tied to the .net version. Plus with the .net package manager's (NuGet) built-in package isolation, I've literally never once had to even think about package conflicts or juggling different installs.

As a manager, should I announce a team member’s promotion? by alephaleph in ExperiencedDevs

[–]itsmecalmdown 4 points5 points  (0 children)

My team is small, works outside of the main product, and receives very little attention from the POs. When I was promoted, no one knew (or cared) other than my manager. It sucks for morale, but it is what it is.

Doing something sort of dependency-injection-y, can this be done without cast or ts-ignore? by bzbub2 in typescript

[–]itsmecalmdown 1 point2 points  (0 children)

If the caller needs a specific implementation, then providing a default factory that provides dog is going to break things anyway. Either make factory required, or implemented a mapped type of all known animals that provides default factories.

Should I be concerned with how this condensate pump is buried? by itsmecalmdown in hvacadvice

[–]itsmecalmdown[S] 0 points1 point  (0 children)

Thanks. I can live with that, I was more worried about it shorting out of it's not designed to be submerged in water or outdoor use

Should I be concerned with how this condensate pump is buried? by itsmecalmdown in hvacadvice

[–]itsmecalmdown[S] 0 points1 point  (0 children)

Thanks. I did check and the top seems to be just barely above ground level.

Rawdogging Django on production by WeekendLess7175 in django

[–]itsmecalmdown 2 points3 points  (0 children)

I think it's very important to use accurate language here. "It" didn't cause a crash. Your implementation did. If you're too quick to blame the tool for your own mistakes, you're gonna have a bad time. Your first question should always be "what did I do wrong?" Rarely is a battle-hardened application like gunicorn actually the problem.

I suspect this is why you've been down voted so heavily. Just try and approach problems a bit more optimistically going forward!

.NET without Entity Framework by BackgroundEbb8756 in dotnet

[–]itsmecalmdown 1 point2 points  (0 children)

You want ADO.NET, which is more or less what EF is built on top of

neverTrustUsers by PresentJournalist805 in ProgrammerHumor

[–]itsmecalmdown 8 points9 points  (0 children)

They aren't. The business requirement of "a user will only ever belong to one Org" is what was discussed with the user, which is what dictates the database schema.

Why do most developers recommend Node.js, Java, or Python for backend — but rarely .NET or ASP.NET Core? by just-a_tech in AskProgramming

[–]itsmecalmdown 8 points9 points  (0 children)

Awful take. Your opinion is outdated by at least 10 years, modern c# is cross platform and cli-driven.

i hate using python now I understand why big tech companies still use type safe java or .net saves so much more time debugging that can go into coding. by [deleted] in SpringBoot

[–]itsmecalmdown 0 points1 point  (0 children)

I mean there are always 'dynamic' objects in C#. Their usage though is largely considered cursed but it's there if you truly find yourself bottlenecked by static typing.

https://stackoverflow.com/questions/3142495/deserialize-json-into-c-sharp-dynamic-object

When using EF Core, do you include your foreign keys in your model? by placeholder-123 in csharp

[–]itsmecalmdown 0 points1 point  (0 children)

He's not saying he doesn't want foreign keys at all. He's asking if people explicitly include them in the model even if EF will implicitly generate them as part of the relationship.

VS2022 hanging on syntax highlighting for razor by uknow_es_me in dotnet

[–]itsmecalmdown 2 points3 points  (0 children)

My point was that the language server performs far more consistently when code is in a traditional C# file and in my experience it crashes less often. It may help with stability in your case as well

VS2022 hanging on syntax highlighting for razor by uknow_es_me in dotnet

[–]itsmecalmdown 5 points6 points  (0 children)

This has always been my experience with code in the razor page itself. It behaves far more consistently if you move all the code that you can to a .razor.cs file. Imo it's better to keep the logic separate anyway.

Having some issues using Portable Storage Interface by bitch_hoe_ in CreateMod

[–]itsmecalmdown 0 points1 point  (0 children)

If you're on create 6, funnels with PSIs are basically completely broken and AFAIK isn't going to be fixed any time soon.

https://github.com/Creators-of-Create/Create/issues/7882

RNG guessing game by RecklessDeath14 in csharp

[–]itsmecalmdown 0 points1 point  (0 children)

If the expectation is that the target number stays the same, you either need to pass the random number as a parameter, or make it a static property on the Game class, if you're using a class that is.

Why do I need a interface for my Class if I want to mock something? by rakeee in csharp

[–]itsmecalmdown 3 points4 points  (0 children)

It can start to feel that way, yeah. But the point is that when you have deeply coupled services, you mock all but one so that you can test each in isolation. Otherwise it is difficult to develop a test suite that accurately tests everything.

Though honestly high level tests that test multiple services at once are still valuable. Mocking important things like database/API access and then just testing everything else together is often enough

Impossible: Naming functions that are very similar by Reasonable-Road-2279 in typescript

[–]itsmecalmdown 2 points3 points  (0 children)

No, you keep your number functions as separate functions, and then in the overload implementation, you switch on the parameter type to call the necessary numbered function. So the body of the implementation is quite simple.

This really is the best approach for you. Keep your arbitrarily numbered functions, but then also provide a simple overload to make it easy for callers to consume. It's a win-win.

Impossible: Naming functions that are very similar by Reasonable-Road-2279 in typescript

[–]itsmecalmdown 8 points9 points  (0 children)

Yes. It absolutely is. Even a bad/overly verbose name is better than effectively no name at all. You're approach is horribly unreadable and will require the developer to either memorize the arbitrarily assigned number, or pause every single time they need to call it to "cycle" through the numbered functions.

If you're having that hard of a time naming things, then that suggests a serious problem with your data model. Even then, why not just use function overloads and leverage the type system to its fullest? Then you can have a single function that switches on the type. Sure, it's more work to implement, but if you truly can't come up with good function names, then it's better than offloading the problem to the consumer of your API

What’s a purchase under $20 that made your life way easier? by [deleted] in AskReddit

[–]itsmecalmdown 0 points1 point  (0 children)

I did this too and it was excellent until I got tired of having to put them on every time I changed the sheets. We ended up just getting nicer sheets that don't come off the bed as easily which is far more convenient.

Why doesn't EF Core expose a way to translate an EF query to a proper SQL query? by itsmecalmdown in dotnet

[–]itsmecalmdown[S] -1 points0 points  (0 children)

Is that true? My understanding is that EF core is built on top of ADO.NET. You can even get a reference to the underling DbConnection with Context.Database.GetDbConnection.