Worst C# code you've ever seen in production?

  • (4 Pages)
  • +
  • « First
  • 2
  • 3
  • 4

45 Replies - 31871 Views - Last Post: 18 June 2015 - 09:10 AM

#46 Curtis Rutland  Icon User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 5101
  • View blog
  • Posts: 9,283
  • Joined: 08-June 10

Re: Worst C# code you've ever seen in production?

Posted 18 June 2015 - 09:10 AM

Quote

I admit to writing highly optimized "smart" code early in my software development career


I think everyone's guilty of that at some point. I've gone through so many phases during my career. You can do all kinds of tricks to make code super short, but it's usually super difficult to grasp at a glance too. Usually difficult to debug too, since code like that often involves a ton of non-stored intermediate values that you can't get much visibility into. Which actually exposes some problems with Fluent-style code, because you can chain together half-a-dozen operations (and not be able to see the value returned from the 2nd item in the chain which is actually causing problems).

The best way I've found to deal with this kind of thing is to really try to stick to SOLID principles and try to design your components to be as self-contained and encapsulated as possible (while keeping the scope of the overall project in mind).
Was This Post Helpful? 0
  • +
  • -

  • (4 Pages)
  • +
  • « First
  • 2
  • 3
  • 4