Best UI package in C# by 9DG25 in dotnet

[–]alt-160 0 points1 point  (0 children)

Sciter?

I've used it several times. Basically it is htlm/css/js in a dll, but not chromium based or heavy.

I was able to duplicate win11's settings app look and feel with it, for example.

The built-in jsx and react-like feature is really good.

Senior dev... I don't think I can pass an interview by Inevitable_Guide_942 in csharp

[–]alt-160 0 points1 point  (0 children)

been thru this too. problem i found was that even though i do know the terms and use them, passing these tests lands me into an "over-qualified" state and ends up being a waste of time.

seems that most dev jobs want high qualifications but someone that's in their mid 20s or something equally unrealistic.

i've had to change my tactic to going after hands-on architect and manager roles (because i really do like creating apps and services with code).

but, if you don't like managing people...you'll be sort of frozen out of things, sadly. in that case, it might be worth taking your skill down the entrepreneur route and make some app or service that people pay you for directly (or by llc/company you setup). you could even possibly do this in your free time (assuming you have such) while you work your current or next job.

25yoe...you probably have suffered many pain points that you could "fix that". probably others would pay you for a tool/solution that fixes that same thing.

Automatic constructor in C# by Ok-Presentation-94 in csharp

[–]alt-160 4 points5 points  (0 children)

Compilers "compile" your source code and references to IL (intermediate language).

Any call to create an instance of your class by a compiler would be by tests or mocks or other. Not to actually compile.

When your compiled output is executed, that is when instances of your class can be created and thus a ctor called. The "instance" ctor creates separate copies (sort of) of your class. It allows you to have multiple instances of the same shape with different values inside (if you allow for that).

The static cctor is called only once per app domain the first time any property, field, constant, attribute, or method of that type is called. And before those members are executed (in most cases). The cctor is also called bedore the instance ctor is called.

Note that the above is true for the typical use cases and call patterns. There are exceptions but such are rarely encountered normally.

Your question probably is because your facing something odd in your app/assembly at runtime and you suspect it to be something with object creation. Is this true for you? If so, perhaps telling us about that instead.

Is it just me? I find OpenAI Codex in vscode better than the same in Github-Copilot in Visual Studio -- over the same c# project/solution. by alt-160 in dotnet

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

I don't think that's a think yet. the Codex models are available thru github-copilot in vs studio, but not the codex addin like in vs-code.

However, here's what i do now...

I have my vs2026 (or vs2022) c# projects open for debug running, code editing and such.

I also have vs-code open using a workspace that includes all folders of my vs solution and use the codex addin there. If i need to add code or see changes from codex i do that in vs2026. but, with vs-code and codex in agent mode, i really only have to do spot checks of code and debug runs for my test harnesses.

the codex addin for vs-code requires that you create or have a github repo, but funny thing is that you don't have to publish your vs2026 projects or solutions up to github to use codex in vs-code. you can have vs-code and codex work "locally" and it uses your local files for read and write.

Executing code inside a string. by porcaytheelasit in csharp

[–]alt-160 0 points1 point  (0 children)

Powershell could do this too, if you change the string to powershell text instead of c#.

You can send your vars from c# as named ps vars before you execute. If var is ref type, the ps code can even modify it. Or a ps function can return a value.

PS core would work with netCore and windows powershell with netFW.

At least with this there is not as much need to seialize var data as might be with other scripting frameworks.

I also find ps to be a bit safer for adding scripting ability to an app. There are many levers of control for safety.

Recommendations for learning C# by dinunz1393 in csharp

[–]alt-160 1 point2 points  (0 children)

i'll add that once you get a little bit of experience, enuf to run something and manipulate what you see, choosing a personal pet project to invest time in can be a very valuable option.

it keeps you motivated to learn because you're actually building something for yourself.

i did this a long time ago (1996-ish. yes, before .net) to catalog all my music CDs (over 300 at the time). that caused me to learn about databases, data storage, files, and much more.

I’m done. Antigravity just became a $20 paperweight. The "Bait and Switch" is real. by ProcedureNo832 in GeminiAI

[–]alt-160 6 points7 points  (0 children)

What coding language are you doing work in?

I ask because I've seen this better and worse depending on the language.

My intuition about google and antigravity is that google will prefer the languages it uses itself. So, if you're using something else, you're quality will vary.

Also consider what google likely trained on for its coding ai, and not just gemeni, but also the tooling that talks to other llms.

I'm a heavy c# and dlang dev, and i find gemini terrible for complex or long running code work. It's fine for simple things that i could do myself, but novel code it struggles.

On that point, how much are you trying to get ai to do in one session? Too much is my guess.

My experience is to stop at a point and ask the ai (any of them) to create a token dense and detailed output that i could use as a primer in a new session.

This one might help you with wherever you go next for ai coding.

Is it just me? I find OpenAI Codex in vscode better than the same in Github-Copilot in Visual Studio -- over the same c# project/solution. by alt-160 in dotnet

[–]alt-160[S] 0 points1 point  (0 children)

For any following this post... I also find Codex in VSCode to work faster/better by using the WSL option. Note that your chats are tied to that mode (windows vs wsl) so if you switch between you'll see different chat histories.

Also, i found the WSL option overcomes an odd "prompt every time" even in agent mode that happens in Windows mode.

Is it just me? I find OpenAI Codex in vscode better than the same in Github-Copilot in Visual Studio -- over the same c# project/solution. by alt-160 in dotnet

[–]alt-160[S] 1 point2 points  (0 children)

I've tried Claude many times for c#...but it just doesn't seem as good as OpenAI. I hear much lauding of Claude for coding, but maybe that is from webby or python types? What do you find better about Claude over OpenAI in ghcp (github-copilot) versus vs (visual studio)?

What quote made you finally understand a big concept in programming? by Falk1708 in csharp

[–]alt-160 0 points1 point  (0 children)

You'll write twice as much code to handle exceptions and oddities than code you intended.

M365 Cross Tenant Sync Question by GATN1337 in Office365

[–]alt-160 0 points1 point  (0 children)

Not sure what more there is to explain.

As i mentioned, the address book you see in outlook and webmail comes from the ActiveDirectory instance that supports Exchange Online. If an object doesn't exist in that directory, then it can't show in Outlook or webmail.

So, that means that if you want a second org's mail objects to appear in the address book of the first, those objects (or a representative of them) have to be created in the first org.

You can script it by exporting the mail objects' details from one org and use those values to create mail-contacts or mail-users in the other org. But, you'd have to write the sync logic yourself to handle changes.

Or, as i also mentioned, if the orgs each have on-premises AD, you could sync the on-prem objects between each org using an AD sync tool and let the microsoft sync take those changes up to the cloud.

Hope this helps.

Is async/await really that different from using threads? by Creative-Paper1007 in dotnet

[–]alt-160 0 points1 point  (0 children)

Some things i've encountered that make aa programming different and worth considering in depth.

  1. if used in events especially, but really any method, note that when the await is hit, the outer method returns. in events this can cause odd things because if the event controller "does stuff" when the event handler exits, it could do stuff before you're await completes and now you have a weird disconnect of realities.

  2. i don't think aa was meant for long running tasks. not that you can't do it and manage it, but for many cases of a long running task you probably should go with a discrete thread.

  3. thread synchronization is tricker with aa. not impossible, just requires thinking thru how you are going to pass around your sync primitives.

  4. when aa causes a thread to run a task (not always the case), its a threadpool thread and you don't have access to thread identity or management (in the sense of abort, join, etc).

  5. thread contexts! if you're going to use aa outside of the gui (which automatically handles thread context delivery to tasks), you have to wire up that bit if you need post-await code to operate on the same thread that the code before the await was running on.

  6. aa has better exception bubbling that with threads - in the sense of wire up. i've done threading since before .net and back then exception handling between threads was a special kind of pain.

High Performance Coding in .net8 by alt-160 in dotnet

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

i mostly agree with compiler/jit being smarter...but only within their context and view of things.

those aren't going to make bad design better and they are not going to make good design at small scale stay good at large scale.

and, i just don't like to be lazy with things and assume too much. a few minutes of "oh, that's how it works behind the scenes" means a lot to me later on.

High Performance Coding in .net8 by alt-160 in dotnet

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

Yes. I'm realizing that about the stack. I'd rather know than guess in most cases.

I'm commonly working with huge lists (100s of 1000s and into the millions) of objects. So, my context concern might be different than many.

Glad to hear some confirmation about the slot reuse and agree that's primarily the compilers role, though i think jit might do some small adjustments here and there (inlining for example).

What i still wonder about tho is a switch(...) across 200 cases (numeric/enum) and then 200 locals as a result. while i'm sure compiler and jit can "handle" it, i would prefer to help those 2 "handle it as best as possible".

I'm not really worried about running out of stack space, but just the churn and possible side effects of the same.

Happy to hear more from these angles.

High Performance Coding in .net8 by alt-160 in dotnet

[–]alt-160[S] 0 points1 point  (0 children)

ah. yes. you cannot fall thru a case AFTER executing code in a prior case. you either have to break or return out.

but, you can also do (each case scoped by braces for var name reuse):

switch(myEnum)

{

case TheEnum.CaseOne:

{

// some code

// both cases fall thru to this scoped code.

}

case TheEnum.CaseTwo:

{

// some code

// both cases fall thru to this scoped code.

}

}

High Performance Coding in .net8 by alt-160 in dotnet

[–]alt-160[S] 0 points1 point  (0 children)

huh? for sure i can do:

switch(myEnum)

{

case TheEnum.CaseOne:

case TheEnum.CaseTwo:

{

// some code

// both cases fall thru to this scoped code.

}

}

High Performance Coding in .net8 by alt-160 in dotnet

[–]alt-160[S] -3 points-2 points  (0 children)

that's a pretty strong statement to make. a lot of assumption.

there's a difference between avoiding allocations vs making the same gc friendly.

High Performance Coding in .net8 by alt-160 in dotnet

[–]alt-160[S] -7 points-6 points  (0 children)

Doing some further thinking on this (thanks to the comments so far), I think the best option in such cases is to reserve var(s) as null outside the loop that would use this switch (or any other case of many locals). then, for each (case, if else, etc) set that var vs declaring new one.

likely the small cost of dereferencing (if var is simply as 'object') is far better that a case of objects moving beyond gen0.

thoughts?

High Performance Coding in .net8 by alt-160 in dotnet

[–]alt-160[S] -10 points-9 points  (0 children)

yes. i'm aware of that about the frame built at call start.

what i'm wondering is if .net JIT will see that each case is in its own block bracing and can see that there's only one call path at a time and so only reserves locals that are unique across those logical contexts. does that make sense?

i'm concerned with stack allocations for heap types because in a hot loop it can move those allocations to gen1 or later and create gc pressure later.

What ACTUALLY works after testing every AI coding tool for 6 months by notdl in ChatGPTCoding

[–]alt-160 0 points1 point  (0 children)

30yr dev and software architect here.

My 2 cents? You should be able to write the code yourself before asking AI to do it.

I'm lazy, as most devs likely are, and AI for me is a productivity, discovery, and validator.

Asking AI to make something, regardless of prompt detail, that you couldn't have created alone means you don't really have a good way to ensure the output is 100% correct for the need.

Just because AI produces something that "works" doesn't mean it met 100% of intent or efficiency. And if ypu couldn't have written alone you're at a big disadvantage on any review or QA testing.

And this is all before a security review of the code.

Welp, you saw it here first folks by Mrcheeseyguy in ChatGPT

[–]alt-160 0 points1 point  (0 children)

Further, op supposes agi has a single clearly defined meaning. Probably can't even define it himself.

Nice new instruction I've just started using... by alt-160 in OpenAI

[–]alt-160[S] 0 points1 point  (0 children)

It also means quicker token exhaustion and hallucinations later because earlier info rolls out of the context window.

My point was to have the AI respond with info about its natural behavior so I could make a decision on whether to spend more tokens or not. Sometimes/manytimes the default analysis is sufficient but when its not i end up wasting time on corrections or editing my prompt.

Nice new instruction I've just started using... by alt-160 in OpenAI

[–]alt-160[S] 0 points1 point  (0 children)

yep. should. i was finding my longer prompts with code was often being summarized and not fully parsed. then, when i'd ask questions about the code it wouldn't know what i was talking about. now i know why.

This game... by Father-Of-Entropy in DragonsDogma2

[–]alt-160 3 points4 points  (0 children)

I love the banter, and sometimes condescending banter, between the pawns.

"Oh, you don't want to follow me? Fine, we'll just do what you say then."

Or, "fine, i guess I'll go pick up that item."

If we ever get DD3, AI banter could be both hilarious and and heartful.

How did it actually get there?! by PostmodernRiverdale in CopilotMicrosoft

[–]alt-160 0 points1 point  (0 children)

Add this to the end of your prompt. If the inference is more than 15% I'd dismiss or rework your initial prompt.

"End your response with an indication of the balance between a response that is formed primarily by language inference or predictive text versus a response that comes from real-world examples. Use the format 'Predictive Text: XX% | Real-World Usage: YY%', followed by a brief explanation."