Click here to Skip to main content
12,506,338 members (54,111 online)

Welcome to the Lounge

   

For lazing about and discussing anything in a software developer's life that takes your fancy except programming questions.

Technical discussions are encouraged, but click here to ask your programming question.

The Lounge is rated PG. If you're about to post something you wouldn't want your kid sister to read then don't post it. No flame wars, no abusive conduct, no programming questions and please don't post ads.
 
GeneralRe: Programming Question Pin
_Maxxx_16-Jan-13 17:09
member_Maxxx_16-Jan-13 17:09 
GeneralRe: Programming Question Pin
Mark_Wallace16-Jan-13 21:00
memberMark_Wallace16-Jan-13 21:00 
GeneralRe: Programming Question Pin
Nagy Vilmos16-Jan-13 22:15
memberNagy Vilmos16-Jan-13 22:15 
GeneralRe: Programming Question Pin
M Towler17-Jan-13 22:18
memberM Towler17-Jan-13 22:18 
GeneralRe: Programming Question Pin
greldak17-Jan-13 22:32
membergreldak17-Jan-13 22:32 
GeneralRe: Programming Question Pin
M Towler18-Jan-13 0:27
memberM Towler18-Jan-13 0:27 
GeneralRe: Programming Question Pin
liordino18-Jan-13 1:29
memberliordino18-Jan-13 1:29 
GeneralRe: Programming Question Pin
patbob18-Jan-13 5:53
memberpatbob18-Jan-13 5:53 
greldak wrote:
That comment adds meaning to the code - it tells me that the rate is obtained from a service as opposed to being determined within the function.

Actually, that's a poor comment. It tells you about what the GetTaxRate() function is doing.. something this function has no control over nor should it care. What if tomorrow, GetTaxRate() were reimplemented to get a tax rate some other way? Now, at best, the comment here is misleading. At worst, if the remainder of this function depends on that tax rate having been looked up in some service, it will break.

So, since the source of the tax rate is unimportant to the code written here, the comment should really read:
// Get the tax rate

And how is that more helpful than the code itself:
double taxRate = GetTaxRate();

Like you suggested, if its important that the tax rate is fetched from a service, then the code should read:
double taxRate = GetTaxRateFromAppropriateService();

Which still probably doesn't need a comment here because what an "appropriate" service is, is defined within GetTaxRateFromAppropriateService().
We can program with only 1's, but if all you've got are zeros, you've got nothing.

GeneralRe: Programming Question Pin
JackDingler18-Jan-13 6:52
memberJackDingler18-Jan-13 6:52 
GeneralRe: Programming Question Pin
CHill6018-Jan-13 1:28
memberCHill6018-Jan-13 1:28 
GeneralRe: Programming Question Pin
John Atten18-Jan-13 2:32
memberJohn Atten18-Jan-13 2:32 
GeneralRe: Programming Question Pin
jrscherer18-Jan-13 4:08
memberjrscherer18-Jan-13 4:08 
GeneralRe: Programming Question Pin
jharano18-Jan-13 4:46
memberjharano18-Jan-13 4:46 
GeneralRe: Programming Question Pin
Florin Jurcovici18-Jan-13 19:06
memberFlorin Jurcovici18-Jan-13 19:06 
GeneralRe: Programming Question Pin
Klaus-Werner Konrad24-Jan-13 1:56
memberKlaus-Werner Konrad24-Jan-13 1:56 
GeneralRe: Programming Question Pin
_Maxxx_24-Jan-13 2:10
member_Maxxx_24-Jan-13 2:10 
GeneralRe: Programming Question Pin
PIEBALDconsult16-Jan-13 17:09
memberPIEBALDconsult16-Jan-13 17:09 
GeneralRe: Programming Question Pin
_Maxxx_16-Jan-13 17:20
member_Maxxx_16-Jan-13 17:20 
GeneralRe: Programming Question Pin
PIEBALDconsult16-Jan-13 17:23
memberPIEBALDconsult16-Jan-13 17:23 
GeneralRe: Programming Question Pin
ahmed zahmed17-Jan-13 5:12
memberahmed zahmed17-Jan-13 5:12 
JokeRe: Programming Question Pin
Harry Neethling17-Jan-13 19:52
memberHarry Neethling17-Jan-13 19:52 
GeneralRe: Programming Question Pin
Chris Maunder16-Jan-13 17:44
adminChris Maunder16-Jan-13 17:44 
GeneralRe: Programming Question Pin
Brisingr Aerowing17-Jan-13 1:28
memberBrisingr Aerowing17-Jan-13 1:28 
GeneralRe: Programming Question Pin
jharano18-Jan-13 4:49
memberjharano18-Jan-13 4:49 
GeneralRe: Programming Question Pin
gggustafson18-Jan-13 3:58
membergggustafson18-Jan-13 3:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.160927.1 | Last Updated 28 Sep 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid