SolutionYogi

New Jersey

solutionyogi.com

Age: 32

I am a developer, not a programmer. More on my website.

Jun
5
revised "Interface not implemented" when Returning Derived Type
deleted 9 characters in body
May
22
comment Is the new version of this code more difficult to read and understand than the original? How can it be improved?
@Leonid Oh, I see. But there are three drop downs. There is no way to avoid writing three lines of code to populate three drop downs.
May
22
revised Is the new version of this code more difficult to read and understand than the original? How can it be improved?
added 20 characters in body
May
22
revised Is the new version of this code more difficult to read and understand than the original? How can it be improved?
deleted 43 characters in body
May
22
comment Is the new version of this code more difficult to read and understand than the original? How can it be improved?
@Leonid Could you clarify what you mean by IsMemberOfCorporateDomain being repetitive?
May
22
comment Is the new version of this code more difficult to read and understand than the original? How can it be improved?
@JeffVanzella Personally, I like to use Code Contracts to mark methods as Null or Not Null returning so that static analysis can check for errors during compile time itself. Returning string.Empty won't help the static analyzer.
May
22
comment Is the new version of this code more difficult to read and understand than the original? How can it be improved?
@GiddyUpHorsey Sorry, I missed that NRE. I fixed that problem. BTW, I don't think the code listing is much larger. Mainly, I am doing additional check that principal.Identity and principal.Identity.Name is not null either because I don't see any guarantees in docs that they won't be null. Personally, if I had two choices, few more lines of code v/s readability, I will pick the later. Remember, you read code way more often than you write it. Additionally, I also care about how my stack trace looks like when an Exception occurs.
May
22
revised Is the new version of this code more difficult to read and understand than the original? How can it be improved?
added 22 characters in body
May
21
revised Is the new version of this code more difficult to read and understand than the original? How can it be improved?
added 2 characters in body
May
21
comment Is the new version of this code more difficult to read and understand than the original? How can it be improved?
@QuentinPradet Well, I figured out how to fix it. But thanks for checking! :)
May
21
revised Is the new version of this code more difficult to read and understand than the original? How can it be improved?
Getting code formatting to work.
May
21
comment Is the new version of this code more difficult to read and understand than the original? How can it be improved?
@QuentinPradet For some reason, I am not able to format the code anymore. Could you please help?
May
21
revised Is the new version of this code more difficult to read and understand than the original? How can it be improved?
added 692 characters in body
May
21
awarded Teacher
May
21
awarded Editor
May
21
revised Is the new version of this code more difficult to read and understand than the original? How can it be improved?
added 100 characters in body
May
21
answered Is the new version of this code more difficult to read and understand than the original? How can it be improved?
May
21
comment Is the new version of this code more difficult to read and understand than the original? How can it be improved?
Here's how I would do it: codereview.stackexchange.com/a/26435/4405
May
21
comment Is the new version of this code more difficult to read and understand than the original? How can it be improved?
+100. This is what self documenting code is. The advantages of this approach: 1. Now you know the 'semantics' of the code without having to read the actual code. 2. If for some reason there is a bug in the function and it throws an Exception, the last function in stack trace will be 'IsMemberOfCorporateDomain'. It immediately makes it clear about what went wrong. 3. Helps tremendously when reading the code. Let's me get to the meat of the program i.e. updating the drop down lists.
May
16
comment Is it subjective to ask about why something wasn't implemented in the language?
And if you want to hear the same thing from Richard Feynman's mouth: youtube.com/watch?v=wMFPe-DwULM
1 2 3 4 5