Jump to content

Planet Bob

  • entries
    430
  • comments
    1,870
  • views
    659,797

The Checkstyle Terrorist

Cybergoth

580 views

Hi there!

 

In my company we're now forced to use checkstyle for java projects in Eclipse. Amongst the ~100 mostly totally stupid checks it does, is also one forcing brackets to reside on the end of a line, as in:

 

   if(bSomething) {
       doSomething();
   }

 

Few things I hate more :mad:

Here's my tried & tested workaround:

 

   if(bSomething
 ) {
       doSomething();
   }

 

:P

 

Greetings,

Manuel



4 Comments


Recommended Comments

SPIN (the high level language for the Propeller microcontroller) doesn't use braces - only horizontal spacing. i.e.

if bSomething1
 doif1true()
 doif1true()
 if bSomething2
   doif2true()
   doif2true()
 doif1true()
else
 doif1false()

Share this comment


Link to comment

I completely disagree (so SPIN should be my language :)). If you indent blocks, why wasting any space for brackets? If absolutely hate this kind of bloated coding. In the end you need a 30" LCD to see even a small code block.

Share this comment


Link to comment
I completely disagree (so SPIN should be my language ;)).

 

That or Visual Basic ;)

 

My workmate was cursing the whole day as well. He's using brackets to scope variables as in:

 

   {
       String str = "bla";
   }
   ...
   {
       String str = "blu";
   }

 

To avoid checkstyle errors he now "fixed" all those passages as in:

 

   if(true) {
       String str = "bla";
   }
   ...
   if(true) {
       String str = "blu";
   }

 

What a fucked up plugin... :)

Share this comment


Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...