Using tab in java

Discussion in 'OT Technology' started by vipergts24, Apr 16, 2007.

  1. vipergts24

    vipergts24 New Member

    Joined:
    Mar 10, 2005
    Messages:
    223
    Likes Received:
    0
    Location:
    Zomgland
    I haven't programmed in java recently but my roommate is programming with it now and i mentioned to him not to use the tab key (only white spaces) or else he may have a compiler issue. This was info was relayed to me by my professor who kidna made a big deal about it but I can't seem to remember why it would matter anyways. Can anyone confirm this? It makes sense if someone wasn't using a correct text editor and there word processor jumbled up the code due to functions like tab/end line etc. If anyone knows a bit about this i'd appreciate it so i can relay the info back to him. thanks
     
  2. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    I *always* use tab. I couldn't imagine using the space bar to indent code. So fawking lame. But any decent editor won't have a problem with tabs.
     
  3. vipergts24

    vipergts24 New Member

    Joined:
    Mar 10, 2005
    Messages:
    223
    Likes Received:
    0
    Location:
    Zomgland
    Yeah i agree. I used netbeans which converted tabs automatically to a default amount of spacing.

    does anyone have any confirmation on whether tabbing could be a problem on a point that i'm missing?
     
  4. gnp

    gnp New Member

    Joined:
    Mar 11, 2007
    Messages:
    280
    Likes Received:
    0
    in the bad old days c compilers were pickier....also if using a different code page....
     
  5. Chau

    Chau if i wanted to kill you, i would've come in here s

    Joined:
    May 30, 2000
    Messages:
    95,448
    Likes Received:
    0
    Location:
    CTU
    spaces > tabs
     
  6. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    I fixed that for you, you silly dyslexic llama
     
  7. skinjob

    skinjob Active Member

    Joined:
    Jan 6, 2001
    Messages:
    2,337
    Likes Received:
    0
    Location:
    Aztlán
    Don't know about any compiler issues. But, given the academic setting and the probability that there is a human reading a bunch of code, I can see why there would be a preference for spaces.
     
  8. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    I disagree. I would think tabs would be preferred for readability.
     
  9. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Right, because it's fun to have to insert/delete 8x as many characters to get the indentation you want.
     
  10. skinjob

    skinjob Active Member

    Joined:
    Jan 6, 2001
    Messages:
    2,337
    Likes Received:
    0
    Location:
    Aztlán
    Spaces will most likely guarantee that the reader sees the formatting intended by the writer. Tabs only work if the reader sets the same tab stops.
     
  11. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    um, no.
     
  12. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    well...he is right, technically, but I don't think I've seen an editor in a long time that doesn't have a default TAB stop of 8 spaces.
     
  13. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    regardless if it's 2, 3, 8, 7, or 11ty billion... a tab is a tab. Everything is properly aligned if you conform to blocks.
     
  14. CyberBullets

    CyberBullets I reach to the sky, and call out your name. If I c

    Joined:
    Nov 13, 2001
    Messages:
    11,865
    Likes Received:
    0
    Location:
    BC, Canada/Stockholm, Sweden
    tabs? spaces? man those are so old! i write all my code on 1 giant line! HA! Teach those profs who assigned me homework!

    And for the record tabs > spaces.
     
  15. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    Spaces vs. tabs has been flamewarred for almost as long as vim vs. emacs. I like spaces, myself, but I would never indent using the space bar :)ugh: ).
     
  16. CyberBullets

    CyberBullets I reach to the sky, and call out your name. If I c

    Joined:
    Nov 13, 2001
    Messages:
    11,865
    Likes Received:
    0
    Location:
    BC, Canada/Stockholm, Sweden
    VI ftw!!! :mamoru: :greddy:
     
  17. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    Emacs FTW :mamoru: :gfight:

    Also, Java sucks.
     
  18. skinjob

    skinjob Active Member

    Joined:
    Jan 6, 2001
    Messages:
    2,337
    Likes Received:
    0
    Location:
    Aztlán
    With regard to human readability, you still have to consider page width. Word-wrapping sucks when it's applied to code, and an unreasonable amount of sideways scrolling when viewing code on screen sucks too.
     
  19. skinjob

    skinjob Active Member

    Joined:
    Jan 6, 2001
    Messages:
    2,337
    Likes Received:
    0
    Location:
    Aztlán
    I :love: Vi
     
  20. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Who the hell uses word-wrapping in a code editor? And side-scrolling is only necessary when troubleshooting those long lines of code; in most cases, a glance at the first half, or first 2/3 of the line is enough to make it clear what the code does.

    Oh, and Notepad FTW.
     
  21. gnp

    gnp New Member

    Joined:
    Mar 11, 2007
    Messages:
    280
    Likes Received:
    0
    notepad ++ ftw ;)
     
  22. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    I use hard-wrapping, if you count that as word-wrap. 80 character lines ftw.
     
  23. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    print landscape :wavey:
     

Share This Page