« first day (2693 days earlier)      last day (2284 days later) » 

2:11 AM
You might want to re-ask the question on Sotware Engineering stack exchange, in fact i believe such a question exists. Where did the notion of “one return only” come from?Jeremy Myers 24 secs ago
 
 
13 hours later…
jrh
3:08 PM
Random question -- after working with a project that uses some of the Microsoft official guidelines (and IMO, giving them an honest chance), I found that the programming style recommended made minor typos into hard to find runtime failures.
For reasons I can't fathom, even Bob Martin recommended this style (I've read clean code and there wasn't much of an explanation as to why this style was worth it).
I don't feel like I can in good faith recommend the style put forth by Microsoft, personally, and I kind of feel like I should at least warn people of what they need to be careful about if they want to use this style for C#. To make things worse, Intellisense even stupidly auto-completes to something that will cause an infinite recursion and a runtime StackOverflowException, on occasion.
I can't start a blog (I am forbidden by my company, they would consider it giving away "trade secrets" to talk about code publicly in any sense from what I heard from my manager), it's not a good fit for here, and it's too broad for SO
is there anything I can do to well, prevent the next guy from finding this stuff out the hard way?
 
jrh
3:25 PM
I guess I'm also a bit surprised that the style got adopted, seemingly without question, in a lot of languages, and nobody bothered to point out the problems to watch out for. Never really cared for it myself. It was better than the Hungarian notation used in win32, though.
 
jrh
3:46 PM
Also I'm not just looking to give a straight up recommendation; I'd like to find the reason why Bob Martin, and the Microsoft team too decided to recommend this to begin with, to make sure that there isn't a use case or benefit I overlooked. camelCase is old IIRC, much older than C#, that might be why I can't find any official statements on it.
 
 
2 hours later…
5:23 PM
@jrh I'm not very familiar with C#, but isn't the problem not the this., but that properties look like variables when they are actually method calls?
Note also that a lot of syntax was inherited from Java and C++, and it would have been against the goals of C# to use drastically different scoping rules. Java and (for unidiomatic code) C++ also have the x = x self-assignment in constructor problem.
 
5:42 PM
Hey guys anyone know of a site that i can put an endpoint url of a web service in and have it automatically build an interface to manually test it?
 
jrh
@amon you are correct, the problem is properties, which is why I'm especially surprised that Microsoft recommended a naming convention for C# that had variables (and parameters) named the same as member fields.
In Java, arguably, that naming convention also makes more sense, because it doesn't have properties
from a language design standpoint, I'm not sure properties (i.e., a method call that looks like a field) really add anything at all conceptually. There is a possible convenience feature, i.e., the ability to refactor properties to fields, and vice versa, but this works only in some cases (ref will break this)
What is particularly confusing is, the naming convention should have been designed after the reference source was implemented.
but the reference source went in the opposite direction, and used m_* for fields, which made me think at first that the recommended convention was sort of a "lessons learned" document. -- but MS never stopped using m_, at least as far as I can tell.
 
@jrh that's a heavy C++-ism, where the m_ prefix makes total sense. Isn't the CLR implemented in C++, i.e. the devs would have been strongly influenced by that? Changing the convention in the code base afterwards would only cause inconsistency
 
jrh
@amon you're right that CLR was implemented in C++, though they use other conventions than just m_
 
@jrh Properties do have their value. Besides their many benefits they are simply convenient, which you will appreciate after having written Java code like foo.setX(1 + foo.getX())
 
jrh
5:58 PM
in the reference source I remember seeing _field, m_field, and field; there's probably more, so consistency isn't really a priority
 
ok, then their coding style is total garbage and they should feel ashamed ^^
 
jrh
even on the C++ side of the CLR they were all over the place, IIRC
 
@IDrinkandIKnowThings I don't know such a tool, but you might have more success with your search if you can specify what kind of “interface” you're looking for. Like, setting headers and decoding JSON responses? So basically cURL, but in the browser and more pretty?
 
jrh
@amon just flipping around casually, WPF uses _field, s_staticfield, c_constant , winforms uses field and m_field, mscorelib uses m_field and field (sometimes even in the same class). Some classes use internal fields, I'm pretty sure they broke every one of their own publicly released coding standards somewhere in here. It puts things in perspective.
If I were maintaining this, what would worry me the most is some of the implicit linking they have between objects that don't really seem to have much to do with each other, though. I'd imagine that's very hard to test and code reliable behavior into for all possible conditions.
I think in one spot I found some commented out code and something like "Hey Joe implement this later", I got a kick out of that
 
6:24 PM
@amon i need function not pretty.
I want to see the data returned by the service. With out having to spend time to write the code to display it perferablly
and yes its a json service
WCF if that makes it easier
 

« first day (2693 days earlier)      last day (2284 days later) »