Other useful tools
==================

In addition to using Calypsi to compile and link HP-41 MCODE
and RPN programs, you will probably find some other tools useful. A
text editor or IDE will be essential, while some other tools may not be
essential, but they may make your life easier.

Editor
------

To write code you will also need a text editor and any
decent text editor can be used. Another way is to use a customizable
IDE.
If you already have a favorite environment, just go ahead and use it.

I you do not have or are not happy with your current text editor/IDE
environment, there are many to choose from.

You can go for old school powerful editors like Emacs or Vim. They may
have a somewhat long learning curve, but you may find as many other
have, that it is well worth it. If you are going to edit code and text,
these tools are proven and designed for the purpose.
They are keyboard oriented as they have their roots from before the mouse
and graphical user interfaces become common. Fear not, by not having
to lift your hand from the keyboard to reach the mouse, you will be
able to work faster.  You also have a huge set of very powerful
editing commands at your fingertips. Aimed with these, you can edit fast.

If you want to go for a more IDE like experience, there are Eclipse and VS
Code.

In fact, there are many editors on the market today, Atom, Sublime
Text, just to name two. Consult your favorite search engine and surf
ahead.


Build engine
------------

IDEs and some editors allow building inside the tool. This makes the editing,
build and fix loop very quick as you can do everything inside the same
tool. This is very natural for IDEs, but powerful editors often provide it as well.

There are many build engines to choose from. One old trusted tool is
``make`` which takes a Makefile that describe the input files, the
output files and provide rules for how put things together.
Invoking ``make`` will result in running the minimal set of commands needed to
bring the output up to date.

There are many alternatives today, like ``cmake`` and Ninja that can
be worth looking at. Most IDEs provide some internal build engine and
may allow external ones like ``make`` to be used from inside the IDE.

As an example,
Emacs allows build inside the editor in a compile buffer. The easiest
way is to create a simple Makefile with your project and then use the
``make`` command to build your project inside Emacs. A simple Makefile
(suitable for GNU Make) can look as follows:

.. literalinclude:: Makefile-example.text
   :language: makefile


Source code control
-------------------

A source code control system is very useful to keep track of different
revisions of your software.
It is strongly recommended to use a source control system, as it will
help you keep track of what you are doing over time. It gets even more
useful if you collaborate with other people, or move your software
between different computers.

If you are not using a source control system and feel it is too much
hassle to set it up, take a look at tools like *Git* and
*Mercurial*. Both Git and Mercurial are so easy to get started with
and once you feel familiar with it, you will not hesitate to use it
even for small projects. You do not need to set up any
server and can move your project around on different computers
and collaborate easily.

IDEs and powerful editors provide suitable functionality to work with
tools like Git and Mercurial. You may find that you do perform some
actions inside you IDE/Editor, but others outside on a command line.

The Emacs mode `Magit <https://magit.vc/manual/magit/#Top/>`_ is especially
useful. It provides a lot of functionality and control using Git
inside the editor and will make your life a lot easier, should you go
that route.
