c# Programming Glossary: bad
Should Usings be inside or outside the namespace http://stackoverflow.com/questions/125319/should-usings-be-inside-or-outside-the-namespace and all is well. Some would argue that Math might be a bad name for a user defined class since there's already one in System..
What are the pros and cons to keeping SQL in Stored Procs versus Code http://stackoverflow.com/questions/15142/what-are-the-pros-and-cons-to-keeping-sql-in-stored-procs-versus-code application Agreed which is why storedprocs are a bad thing. It's much easier to refactor and decompose break into..
Multiple Inheritance in C# http://stackoverflow.com/questions/178333/multiple-inheritance-in-c-sharp Inheritance in C# Since multiple inheritance is bad it makes the source more complicated C# does not provide such.. share improve this question Since multiple inheritance is bad it makes the source more complicated C# does not provide such..
Why is lock(this) {…} bad? http://stackoverflow.com/questions/251391/why-is-lockthis-bad is lock this &hellip bad The MSDN documentation says that public class SomeObject public.. locking share improve this question It is bad form to use this in lock statements because it is generally.. be made otherwise the lock is allowed. This is why it's bad to use strings as the keys in lock statements since they are..
how can you easily check if access is denied for a file in .NET? http://stackoverflow.com/questions/265953/how-can-you-easily-check-if-access-is-denied-for-a-file-in-net handle the exception if file permissions or existence are bad in spite of your check. Exception handling code is required..
Why does one often see “null != variable” instead of “variable != null” in C#? http://stackoverflow.com/questions/271561/why-does-one-often-see-null-variable-instead-of-variable-null-in-c It's a hold over from C. In C if you either use a bad compiler or don't have warnings turned up high enough this will..
Good or bad practice for Dialogs in wpf with MVVM? http://stackoverflow.com/questions/3801681/good-or-bad-practice-for-dialogs-in-wpf-with-mvvm or bad practice for Dialogs in wpf with MVVM I lately had the problem..
C# - List<T> or IList<T> http://stackoverflow.com/questions/400135/c-sharp-listt-or-ilistt over List in C# Related question Why is it considered bad to expose List T c# generics list ilist share improve this..
Casting vs using the 'as' keyword in the CLR http://stackoverflow.com/questions/496096/casting-vs-using-the-as-keyword-in-the-clr my program Hopefully this makes sense. Sorry for the bad example it is all I could think of... Update What is in general..
Use of Application.DoEvents() http://stackoverflow.com/questions/5181777/use-of-application-doevents against it but nobody ever really explains why it is bad . The same kind of wisdom as don't mutate a struct . Erm why.. and the language supports mutating a struct if that's so bad Same reason you shoot yourself in the foot if you don't do it.. code didn't stop it is still executing the loop. That's bad. Very very bad. There's more the user could click the same menu..
Developing Internet Explorer Extensions? http://stackoverflow.com/questions/5643819/developing-internet-explorer-extensions in C#. I went into it thinking it wouldn't be too bad. Wow. I was really wrong. So my question is does anyone here..
What is the best workaround for the WCF client `using` block issue? http://stackoverflow.com/questions/573872/what-is-the-best-workaround-for-the-wcf-client-using-block-issue orderService orderService.PlaceOrder request That's not bad but I don't think it's as expressive and easily understandable..
How to add a Timeout to Console.ReadLine()? http://stackoverflow.com/questions/57615/how-to-add-a-timeout-to-console-readline backspace up key for previous input . Function behaves badly when invoked multiple times spawning multiple threads many.. time is a horrible suck of resources which is especially bad in a multithreading scenario. If the busy wait is modified with..
How do I calculate someone's age in C#? http://stackoverflow.com/questions/9/how-do-i-calculate-someones-age-in-c
c#: difference between “System.Object” and “object” http://stackoverflow.com/questions/1017282/c-difference-between-system-object-and-object int ReadInt32 Good language neutral public int ReadInt Bad assumes C# meaning of int Note that the return type isn't really..
How to resize window using XNA http://stackoverflow.com/questions/11283294/how-to-resize-window-using-xna you cause the graphics device to be set up twice. Bad. To be honest I'm surprised that this causes such confusion...
how to use RSA to encrypt files (huge data) in C# http://stackoverflow.com/questions/1199058/how-to-use-rsa-to-encrypt-files-huge-data-in-c-sharp data 2 lines i get the exception CryptographicException Bad Length Create a new instance of RSACryptoServiceProvider. using..
Deserialize JSON object sent from Android app to WCF webservice http://stackoverflow.com/questions/13165533/deserialize-json-object-sent-from-android-app-to-wcf-webservice the request . And the status code is HTTP 1.1 400 Bad Request My Transaction class is defined in C# like this DataContract..
Encryption compatable between Android and C# http://stackoverflow.com/questions/2090765/encryption-compatable-between-android-and-c-sharp e Log.e TAG Illegal block size e return null catch BadPaddingException e Log.e TAG Bad padding e return null return.. size e return null catch BadPaddingException e Log.e TAG Bad padding e return null return encryptedData private byte encodeDigest..
Benefits of using the conditional ?: (ternary) operator http://stackoverflow.com/questions/3312786/benefits-of-using-the-conditional-ternary-operator sacrificing readability. Good example int result Check 1 0 Bad example int result FirstCheck 1 SecondCheck 1 ThirdCheck 1 0..
How to read a text file reversely with iterator in C# http://stackoverflow.com/questions/452902/how-to-read-a-text-file-reversely-with-iterator-in-c-sharp buffer firstCharPosition firstCharPosition Bad UTF 8 sequences could trigger this. For UTF 8 we should always..
C#: Throwing Custom Exception Best Practices http://stackoverflow.com/questions/4761216/c-throwing-custom-exception-best-practices class Foo DoSomething int param try if Something Bad violates business logic etc... throw new FooException Reason..... fall through class Foo DoSomething int param if Something Bad violates business logic etc... throw new FooException Reason.....
Entity Framework: Setting a Foreign Key Property http://stackoverflow.com/questions/480872/entity-framework-setting-a-foreign-key-property people. Good news MS will address the issue with .NET 4.0. Bad news for now or if you're stuck on 3.5 you have to do a little..
Casting vs using the 'as' keyword in the CLR http://stackoverflow.com/questions/496096/casting-vs-using-the-as-keyword-in-the-clr explained where it's worth using which. Don't do this Bad code checks type twice for no reason if randomObject is TargetType..
Large Switch statements: Bad OOP? http://stackoverflow.com/questions/505454/large-switch-statements-bad-oop Switch statements Bad OOP I've always been of the opinion that large switch statements..
Why does my C# client, POSTing to my WCF REST service, return (400) Bad Request? http://stackoverflow.com/questions/575893/why-does-my-c-sharp-client-posting-to-my-wcf-rest-service-return-400-bad-req my C# client POSTing to my WCF REST service return 400 Bad Request I'm trying to send a POST request to a simple WCF service.. to a simple WCF service I wrote but I keep getting a 400 Bad Request. I'm trying to send JSON data to the service. Can anyone..
Fixed point math in c#? http://stackoverflow.com/questions/605124/fixed-point-math-in-c F 0 F Abs F if F FInt.OneF throw new ArithmeticException Bad Asin Input F.ToDouble FInt f1 mul mul mul mul FInt.Create 145103..
Why Does my HttpWebRequest Return 400 Bad request? http://stackoverflow.com/questions/702079/why-does-my-httpwebrequest-return-400-bad-request Does my HttpWebRequest Return 400 Bad request The following code fails with a 400 bad request exception...
Large WCF web service request failing with (400) HTTP Bad Request http://stackoverflow.com/questions/784606/large-wcf-web-service-request-failing-with-400-http-bad-request WCF web service request failing with 400 HTTP Bad Request I've encountered this apparently common problem and.. However if I call the web service with 500 items I get the Bad Request error. Interestingly I've run Wireshark on the server.. The remote server returned an unexpected response 400 Bad Request. System.Net.WebException The remote server returned..
Releasing a unplugged virtual Serial Port http://stackoverflow.com/questions/9835881/releasing-a-unplugged-virtual-serial-port very little you can do with the hardware but unplug it. Bad Idea. Now you have two problems. share improve this answer..
MailSystem.Net Delete Message, IndexOnServer Property = 0 http://stackoverflow.com/questions/13160089/mailsystem-net-delete-message-indexonserver-property-0 store 0 flags.silent Deleted failed 121031084812790 BAD Error in IMAP command STORE Invalid messageset Here's my code..
What technique can protect a secret from a fully trusted user? http://stackoverflow.com/questions/2150912/what-technique-can-protect-a-secret-from-a-fully-trusted-user encrypt this message but someone has suggested this is A BAD IDEA. So I'm looking for alternatives how do you protect a piece..
In C#, wait on the mainthread while continuing to process UI updates? (.NET 2.0 CF) http://stackoverflow.com/questions/360789/in-c-wait-on-the-mainthread-while-continuing-to-process-ui-updates-net-2-0 is not designed to do that blocking the main thread is BAD it handles the messages from the OS . You don't have to block..
Who Disposes of an IDisposable public property? http://stackoverflow.com/questions/674879/who-disposes-of-an-idisposable-public-property container1.SomeObject container1.Dispose obj1.DoSomething BAD because obj1 has been disposed by container1. Example Two AContainer.. SomeObject obj2 new SomeObject container2.SomeObject obj2 BAD because the previous value of SomeObject not disposed. container2.Dispose.. not disposed. container2.Dispose obj2.DoSomething BAD because obj2 has been disposed by container2 which doesn't really..
.NET XML serialization gotchas? [closed] http://stackoverflow.com/questions/67959/net-xml-serialization-gotchas the ways to use or not use the BOM are almost the same BAD includes BOM XmlTextWriter wr new XmlTextWriter stream new System.Text.Encoding.UTF8..
|