Click here to Skip to main content
15,886,919 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Standards? Eat your heart out, Randall Pin
Amarnath S30-Mar-24 0:03
professionalAmarnath S30-Mar-24 0:03 
GeneralRe: Standards? Eat your heart out, Randall Pin
trønderen31-Mar-24 11:11
trønderen31-Mar-24 11:11 
GeneralSupporting multiple cores from bare metal C Pin
honey the codewitch13-Feb-24 6:17
mvahoney the codewitch13-Feb-24 6:17 
GeneralRe: Supporting multiple cores from bare metal C Pin
11917640 Member 14-Feb-24 22:39
11917640 Member 14-Feb-24 22:39 
GeneralRe: Supporting multiple cores from bare metal C Pin
honey the codewitch15-Feb-24 0:03
mvahoney the codewitch15-Feb-24 0:03 
GeneralRe: Supporting multiple cores from bare metal C Pin
11917640 Member 15-Feb-24 1:04
11917640 Member 15-Feb-24 1:04 
GeneralRe: Supporting multiple cores from bare metal C Pin
honey the codewitch15-Feb-24 5:03
mvahoney the codewitch15-Feb-24 5:03 
GeneralSource Generators in C# and TDD misadventure time Pin
honey the codewitch31-Jan-24 6:30
mvahoney the codewitch31-Jan-24 6:30 
I'm very new to the source generator technology in C# so bear with me, as my information is probably incomplete or inaccurate but what I've discovered so far is amusing and annoying at the same time.

I tried to get a source generator referenced from one project for use in another project and I was getting weird results when crawling the syntax tree. I don't even know how to google about the results I'm getting back. It's hard to explain, but it breaks the thing.

Creating an incremental generator[^]

I followed this code precisely, and it didn't work on my system.

However, it will work when I invoke the generator to run specifically as part of a unit test. I haven't had as much luck invoking it outside a test framework. I have no idea why this is.

I *believe* (read: hope) it will work when packaged as a NuGet package as well, which is how it was designed to be deployed and used.

Of course, I don't want to deploy a NuGet package of code still in initial development.

The bottom line for all of this is that this leaves me in the position of being forced to perform Test Driven Development in order to make source generators.

I don't know if this is a weirdness with my machine, or perhaps a quirk in this relatively new technology or what, but it's just bizarre to be forced into a particular development paradigm like this.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix

GeneralRe: Source Generators in C# and TDD misadventure time Pin
Graeme_Grant31-Jan-24 21:18
mvaGraeme_Grant31-Jan-24 21:18 
GeneralRe: Source Generators in C# and TDD misadventure time Pin
honey the codewitch1-Feb-24 5:58
mvahoney the codewitch1-Feb-24 5:58 
GeneralRe: Source Generators in C# and TDD misadventure time Pin
Graeme_Grant1-Feb-24 8:31
mvaGraeme_Grant1-Feb-24 8:31 
GeneralCommand line fun in .NET Pin
honey the codewitch27-Jan-24 7:10
mvahoney the codewitch27-Jan-24 7:10 
GeneralRe: Command line fun in .NET Pin
PIEBALDconsult27-Jan-24 7:24
mvePIEBALDconsult27-Jan-24 7:24 
GeneralRe: Command line fun in .NET Pin
honey the codewitch27-Jan-24 7:37
mvahoney the codewitch27-Jan-24 7:37 
GeneralMicrosoft example includes obsolete code: Why? Pin
raddevus25-Jan-24 2:15
mvaraddevus25-Jan-24 2:15 
GeneralRe: Microsoft example includes obsolete code: Why? Pin
Bruno van Dooren25-Jan-24 5:28
mvaBruno van Dooren25-Jan-24 5:28 
GeneralRe: Microsoft example includes obsolete code: Why? Pin
raddevus25-Jan-24 8:50
mvaraddevus25-Jan-24 8:50 
GeneralFound an interesting algorithm Pin
honey the codewitch21-Jan-24 5:16
mvahoney the codewitch21-Jan-24 5:16 
GeneralRe: Found an interesting algorithm Pin
Nelek21-Jan-24 6:15
protectorNelek21-Jan-24 6:15 
GeneralRe: Found an interesting algorithm Pin
Greg Utas21-Jan-24 13:32
professionalGreg Utas21-Jan-24 13:32 
GeneralMicrosoft Regex Weirdness Pin
honey the codewitch7-Jan-24 4:17
mvahoney the codewitch7-Jan-24 4:17 
GeneralRe: Microsoft Regex Weirdness Pin
PIEBALDconsult7-Jan-24 5:30
mvePIEBALDconsult7-Jan-24 5:30 
GeneralRe: Microsoft Regex Weirdness Pin
k50547-Jan-24 7:34
mvek50547-Jan-24 7:34 
GeneralRe: Microsoft Regex Weirdness Pin
PIEBALDconsult7-Jan-24 7:59
mvePIEBALDconsult7-Jan-24 7:59 
GeneralRe: Microsoft Regex Weirdness Pin
Brisingr Aerowing7-Jan-24 8:40
professionalBrisingr Aerowing7-Jan-24 8:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.