Skip to content

The Weird and The Wonderful

It was the best of code, it was the worst of code. Coding Horrors, Worst Practices, and flashes of brilliance

This category can be followed from the open social web via the handle the-weird-and-the-wonderful@forum.codeproject.com

1.8k Topics 20.7k Posts
  • Oh, that ol' Cthulhu sure is sneaky...

    help csharp html winforms com
    11
    0 Votes
    11 Posts
    0 Views
    B
    A quick look at the HAP source code and it seems they parse it character by character. I guess that's why it was so slow (it spent over three minutes 'parsing') when I tested it on a 1298 line HTML file (I can't remember where I found that file). AngleSharp parsed the same file much faster (in a few seconds). What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
  • Intellisense Strikes Again

    visual-studio
    20
    0 Votes
    20 Posts
    1 Views
    Richard DeemingR
    Or, with C# 6: public int Number { get; } = 42; // Or: public int Number { get; } public YourClass() { Number = 42; } :) "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • Style Guide for Obfuscation?

    tools help tutorial question
    7
    0 Votes
    7 Posts
    0 Views
    N
    Strictly speaking, there is no need for a compiler warning here really. It's well defined C# language behavior. Also, nothing's overwriting anything here. You declare a local and use the local. It has the same name as a member, but that's not the compiler's problem. That said, code analysis would catch this. See CA1500: Variable names should not match field names[^] Regards, Nish Website: www.voidnish.com Blog: voidnish.wordpress.com
  • Is this bad?

    question
    3
    0 Votes
    3 Posts
    0 Views
    N
    It may be cleaner to write the printer interaction in a C++ library and then export simpler functions that are called from C#, or even a very thin C++/CLI wrapper. Regards, Nish Website: www.voidnish.com Blog: voidnish.wordpress.com
  • testing 1.2.3.

    com testing beta-testing
    3
    0 Votes
    3 Posts
    0 Views
    R
    F-ES Sitecore wrote: I used to work with Tyson. Is that a euphenism? "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.
  • From this week's mobile newsletter

    question
    2
    0 Votes
    2 Posts
    0 Views
    F
    Well a lot of people use twitter with their backend...
  • tricky C# literals

    csharp learning
    13
    0 Votes
    13 Posts
    1 Views
    D
    Strange - C++ does and as far as I remember C# is much more picky when it comes to warnings. To be clear I usually compile with Visual Studio 6 and the last C# I used is that of VS2008. GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++*      Weapons extension: ma- k++ F+2 X If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver "When you have eliminated the JavaScript, whatever remains must be an empty page." -- Mike Hankey "just eat it, eat it"."They're out to mold, better eat while you can" -- HobbyProggy
  • Visual Studio 2015 error message

    csharp asp-net visual-studio com help
    6
    0 Votes
    6 Posts
    0 Views
    K
    Are you crazy testing the actual version of a Software from M$? :rolleyes: Press F1 for help or google it. Greetings from Germany
  • One of my own....

    10
    0 Votes
    10 Posts
    0 Views
    D
    I think "Option Strict" would pick that up alright. But I think the same rule applies to coding as parenting - if the child is already 5 years old it is way too late to start getting strict ;-)
  • 0 Votes
    4 Posts
    0 Views
    D
    Note that this only works if T has an explicit implementation of ICloneable. Otherwise, Clone() will call the instance method and not the extension method. And you don't need the cast to ICloneable. return (T)obj.Clone(); will do.
  • 0 Votes
    8 Posts
    2 Views
    I
    He/she forgot to mention that this is about setting the baudrate.
  • Unique function name. Globally.

    20
    0 Votes
    20 Posts
    1 Views
    R
    arrays of 16 bit integers to store strings and bit shifting and masking to access individual characters. Always fun
  • DFA code generation

    csharp ai-coding
    9
    0 Votes
    9 Posts
    1 Views
    D
    It's not wrong as such, but using it breaks control flow (such as gotoing out of a loop, or worse, into another loop) and can contribute to maintenance issues and general spaghetti code. Obviously maintenance isn't really an issue for autogenerated code - as long as you have the tool that generates it whenever you are modifying the source file that creates it, but it is just offensive to one's sensibilities to look at modern code full of goto statements.
  • Windows 10 ... slow burn.

    com hardware help question
    8
    0 Votes
    8 Posts
    0 Views
    L
    StampedePress wrote: I'm running Fedora 23 on my other laptop ..but you had to try Windows :rolleyes: A low-level format of the disc will remove Windows, after that you can install OS :) Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
  • Why name things sensibly, when you could also not?

    css help question
    11
    0 Votes
    11 Posts
    2 Views
    Z
    What if he already had one? :laugh:
  • I was looking for the Hall of Shame

    cloud
    8
    0 Votes
    8 Posts
    0 Views
    B
    :cool: What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
  • "...using the best programming practice..." yes sure

    hardware help
    13
    0 Votes
    13 Posts
    1 Views
    P
    I didn't try to optimise, just to make it easier to read. Patrice “Everything should be made as simple as possible, but no simpler.” Albert Einstein
  • I'm guessing there are two unit tests for this .... ?

    question
    10
    0 Votes
    10 Posts
    0 Views
    R
    Makes sense if the only valid input is JUL or SEP
  • I feel so dirty

    tools help question
    10
    0 Votes
    10 Posts
    0 Views
    X
    What if locale is not english TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> ----------------------------------------------- 128 bit encrypted signature, crack if you can
  • 0 Votes
    1 Posts
    0 Views
    No one has replied