~rpadovani/ubuntu-calculator-app/improvePushFunction141209

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Ubuntu Calculator App
Default Calculator application for Ubuntu devices.

# Useful links
- Project page: https://launchpad.net/ubuntu-calculator-app
- Design page:
  https://docs.google.com/presentation/d/1EiIELGizPHrd0TY7JdNwULbiqPYfOyEEI5CS87n7QlY/edit


# How to develop

## Calculation engine.

Current calculation engine is math.js version 1.1.0. 
You could download latest version from webpage:
    http://mathjs.org

The engine was sligtly modified to properly work with Ubuntu-Calculator-App.

## Style guide

General idea above style guide is:
"All code in any code-base should look like a single person typed it, no matter how many people contributed."

If you're editing code, take a few minutes to look at the code around you and determine its style. If they use spaces around all their arithmetic operators, you should too. If their comments have little boxes of hash marks around them, make your comments have little boxes of hash marks around them too.

The point of having style guidelines is to have a common vocabulary of coding so people can concentrate on what you're saying rather than on how you're saying it. If code you add to a file looks drastically different from the existing code around it, it throws readers out of their rhythm when they go to read it. Avoid this.

More information about style guides, and why we need it:
    http://addyosmani.com/blog/javascript-style-guides-and-beautifiers/

Curent style guide for ubuntu-calculator-app is:
    https://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml

## Clean/Beautiful Code

When you creating code, every function/variable name should be meaningful and has easy to understand form. The names should reveal intent of creator. With good names you even do not need an comments. The code is documentting itself. We should avoid comments if it is not necessary.
If someone during review, ask you to add comment then you should check if names are reveal your intent.

More information about clean/beautiful code is available in books:
 * Clean Code: A Handbook of Agile Software Craftsmanship Paperback, by Robert C. Martin
 * Beautiful Code: Leading Programmers Explain How They Think, by Andy Oram

## Run the autopilot tests

Prerequisites:
    sudo apt-get install ubuntu-ui-toolkit-autopilot

Once the app has been built, you can go to the build directory and run:

    cd tests/autopilot
    autopilot run ubuntu_calculator_app