Magic number...

Bernd Gehrmann bernd at physik.hu-berlin.de
Tue Mar 7 17:18:01 UTC 2000



On Mon, 6 Mar 2000, Ralf Nolden wrote:

> Bernd Gehrmann wrote:
> > 
> > On Mon, 6 Mar 2000, Ralf Nolden wrote:
> > 
> > >
> > > Hi all,
> > >
> > > for the records...we currently have:
> > >
> > > 93.667 lines of code (including comments)
> > > 17.784 lines of sgml documentation (english only)
> > > ---------
> > > does that make me write another 75.883 lines of documentation so
> > > everyone understands each line of code ?????
> > 
> > Perhaps it makes you throw out all the superfluous code
> > generated by Qt Architect ;-)
> Or by the dialogeditor ;-)
> I think it counts. Without that code, it wouldn´t run, would it ?

Sure it would run. Of the following code segment (arbritrarily taken from
KDevelop 1.1), 80% is simply completely superfluous bloat:

  apphelp = new QLabel( widget0, "apphelp" );  
  apphelp->setGeometry( 230, 330, 240, 90 );      
  apphelp->setMinimumSize( 0, 0 );          
  apphelp->setMaximumSize( 32767, 32767 );      
  apphelp->setFocusPolicy( QWidget::NoFocus );      
  apphelp->setBackgroundMode( QWidget::PaletteBackground ); 
  apphelp->setFontPropagation( QWidget::NoChildren );
  apphelp->setPalettePropagation( QWidget::NoChildren );   
  apphelp->setText( i18n("Label:") );   
  apphelp->setAlignment( 1313 );  
  apphelp->setMargin( -1 ); 

KDevelop's dialog editor is different, btw. It doesn't generate
code for setting properties to their default values (at least
normally).

Of course, with a decent library for persistent storing of
a GUI, like libglade or the Qt 3.0 stuff, one can compress
most simple dialogs to almost zero code size. Conclusio:
counting lines of code can be very senseless :-)

Bernd.





More information about the KDevelop-devel mailing list