Click here to Skip to main content
14,271,891 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.

 
GeneralKotlin: new(ish) syntax emerges Pin
raddevus15-Aug-19 10:36
mvaraddevus15-Aug-19 10:36 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
Marc Clifton15-Aug-19 11:19
protectorMarc Clifton15-Aug-19 11:19 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
raddevus15-Aug-19 12:29
mvaraddevus15-Aug-19 12:29 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
Ryan Peden15-Aug-19 11:32
staffRyan Peden15-Aug-19 11:32 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
raddevus15-Aug-19 12:31
mvaraddevus15-Aug-19 12:31 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
Member 798912215-Aug-19 20:43
memberMember 798912215-Aug-19 20:43 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
Stuart Dootson15-Aug-19 21:28
professionalStuart Dootson15-Aug-19 21:28 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
raddevus16-Aug-19 1:36
mvaraddevus16-Aug-19 1:36 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
grumpy_nl15-Aug-19 22:41
membergrumpy_nl15-Aug-19 22:41 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
raddevus16-Aug-19 1:37
mvaraddevus16-Aug-19 1:37 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
Richard Deeming16-Aug-19 1:36
mveRichard Deeming16-Aug-19 1:36 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
raddevus16-Aug-19 1:39
mvaraddevus16-Aug-19 1:39 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
englebart16-Aug-19 2:09
memberenglebart16-Aug-19 2:09 
GeneralRe: Kotlin: new(ish) syntax emerges Pin
obermd16-Aug-19 4:14
memberobermd16-Aug-19 4:14 
GeneralMemory Leak PinPopular
Bernhard Hiller21-Jul-19 23:17
memberBernhard Hiller21-Jul-19 23:17 
GeneralRe: Memory Leak Pin
Member 916705723-Jul-19 21:43
memberMember 916705723-Jul-19 21:43 
JokeRe: Memory Leak Pin
phil.o23-Jul-19 23:44
mvephil.o23-Jul-19 23:44 
GeneralRe: Memory Leak Pin
Gary Wheeler24-Jul-19 1:42
memberGary Wheeler24-Jul-19 1:42 
I once spent close to three months eliminating leaks from a C#/WPF application. There were basically two sources of leaks.

One were the false optimizations I had done as a matter of course due to my prior experience as a C++ programmer. I tended to cache resources, which caused them to leak event handlers and such. I also found that data bindings constructed in code rather than XAML leaked, and had to be cleared manually when you were done.

The second were the WPF flow document and page navigation mechanisms. Both of them leaked horribly - several megabytes per operation. I replaced them with HTML/WebBrowser (which leaks, but much less) and a home-grown navigation mechanism.

When I thought I had all of the leaks figured out, I ran the app over a four day weekend with a tiny test driver that navigated randomly through the UI every couple of seconds. When I came in, the app was still running and had peaked at 400MB, which wasn't bad considered it took up 275MB just starting up. All of the leaks were attributable to the WebBrowser control.

Many thanks to the folks at SciTech Software for .NET Memory Profiler.
Software Zen: delete this;

GeneralRe: Memory Leak Pin
MSBassSinger25-Jul-19 10:30
professionalMSBassSinger25-Jul-19 10:30 
GeneralRe: Memory Leak Pin
Matias Lopez30-Jul-19 9:41
memberMatias Lopez30-Jul-19 9:41 
GeneralYou learn something new every day Pin
Gary R. Wheeler11-Jul-19 14:48
memberGary R. Wheeler11-Jul-19 14:48 
GeneralRe: You learn something new every day Pin
RickZeeland11-Jul-19 20:08
mveRickZeeland11-Jul-19 20:08 
GeneralRe: You learn something new every day Pin
Gary R. Wheeler12-Jul-19 1:48
memberGary R. Wheeler12-Jul-19 1:48 
GeneralRe: You learn something new every day Pin
raddevus12-Jul-19 7:47
mvaraddevus12-Jul-19 7:47 
GeneralRe: You learn something new every day Pin
Gary R. Wheeler12-Jul-19 16:09
memberGary R. Wheeler12-Jul-19 16:09 

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.