|
Right, so one should always write it up as if the culprit is "the senior design guru".
|
|
|
|
|
|
I would tend to agree with this
|
|
|
|
|
Oh, it doesn't matter. With such efforts toward 'extra perfection', a brilliant career in management is waiting for the guy.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
That was the intention of his remarks.
Greetings from Germany
|
|
|
|
|
Well said - my rule for juniors is always to praise in public and critique in private (note - critique and not criticize).
|
|
|
|
|
Pete O'Hanlon wrote: my rule for juniors is always to praise in public and critique in private (note - critique and not criticize).
Sounds to me like your a down to earth guy.
There is nothing worse than some prick who constantly humiliates their employee's in public (no matter what field their working in).
|
|
|
|
|
MarkBrock wrote:
There is nothing worse than some prick who constantly humiliates their employee's in public (no matter what field their working in).
It's only good business sense. I'd rather I had a happy member of staff who's had a chance to improve than somebody who I've p!ssed off and who's just going to be resentful. I don't want to be a Pointy Haired Boss.
|
|
|
|
|
But this costs execution time. And not to ferget what consequneces statement "may be". First selecting "nCategoryID" and create a nice temporary table and than run "nProductID" and now last but not least select the ID.
I would compare the complete againt the short mode and look. In greater databases strang things can happens...
Greetings from Germany
|
|
|
|
|
I keep note of this next time your junior developer is up for a performance review
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
"Lasciate ogni speranza o voi ch'entrate"
Dante Alighieri
<br />
private double m_EdgeDim;<br />
<br />
public double EdgeDim<br />
{<br />
set { m_EdgeDim = value; }<br />
}<br />
Don't you really want to see what you have put?
****************************
Strong congruence
for strong people;
with a compatible behaviour.
For a semantical way of life.
|
|
|
|
|
I don't get your point: a write-only property appears perfectly reasonable to me.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Marcello Faga wrote: Don't you really want to see what you have put?
No, and you shouldn't. It is called Encapsulation.
|
|
|
|
|
Good, i thought it was bad coding
****************************
Strong congruence
for strong people;
with a compatible behaviour.
For a semantical way of life.
|
|
|
|
|
Personally I would prefer a SetXXX(value) function instead of a write only property.
|
|
|
|
|
|
|
I understand the point of a write-only property, but I don't like the idea of really using it.
It's only going to confuse you or anyone else working with the code.
After all, the only one who really isn't supposed to know the value of the property is the user, so as long as it's not displayed to the user, it should be fine.
Using a write-only property will only make debugging and refactoring harder.
In my opinion, this is a bad practice.
|
|
|
|
|
I am writing the code for my first (proper) CP article and I did have one write only property.
I have a webcam class that I want to control to a T (via a VisionController class). On the webcam wizard the user selects the device and the wizard puts it in the class. I don't want ANY other portion of code interacting with it: so once the class is in I can get to it.
It forces me to create proper interfaces, and now that I have completed them I put the get {} in there .
|
|
|
|
|
What about putting it in the constructor? Or should it be modified?
J
James Simpson
Web Developer
imebgo@hotmail.com
P S - This is what part of the alphabet would look like if Q and R were eliminated Mitch Hedberg
|
|
|
|
|
Yeah I thought about putting it in the CTor, but the thing is that a wbcam wizard updates it, I am thinking I really should make a set method because it has a few side effects (rule of properties: if it doesn't have side effects make it a property, if it does make it a method).
He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Chineese Proverb]
Jonathan C Dickinson (C# Software Engineer)
|
|
|
|
|
Megidolaon wrote: Using a write-only property will only make debugging and refactoring harder.
Why?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
IMO, it's a bit of a hassle because you can only see the values while debugging and having them display in the Watch window.
A examples was provided where it might be a good idea to use a write only properties but I simply don't like the idea.
I haven't gotten into the situation where I'd need a write only property and if I ever got into such a situation, I'd re-think my design.
|
|
|
|
|
Megidolaon wrote: and if I ever got into such a situation, I'd re-think my design.
Absolutely, if you can't read it, it's not a property.
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighist
|
|
|
|
|
The only good example of a write-only property I've come across is with authentication. A class representing a user might have a username and a password. The password is required for authentication, but should not be generally accessible to the rest of an application. If you have a code-base which supports third-party plug-in authoring then you may not be able to guarantee all plug-in code is safe / responsible... In this case a write-only property for the class is a good plan if the user object is then shared.
Otherwise I would tend to agree with the use of a setter method... Might be a background thing, though - I know a lot of the VB folks like properties for class field setters/getters.
AJ
|
|
|
|