|
RobCroll wrote: I like the way they explicitly declare methods as public when the class is
implicitly internal.
I can't really see anything wrong with that
RobCroll wrote: if you want to pass, hand in your assignments
I have already got an A, but thanks for the offer
|
|
|
|
|
Kubajzz wrote: RobCroll wrote: I like the way they explicitly declare methods as public when the class is
implicitly internal.
I can't really see anything wrong with that
The methods are public which would suggest they are available to the world but the class is internal and only accessible within the assembly. Explicitly declaring the "Access Modifier" as public is misleading because it can only be private, internal or protected.
Congratulations on the A by the way.
"You get that on the big jobs."
|
|
|
|
|
Seems like a fine pratice to me. If the class is later changed to public, all the properties would then become visible outside the assembly. This may be the intention. There is also the case of when implementing an interface (the members would have to be public, even on an internal class). While neither of those appear to be the case here, I don't see a downside to making the members public.
|
|
|
|
|
If the assembly has more than just this internal class then the members should be public if you want the other classes in the same assembly to access them. Internal is assembly in scope, public is class in scope. Internal limits public access only to that assembly for that internally declared class, all other classes can still acess the internal class.
|
|
|
|
|
I know. My point was that if you change the class down the road (e.g., by changing it from internal to public) for whatever reason, then it may be advantageous if you had marked all the class members public in the first place (assuming your change of making the class public implies that you also want the members to be public once that change has been made).
|
|
|
|
|
And he should be shot for concatenating his strings...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
After x iterations of .NET it would be nice to have a constant for space String.Space or String.Character.Space . I guess you could encapsulate the statement getFName() but other than that, what is the problem?
"You get that on the big jobs."
|
|
|
|
|
It should be
return string.Format("{0} {1}", name, sname);
|
|
|
|
|
Got a citation for that? It would seem to me that string.Format is a lot heavier than concatenation, since it has to parse the format string, work out what the arguments are and then substitute them in.
Usually the advice is to use StringBuilder but for such a small example I don't see what's wrong with the concatenation, and Format seems worse.
|
|
|
|
|
|
Kubajzz wrote: - this piece of code was given to his students as a do-it-like-this example
Mhm... I have to admit, my coding style is a little bit Java-like... but my padawan and I agree on that... but to say "do-it-like-this" is a little bit... wow...
BTW: like your argumentation on this[]...
(yes|no|maybe)*
|
|
|
|
|
How else would students learn to deal with crappy code? When they graduate, the crappy teacher will just be replaced by a crappy boss and crappy colleagues
|
|
|
|
|
Thank god. you teacher knows that much stuff.
|
|
|
|
|
Properties man ... properties. Good lord.
Brad Barnhill
|
|
|
|
|
hey - i am going to make browser
if any one have the super code and trick to make an xcellent browser than send it to tarun3393@gmail.com
|
|
|
|
|
|
No doubt, a question like this deserves to be here in the hall of shame.
|
|
|
|
|
Ok... now we're reaching the level of absurdity
(yes|no|maybe)*
|
|
|
|
|
s_mon wrote: Ok... now we're reaching the level of absurdity
[Paradox] A programming question posted in the hall of shame and in a proper forum in one go? That case should be included in a forum guide above.
Greetings - Jacek
|
|
|
|
|
tarunbatra3393 wrote: hey - i am going to make browser
OK.
tarunbatra3393 wrote: if any one have the super code and trick
Well, I'll be the first to tell you something constructive: don't post your e-mail address here... you'll get ultra-spammed. You will receive the answers directly.
Anyway and
|
|
|
|
|
|
tarunbatra3393 wrote: hey - i am going to make browser if any one have the super code and trick to
make an xcellent browser than send it to tarun3393@gmail.com
I thought your'e gonna make one? Why do you need codes? :P
Good judgment comes from experience, and experience comes from bad judgment. Barry LePatner
|
|
|
|
|
At least you put it in the right category, for this is truly a "Hall of Shame" worthy request.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
A couple of years back, I was getting small "fill-in" jobs off Rent-A-Coder (now VWorker.com). One guy posted the following bid request:
"I want a website made. It must have all feature of Google and eBay. Shopping like Amazon would be good too. No time wasters."
And his bid limit for this task?
$250.
|
|
|
|
|
Some people are just clueless
|
|
|
|