This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Spacing issue

 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am very confused on spacing issues. My code is below.

The nitpick was to inlude blank lines between declaring value and the following if statement. I was also told to include blank lines between return value and the following brace. In a previous program I was told not to include blank lines between initializing variable and an if statement and I cannot see a reason for including them after the return value. Would someone please explain when to use blank lines. I have read the style guide and it didn't address this. Thanks.
Matthew Phillips
 
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't speak for the nitpicker here, but I think that is a suggestion as opposed to a matter of something required. I don't beleive blank lines is mentioned in the style guide except to use them between methods and to space out large chuncks in methods.
However, it does make it more readable to have identifiers and if statements separated by a blank line. But I think that is a matter of preference.
Correct me if I am wrong.
Bill
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
spacing or blank lines?

"Spacing" refers to spaces on both sides of an identifier, (horizontally) on the same line, not between lines (vertically).

Bill's statements regarding blank lines are correct.
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I must have misunderstood your comments. When I saw that you added blank lines and wrote spacing I thought you meant for me to add blank lines. Disregard my submission. I will resubmit Leap today.
Matthew Phillips
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We nitpickers try to surround our comments with blank lines to make them more noticeable.
 
You've gotta fight it! Don't give in! Read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic