This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
    Bookmark Topic Watch 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst
  • Mark post as helpful
  • send pies
  • Report post to moderator
If you're seeing this page, it's probably because you've put excessively long lines inside Code Tags.

And this applies to regular Java code AND comments.

For starters, it's bad practice. Forcing people to look at extremely long lines is just as bad as crowding all your code together, using excessively long (or short) names, or not indenting properly.

Secondly, it messes up the window formatting here, making threads hard to read; so you're basically shooting yourself in the foot. Making code easy for others to read will get you your answers quicker.

In the olden days, coding sheets were 80 characters long, and it's still a good rule of thumb to follow; so if you find you're writing lines longer than that, break them up.

In some cases this may mean breaking up long Strings into manageable pieces and concatenating them with the '+' operator, but please remember to do it.

Also:

  • Don't "Quote" code with long lines in it - This has exactly the same effect as the original bad code, and makes it doubly difficult to clean up the thread since now two people are involved.
  • Don't use TABs for indentation - They are interpreted differently on different systems, and usually create excessive space. 2-4 spaces/indent is generally preferable.
  • Don't simply 'cut and paste' code - At least not without checking what it's going to look like BEFORE you post it.


  • Indeed, you should always use the 'Preview' button to check what you write before you post it.

    Now, we suggest you take another look at the UseCodeTags page ... and read it carefully.


    HowToAskQuestionsOnJavaRanch

    CategoryWinston
     
    I can't beleive you just said that. Now I need to calm down with this tiny ad:
    RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
    https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
      Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!