cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Huang <Alex.Hu...@citrix.com>
Subject RE: Coding Convention Reminder
Date Wed, 03 Jul 2013 16:24:10 GMT
I think the coding convention did not cover these.  It's a good time to update the wiki for
python and javascript. 

--Alex

> -----Original Message-----
> From: Ian Duffy [mailto:ian@ianduffy.ie]
> Sent: Wednesday, July 3, 2013 1:49 AM
> To: dev@cloudstack.apache.org
> Subject: Re: Coding Convention Reminder
> 
> Any suggestions for formatting the Javascript files? The few I've looked at
> seem to be riddled with indentation errors and trailing whitespace. When I
> right click on them in eclipse and hit clean up I get the following error: "The
> resource is not on the include path of a javascript project"
> 
> Thanks!
> Ian
> 
> On 3 July 2013 07:36, Wido den Hollander <wido@widodh.nl> wrote:
> > On 07/03/2013 12:11 AM, Alex Huang wrote:
> >>
> >> I like to remind everyone to review our coding conventions.  Our
> >> coding conventions have been going all over the place recently.
> >> Please take a look.
> >>
> >>
> https://cwiki.apache.org/confluence/display/CLOUDSTACK/Coding+convent
> >> ions
> >>
> >> I also like to propose that we extend the 120 column limit to 180 columns.
> >>
> >
> > +1 on that.
> >
> > It's not only line length, but I also still see a lot of trailing
> > spaces, tabs and empty lines with spaces.
> >
> > I'm not using Eclipse (hate it), so I'm using Kate on my Ubuntu
> > desktop which I find great to work with, but that's also completely
> configurable.
> >
> > Wido
> >
> >
> >> I recently was reading the following code.  If it followed even our
> >> current coding conventions, this would have been 11 lines but it ends
> >> up to be 23 lines, more than doubled.  The whole file was like this.
> >> Just thinking about all the extra scrolling I have to do makes my cts
> >> act up.  We are in the 21st century and using wide screen lcd
> >> monitors.  Let's not format our code to fit 80 column amber text screens
> please!
> >>
> >> What's worse is I've found that some people are actively breaking
> >> existing source code to 80 columns, causing a bunch of unnecessary
> merge activities.
> >> On Eclipse, you can actually set all types of formatting rules.  I
> >> can send out my epf (eclipse preferences file) if you don't want to
> >> deal with the trouble.
> >>                              DiskOfferingVO diskOffering =
> >> _diskOfferingDao
> >>                                      .findById(vol.getDiskOfferingId());
> >>                              if (diskOffering.getUseLocalStorage()) {
> >>                                  if (s_logger.isDebugEnabled()) {
> >>                                      s_logger.debug("Local volume "
> >>                                              + vol
> >>                                              + " will be recreated on
> >> storage pool "
> >>                                              + assignedPool
> >>                                              + " assigned by
> >> deploymentPlanner");
> >>                                  }
> >>                                  VolumeTask task = new
> >> VolumeTask(VolumeTaskType.RECREATE, vol, null);
> >>                                  tasks.add(task);
> >>                              } else {
> >>                                  if (s_logger.isDebugEnabled()) {
> >>                                      s_logger.debug("Shared volume "
> >>                                              + vol
> >>                                              + " will be migrated on
> >> storage pool "
> >>                                              + assignedPool
> >>                                              + " assigned by
> >> deploymentPlanner");
> >>                                  }
> >>                                  VolumeTask task = new
> >> VolumeTask(VolumeTaskType.MIGRATE, vol, assignedPool);
> >>                                  tasks.add(task);
> >>                              }
> >>
> >> Please be mindful of my cts.  Thanks for caring about my health!  :)
> >>
> >> --Alex
> >>
> >
Mime
View raw message