Description
The ultimate guide for pain-free coding, .NET Gotchas from O'Reilly contains 75 common .NET programming pitfalls--and advice on how to avoid them. Now you can steer away from application performance problems, or tainted code that just doesn't work right. It's the ideal resource for .NET developers yearning for a more productive, stress-free existence.
Full Description
Table of Contents
-
Chapter 1 CLR/Framework Gotchas
-
GOTCHA #1 Type alias size doesn't match what you're familiar with
-
GOTCHA #2 struct and class differ in behavior
-
GOTCHA #3 Returning value types from a method/property is risky
-
GOTCHA #4 You can't force calls to your value-type constructors
-
GOTCHA #5 String concatenation is expensive
-
GOTCHA #6 Exceptions may go unhandled
-
GOTCHA #7 Uninitialized event handlers aren't treated gracefully
-
GOTCHA #8 Division operation isn't consistent between types
-
GOTCHA #9 Typeless ArrayList isn't type-safe
-
GOTCHA #10 Type.GetType() may not locate all types
-
GOTCHA #11 Public key reported by sn.exe is inconsistent
-
-
Chapter 2 Visual Studio and Compiler Gotchas
-
GOTCHA #12 Compiler warnings may not be benign
-
GOTCHA #13 Ordering of catch processing isn't consist across languages
-
GOTCHA #14 Type.GetType() might fail at run-time
-
GOTCHA #15 rethrow isn't consistent
-
GOTCHA #16 Default of Option Strict (off) isn't good
-
GOTCHA #17 Versioning may lead to Serialization headaches
-
GOTCHA #18 Creating Web apps can be painful
-
GOTCHA #19 Naming XML documentation for IntelliSense support isn't intuitive
-
-
Chapter 3 Language and API Gotchas
-
GOTCHA #20 Singleton isn't guaranteed process-wide
-
GOTCHA #21 Default performance of Data.ReadXML Data.ReadXML Data.ReadXML
-
GOTCHA #22 enum lacks type-safety
-
GOTCHA #23 Copy Constructor hampers exensibility
-
GOTCHA #24 Clone() has limitations
-
GOTCHA #25 Access to static/Shared C# code examples Shared members isn't enforced consistently
-
GOTCHA #26 Details of exception may be hidden
-
GOTCHA #27 Object initialization sequence isn't consistent
-
GOTCHA #28 Polymorphism kicks in prematurely
-
GOTCHA #29 Unit testing private methods testing private methods testing private methods
-
-
Chapter 4 Language Interoperability Gotchas
-
GOTCHA #30 Common Language Specification Compliance isn't the default
-
GOTCHA #31 Optional parameters break interoperability
-
GOTCHA #32 Mixing case between class members breaks interoperability
-
GOTCHA #33 Name collision with keywords breaks interoperability
-
GOTCHA #34 Defining an array isn't consistent
-
-
Chapter 5 Garbage Collection Gotchas
-
GOTCHA #35 Writing Finalize() is rarely a good idea
-
GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc
-
GOTCHA #37 Rules to invoke base.Finalize() aren't consistent
-
GOTCHA #38 Depending on Finalize() can tie up critical resources
-
GOTCHA #39 Using Finalize() on disposed objects is costly
-
GOTCHA #40 Implementing IDisposable isn't enough
-
GOTCHA #41 Using the Dispose Design Pattern doesn't guarantee cleanup
-
-
Chapter 6 Inheritance and Polymorphism Gotchas
-
GOTCHA #42 Runtime Type Identification can hurt extensibility
-
GOTCHA #43 Using new/shadows causes "hideous hiding"
-
GOTCHA #44 Compilers are lenient toward forgotten override/overrides
-
GOTCHA #45 Compilers lean toward hiding virtual methods
-
GOTCHA #46 Exception handling can break polymorphism
-
GOTCHA #47 Signature mismatches can lead to method hiding
-
-
Chapter 7 Multithreading Gotchas
-
GOTCHA #48 The Thread class Thread class Thread class
-
GOTCHA #49 Foreground threads may prevent a program from terminating
-
GOTCHA #50 Background threads don't terminate gracefully
-
GOTCHA #51 Interrupt () kicks in only when a thread is blocked
-
GOTCHA #52 ThreadAbortException—a hot potato
-
GOTCHA #53 Environment.Exit() brings down the CLR
-
GOTCHA #54 ResetAbort() may lead to surprises
-
GOTCHA #55 Abort() takes time to clean up
-
GOTCHA #56 Calling Type.GetType() may not return what you expect
-
GOTCHA #57 Locking on globally visible objects is too sweeping
-
GOTCHA #58 Threads from the thread pool are scarce
-
GOTCHA #59 Threads invoked using delegates behave like background threads
-
GOTCHA #60 Passing parameters threads parameters to threads is tricky
-
GOTCHA #61 Exceptions thrown from threads in the pool are lost exceptions lost
-
GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous
-
GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
-
GOTCHA #64 Raising events lacks thread-safety
-
-
Chapter 8 COM-Interop and Enterprise Services Gotchas
-
GOTCHA #65 Release of COM object is confusing
-
GOTCHA #66 Using interface pointers after calling ReleaseComObject() will fail
-
GOTCHA #67 Cross-apartment calls are expensive
-
GOTCHA #68 Default apartment of main thread is inconsistent across languages
-
GOTCHA #69 STAThread attribute may have no effect on your methods
-
GOTCHA #70 Spattering access to COM components makes code hard to maintain
-
GOTCHA #71 Auto-generating GUID generating GUID for your classes leads to versioning woes
-
GOTCHA #72 All but one of the ClassInterface options are ineffective
-
GOTCHA #73 Simply tur ning the switch for COM interop is dangerous
-
GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003
-
GOTCHA #75 AutoComplete comes with undesirable side effects
-
-
Appendix A Resources
-
Bibliography
-
On the Web
-
-
Colophon
Product Details
- Title:
- .NET Gotchas
- By:
- Venkat Subramaniam
- Publisher:
- O'Reilly Media
- Formats:
-
- Safari Books Online
- Print Release:
- May 2005
- Pages:
- 396
- Print ISBN:
- 978-0-596-00909-0
- | ISBN 10:
- 0-596-00909-7
Customer Reviews
