Buying Options
.NET Gotchas
Print $39.95
Add to Cart
Safari Books Online
Add to Cart
What is this?
Print £30.50
Add to Cart
What is this?
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
  1. Chapter 1 CLR/Framework Gotchas

    1. GOTCHA #1 Type alias size doesn't match what you're familiar with

    2. GOTCHA #2 struct and class differ in behavior

    3. GOTCHA #3 Returning value types from a method/property is risky

    4. GOTCHA #4 You can't force calls to your value-type constructors

    5. GOTCHA #5 String concatenation is expensive

    6. GOTCHA #6 Exceptions may go unhandled

    7. GOTCHA #7 Uninitialized event handlers aren't treated gracefully

    8. GOTCHA #8 Division operation isn't consistent between types

    9. GOTCHA #9 Typeless ArrayList isn't type-safe

    10. GOTCHA #10 Type.GetType() may not locate all types

    11. GOTCHA #11 Public key reported by sn.exe is inconsistent

  2. Chapter 2 Visual Studio and Compiler Gotchas

    1. GOTCHA #12 Compiler warnings may not be benign

    2. GOTCHA #13 Ordering of catch processing isn't consist across languages

    3. GOTCHA #14 Type.GetType() might fail at run-time

    4. GOTCHA #15 rethrow isn't consistent

    5. GOTCHA #16 Default of Option Strict (off) isn't good

    6. GOTCHA #17 Versioning may lead to Serialization headaches

    7. GOTCHA #18 Creating Web apps can be painful

    8. GOTCHA #19 Naming XML documentation for IntelliSense support isn't intuitive

  3. Chapter 3 Language and API Gotchas

    1. GOTCHA #20 Singleton isn't guaranteed process-wide

    2. GOTCHA #21 Default performance of Data.ReadXML Data.ReadXML Data.ReadXML

    3. GOTCHA #22 enum lacks type-safety

    4. GOTCHA #23 Copy Constructor hampers exensibility

    5. GOTCHA #24 Clone() has limitations

    6. GOTCHA #25 Access to static/Shared C# code examples Shared members isn't enforced consistently

    7. GOTCHA #26 Details of exception may be hidden

    8. GOTCHA #27 Object initialization sequence isn't consistent

    9. GOTCHA #28 Polymorphism kicks in prematurely

    10. GOTCHA #29 Unit testing private methods testing private methods testing private methods

  4. Chapter 4 Language Interoperability Gotchas

    1. GOTCHA #30 Common Language Specification Compliance isn't the default

    2. GOTCHA #31 Optional parameters break interoperability

    3. GOTCHA #32 Mixing case between class members breaks interoperability

    4. GOTCHA #33 Name collision with keywords breaks interoperability

    5. GOTCHA #34 Defining an array isn't consistent

  5. Chapter 5 Garbage Collection Gotchas

    1. GOTCHA #35 Writing Finalize() is rarely a good idea

    2. GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc

    3. GOTCHA #37 Rules to invoke base.Finalize() aren't consistent

    4. GOTCHA #38 Depending on Finalize() can tie up critical resources

    5. GOTCHA #39 Using Finalize() on disposed objects is costly

    6. GOTCHA #40 Implementing IDisposable isn't enough

    7. GOTCHA #41 Using the Dispose Design Pattern doesn't guarantee cleanup

  6. Chapter 6 Inheritance and Polymorphism Gotchas

    1. GOTCHA #42 Runtime Type Identification can hurt extensibility

    2. GOTCHA #43 Using new/shadows causes "hideous hiding"

    3. GOTCHA #44 Compilers are lenient toward forgotten override/overrides

    4. GOTCHA #45 Compilers lean toward hiding virtual methods

    5. GOTCHA #46 Exception handling can break polymorphism

    6. GOTCHA #47 Signature mismatches can lead to method hiding

  7. Chapter 7 Multithreading Gotchas

    1. GOTCHA #48 The Thread class Thread class Thread class

    2. GOTCHA #49 Foreground threads may prevent a program from terminating

    3. GOTCHA #50 Background threads don't terminate gracefully

    4. GOTCHA #51 Interrupt () kicks in only when a thread is blocked

    5. GOTCHA #52 ThreadAbortException—a hot potato

    6. GOTCHA #53 Environment.Exit() brings down the CLR

    7. GOTCHA #54 ResetAbort() may lead to surprises

    8. GOTCHA #55 Abort() takes time to clean up

    9. GOTCHA #56 Calling Type.GetType() may not return what you expect

    10. GOTCHA #57 Locking on globally visible objects is too sweeping

    11. GOTCHA #58 Threads from the thread pool are scarce

    12. GOTCHA #59 Threads invoked using delegates behave like background threads

    13. GOTCHA #60 Passing parameters threads parameters to threads is tricky

    14. GOTCHA #61 Exceptions thrown from threads in the pool are lost exceptions lost

    15. GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous

    16. GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls

    17. GOTCHA #64 Raising events lacks thread-safety

  8. Chapter 8 COM-Interop and Enterprise Services Gotchas

    1. GOTCHA #65 Release of COM object is confusing

    2. GOTCHA #66 Using interface pointers after calling ReleaseComObject() will fail

    3. GOTCHA #67 Cross-apartment calls are expensive

    4. GOTCHA #68 Default apartment of main thread is inconsistent across languages

    5. GOTCHA #69 STAThread attribute may have no effect on your methods

    6. GOTCHA #70 Spattering access to COM components makes code hard to maintain

    7. GOTCHA #71 Auto-generating GUID generating GUID for your classes leads to versioning woes

    8. GOTCHA #72 All but one of the ClassInterface options are ineffective

    9. GOTCHA #73 Simply tur ning the switch for COM interop is dangerous

    10. GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003

    11. GOTCHA #75 AutoComplete comes with undesirable side effects

  1. Appendix A Resources

    1. Bibliography

    2. On the Web

  2. Colophon

View Full Table of Contents
Product Details
Title:
.NET Gotchas
By:
Venkat Subramaniam
Publisher:
O'Reilly Media
Formats:
  • Print
  • Safari Books Online
Print Release:
May 2005
Pages:
396
Print ISBN:
978-0-596-00909-0
| ISBN 10:
0-596-00909-7
Customer Reviews
About the Author
  1. Venkat Subramaniam

    Dr. Venkat Subramaniam (venkats@agiledeveloper.com) is the founder of Agile Developer, Inc. (a software training, mentoring and development firm), and a co-founder of DuraSoft. Working with .NET since its Beta 2 pre-release, he's used the platform extensively on commercial projects for his clients. Venkat offers several courses on developing applications using .NET, and has trained and mentored more than 3,000 software developers in the US and Europe. A frequent speaker at software development conferences, he is also an adjunct professor for the practice of computer science at University of Houston, and teaches at Rice University's School for Continuing Studies. Venkat holds a BS in Computer Engineering, an MS in Electrical Engineering, and PhD in Computer Science. He is recipient of the 2004 UH Computer Science Department Teaching Excellence award.

    View Venkat Subramaniam's full profile page.

  • Book cover of .NET Gotchas