<HTML>
<BODY>

<H1>Product review: SNiFF+ for Linux</H1>
<H4>ArticleCategory: [Es gibt verschiedene Artikel Kategorien]</H4>
Software Development
<H4>AuthorImage:[Ein Bild von Dir]</H4>
<IMG SRC="../../common/images/Guido-S.gif" ALT="[Photo of the Author]" HEIGHT=164 WIDTH=173>

<H4>TranslationInfo:[Author and translation history]</H4>
<P>original in en <A HREF="mailto:guido.socher@linuxfocus.org">Guido Socher</A></P>


<H4>AboutTheAuthor:[Eine kleine Biographie &uuml;ber den Autor]</H4>
<P>
Guido is a long time Linux fan.
His Linux home page can be found at 
<a href="http://www.oche.de/~bearix/g/">www.oche.de/~bearix/g/</a>.
</P>

<H4>Abstract:[Here you write a little summary]</H4>
SNiFF+ from takefive software is an Integrated Development
Environment available for Linux. Takefive offers a download version
free of charge at <a href="http://www.takefive.com/penguin">http://www.takefive.com/penguin</a>. The software reviewed here came from a sample CD and
seems identical with the download version. The restriction of both versions
it that they are limited to 200 files. This is a review of SNiFF+ version
3.2. It has been tested under Redhat Linux 6.0.

<H4>ArticleIllustration:[This is the title picture for your article]</H4>
<IMG SRC="../../common/images/article140/illustration140.gif" ALT="[Illustration]" HSPACE=10 HEIGHT=80 WIDTH=159>

<H4>ArticleBody:[The article body]</H4>

<h2>What is SNiFF+ ?</H2>

<p>SNiFF+ is an Integrated Development Environment for the Languages
C, C++, Java, IDL, Fortran77, Fortran90 and ADA. SNiFF+ gives you the 
possibility to visually understand your code. Users of other big 
operating systems may already be used to such development environments
and be very happy to see that such an IDE is available for Linux.
</p>
<p>
SNiFF+ and IDEs in general are best used with larger pieces of code and
in environments where you have to make changes to existing code which you
have not entirely written yourself. SNiFF+ supports also various version
control tools such as RCS, CVS, clearcase, etc... This makes it probabaly 
ideal for teamwork in larger projects.
</p>
<h2>Installation</H2>
<p>
SNiFF+ for Linux comes with an installation script. This script takes
you to a dialog mode. I had no problems using it. SNiFF+ is not available
in a packages format such as rpm or deb but this is not a problem as
SNiFF+ does not install across the entire file system. The script installs
everything below just one directory (I used /opt/sniff) and it is therefore
very easy to un-install later on. 
Below you see the start of the installation script with the different
UNIX platforms for which SNiFF+ is available.
</p>
<CENTER><TABLE BORDER=0 WIDTH="60%" BGCOLOR="#000000" >
<TR> 
<TD> 
<font color="#FFFFFF" size="-1" >
<br>&nbsp;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SNiFF+&nbsp;3.2&nbsp;installation&nbsp;procedure
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Copyright&nbsp;(c)&nbsp;1993-1999&nbsp;TakeFive&nbsp;Software&nbsp;GmbH.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;All&nbsp;rights&nbsp;reserved.
<br>&nbsp;
<br>&nbsp;Please&nbsp;select:
<br>&nbsp;
<br>&nbsp;&nbsp;&nbsp;[A]&nbsp;&nbsp;&nbsp;Install&nbsp;SNiFF+&nbsp;binaries
<br>&nbsp;&nbsp;&nbsp;[B]&nbsp;&nbsp;&nbsp;Install&nbsp;GNU&nbsp;binaries
<br>&nbsp;&nbsp;&nbsp;[C]&nbsp;&nbsp;&nbsp;Install&nbsp;FlexLM&nbsp;binaries
<br>&nbsp;
<br>&nbsp;&nbsp;&nbsp;[X]&nbsp;&nbsp;&nbsp;Exit&nbsp;installation
<br>&nbsp;
<br>&nbsp;Your&nbsp;selection:&nbsp;a
<br>&nbsp;
<br>&nbsp;
<br>&nbsp;SNiFF+&nbsp;can&nbsp;be&nbsp;installed&nbsp;for&nbsp;multiple&nbsp;platforms&nbsp;in&nbsp;one&nbsp;directory.&nbsp;It&nbsp;is&nbsp;also
<br>&nbsp;possible&nbsp;to&nbsp;install&nbsp;a&nbsp;SNiFF+&nbsp;kit&nbsp;for&nbsp;a&nbsp;platform&nbsp;which&nbsp;is&nbsp;not&nbsp;the&nbsp;installation
<br>&nbsp;platform.&nbsp;Therefore,&nbsp;please&nbsp;select&nbsp;first&nbsp;the&nbsp;target&nbsp;platforms
<br>&nbsp;and&nbsp;then&nbsp;the&nbsp;installation&nbsp;platform.
<br>&nbsp;
<br>&nbsp;
<br>&nbsp;Enter&nbsp;the&nbsp;platform(s)&nbsp;for&nbsp;which&nbsp;you&nbsp;want&nbsp;to&nbsp;install&nbsp;SNiFF+:
<br>&nbsp;
<br>&nbsp;sunos&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;Sun&nbsp;SPARC&nbsp;machines&nbsp;running&nbsp;SunOS4&nbsp;(Solaris&nbsp;1.x)
<br>&nbsp;solaris&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;Sun&nbsp;SPARC&nbsp;machines&nbsp;running&nbsp;SunOS5&nbsp;(Solaris&nbsp;2.x)
<br>&nbsp;aix&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;IBM&nbsp;Risc&nbsp;machines&nbsp;running&nbsp;AIX&nbsp;4.x
<br>&nbsp;hpux&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;HP&nbsp;9000/7XX&nbsp;machines&nbsp;running&nbsp;HP-UX&nbsp;10.x/11.x
<br>&nbsp;decalpha&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;DEC/alpha&nbsp;machines&nbsp;running&nbsp;Digital&nbsp;UNIX&nbsp;3.x/4.x
<br>&nbsp;irix&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;SGI&nbsp;machines&nbsp;running&nbsp;IRIX&nbsp;5.3&nbsp;or&nbsp;later
<br>&nbsp;unixware&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;PC's&nbsp;running&nbsp;SCO&nbsp;Unixware&nbsp;7.x/2.x&nbsp;or&nbsp;OpenServer&nbsp;5.x
<br>&nbsp;linux-glibc&nbsp;for&nbsp;PC's&nbsp;running&nbsp;Linux&nbsp;2.x&nbsp;based&nbsp;on&nbsp;GNU&nbsp;glibc&nbsp;2.1&nbsp;(like&nbsp;RedHat&nbsp;6.x)
<br>&nbsp;sinix&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;SNI&nbsp;RM&nbsp;machines&nbsp;running&nbsp;Reliant&nbsp;Unix&nbsp;5.4x
<br>&nbsp;
<br>&nbsp;Enter&nbsp;one&nbsp;name&nbsp;at&nbsp;a&nbsp;time&nbsp;(Leave&nbsp;empty&nbsp;to&nbsp;finish&nbsp;the&nbsp;selection).
<br>&nbsp;
<br>&nbsp;Target&nbsp;platform&nbsp;number&nbsp;1&nbsp;:&nbsp;linux-glibc
<br>&nbsp;Target&nbsp;platform&nbsp;number&nbsp;2&nbsp;:
<br>&nbsp;
<br>&nbsp;....the&nbsp;script&nbsp;continues&nbsp;here&nbsp;with&nbsp;more&nbsp;questions.....
</font>
</TD>
</TR>
</TABLE></CENTER>
<p>
One thing that I fall over during installation was the dialog where
one could install "Vim 5.0 Vi Improved by Bram Moolenar". I decided not
to install Vim as I had it already on the disk. This turned out to be a
mistake and I had to install it later on. The Vim version that comes with
SNiFF+ is a special one. It has the ability to communicate with the
other tools of the IDE. Therefore if you would like to use Vi, install
this special Vim.
</p>
<p>
SNiFF+ can be installed into any location. Therefore you need to
do 2 things after completion of the installation:
<ol>
<li>set the environment variable SNIFF_DIR to the place where you installed
SNiFF+ (/opt/sniff in my case).
<li>Extend the PATH to point to the bin-directory inside SNIFF_DIR (/opt/sniff/bin in my case).
</ol>
Dependent on the shell used you must either edit /etc/profile, ~/.bashrc for bash or /etc/csh.cshrc, .tcshrc for tcsh or what ever rc file it is for your shell.
If you don't want to edit the shell-rc files you can use this small wrapper script which I called startsniff:
<pre>
#!/bin/sh
PATH="$PATH:/opt/sniff/bin"
export PATH
MANPATH="$MANPATH:/opt/sniff/man"
export MANPATH
SNIFF_DIR=/opt/sniff
export SNIFF_DIR
#start sniff now:
sniff
</pre>
</p>

<h2>Documentation</H2>
<a href="../../common/images/article140/help.gif"><img src=../../common/images/article140/helpthumb.gif alt="tutorial in netscape" align=right></a>
<p>
SNiFF+ comes with a very nice documentation system in html. There seems to
be the possibility to print also the documentation from postscript files but 
I never felt that I needed this as the html documentation is good.
When starting SNiFF+ with the command sniff you are first presented a 
welcome screen. This welcome screen gives you the possibility to go directly
to programming language specific documentation. Selecting this item starts then
netscape with the corresponding tutorial.
I would recommend everyone to go at least quickly through the tutorial
</p>
<br clear=all>

<h2>Important components of SNiFF+</H2>
<br><b>The Launcher</b>
<a href="../../common/images/article140/launch.gif"><img src=../../common/images/article140/launchthumb.gif alt="launcher" align=right></a>
<p>
A project is the main structuring element in SNiFF+ for grouping
together files and directories. When starting sniff you are presented with
the following small launcher window. From here you create new projects
and you have an overview over the already existing ones. Here you
normally begin your work by starting the project editor or the symbol
browser.
</p>
<br clear=all>

<br><b>The project editor</b>
<a href="../../common/images/article140/projecteditor.gif"><img src=../../common/images/article140/projecteditorthumb.gif alt="launcher" align=right></a>
<p>
In the project editor you see all the source files belonging to a project.
You can filter on that list, include/exclude sub-directories etc.
It shows also version control/locking information and you can checkin/checkout
files.
A very nice feature is that you can search in the list of file names by
just typing the file name. The search function is incremental, searching while typing,
similar to emacs isearch. 
</p>
<br clear=all>

<br><b>The symbol browser</b>
<a href="../../common/images/article140/symboleditor.gif"><img src=../../common/images/article140/symboleditorthumb.gif alt="launcher" align=right></a>
<p>
The symbol browser is similar to the project editor except that you see
all symbols and where they are used. Via right mouse button click you can
start the cross referencer (see below) and see where a symbol is referred to and which symbols
refer to it. E.g which functions use this particular function or variable.
</p>
<br clear=all>

<br><b>The class browser</b>
<p>
The Class Browser shows the locally defined and inherited members of a class. 
It provides a range of filtering possibilities
based on the inheritance, visibility and type of the members.
</p>
<br clear=all>

<br><b>The hierarchy browser</b>
<a href="../../common/images/article140/hirarchy.gif"><img src=../../common/images/article140/hirarchythumb.gif alt="hierarchy" align=right></a>
<p>
The Hierarchy Browser shows the inheritance relationships of classes. 
</p>
<br clear=all>

<br><b>The cross referencer</b>
<a href="../../common/images/article140/crossref.gif"><img src=../../common/images/article140/crossrefthumb.gif alt="crossref" align=right></a>
<p>
Here you see in which places a given symbol (function, variable etc) is
used and also to which symbols a given function or class refers to.
</p>
<br clear=all>

<br><b>The include browser</b>
<a href="../../common/images/article140/include.gif"><img src=../../common/images/article140/includethumb.gif alt="include" align=right></a>
<p>
Here you see which files are included in a given .c file or
where a .h file is used.
</p>
<br clear=all>

<br><b>The source editor</b>
<a href="../../common/images/article140/edit.gif"><img src=../../common/images/article140/editthumb.gif alt="edit" align=right></a>
<p>
Sniff comes with a nice source editor. It has syntax highlighting and you can
quickly jump between functions/classes. You also can call other programs
like e.g the cross referencer directly from inside the source editor.
<br>The editor is very advanced however it does not have the 
power of vim or emacs. On the other side vim or emacs require 
that you know them by heart to really use them. The sniff source editor
is therefore a very good choice if you are not 100% familiar with 
 vim or emacs.
</p>
<p>Those who do not want to use anything other than vim or emacs can also
use these editors with SNiFF+. When you want to use vim then you should install
the version that comes with SNiFF+. This special vim has some communication
protocols compiled in which enables SNiFF+ to talk to vim.
To use emacs you do not need to install anything special. The normal emacs
that comes with most Linux distributions should work.
</p>
<br clear=all>

<br><b>The sniff shell</b>
<a href="../../common/images/article140/shellcom.gif"><img src=../../common/images/article140/shellcomthumb.gif alt="shell" align=right></a>
<p>
The shell window is mainly used during a compile run. You can see the error messages from the
compiler in that window. To jump to an error in the source code you
highlight the line of the error message in the shell and then you select
Edit->Show Error. This takes you in the source editor to the line where
the error happened.
This shell window is otherwise very simple. See also 
<a href="#flyonthedarkside">further down</a> 
for a description of problems that I had with this shell window.
</p>
<br clear=all>

<br><b>Other tools</b>
<p>
SNiFF+ includes also a couple of other programs which I have not used yet. 
These are Documentation editor, DiffMerge and Configuration Manager.
DiffMerge seems to be a merge tool to merge in changes from a branch and
the Configuration Manager seems to be a program to create and manage branches.
</p>


<a name="flyonthedarkside">&nbsp;</a>
<h2>The flip side</H2>
<p>
SNiFF+ has been ported to Linux and it is visible in many cases.
Luckily it supports common short cuts such as Crtl-a (go to start of line),
Crtl-e (go to end of line), Crtl-k (delete until end of line) etc... It
does however not support copy and paste via mouse.
Under Unix one has normally a 3 button mouse and you select text with the
left mouse button while you paste it with the middle mouse button. Under Linux
this works across all programs and it is really annoying that it does
not work with SNiFF+. Instead copy and paste is done with a key combination
that seems to come from MS-Windows. <br>
SNiFF+ is otherwise a sound product but not being able to copy and
paste with the mouse really annoyed me every time I used it.
If I had to suggest a high priority improvement for SNiFF+ then it is this
point.
</p>
<p>
I use colors in the shell prompt and I have aliased ls to <tt>ls --color=tty</tt>. Normal Linux xterm, gnome-term, kvt, etc do all support these colors:
<br>
<img src=../../common/images/article140/shell.gif alt="shell">
<br>
The shell that comes with sniff does not support it and the output looks
then a bit funny:
<br>
<img src=../../common/images/article140/shellsniff.gif alt="shell">
<br>
Fortunately it is not that difficult to fix although it would have been nice if
sniff did support ANSI color codes. To fix it the easiest solution is
to test for $TERM and if that is equal to etterm (the sniff terminal name)
then unalias ls und do not use color in the prompt.
<br>
Long term emacs users probably know that the shell in emacs has the same problems
 and have already a work arround in their .bashrc or .tcshrc. 
Here is e.g some code for tcsh users to go into their .tcshrc:
<pre>
if ($?TERM) then
     # switch off color prompt for emacs and sniff
     if ("$TERM" == "dumb" || "$TERM" == "etterm") then
         # a color free prompt:
         set prompt='\n%n@%m[%d,%T]\n(%~) %# '
         alias cwdcmd '/bin/ls -F'
         alias ls '/bin/ls -F'
     endif
endif
</pre>
Users of bash may write:
<pre>
# switch off color prompt for emacs and sniff
if [ "$TERM" = "etterm" -o "$TERM" = "dumb" ]; then
        PS1="[\u@\h \W]\\$ "
        alias ls="/bin/ls -F"
fi
</pre>
</p>
<p>
Another problem of the sniff shell is the name of the terminal.
etterm was at least not known in my /etc/termcap. This produces then
the message <tt>'etterm': unknown terminal type</tt>. 
</p>

<h2>Conclusion</H2>
<p>
SNiFF+ 3.2 is a good product. It provides the visualization and comfort that 
one expects from and IDE. SNiFF+ ran also very stable under my Redhat 6.0.
I had used it for about 3 weeks before I wrote this article. SNiFF+ did
not crash once. The tools are made for daily use. With the exception of 
this really annoying copy/paste <a href="#flyonthedarkside">problem </a>
all parts of SNiFF+ were very well usable.
Personally I can not understand that this software is available for so many
Unix systems and does not get the simple copy/paste via mouse buttons right.
</p>


</BODY>
</HTML>
<!-- vim: set sw=2 ts=2 et: -->