December 18, 2017
Chapter V: Conditionals
Working with true and false So far we have learnt how to stop a "looped" statement from going on forever, based on a condition. Now, we'll see how to execute single statements based on a condition and apply that to our study of the Fibonacci sequence.
Conditional statements The simplest conditional statement has the form:
if condition command end meaning that command is to be executed only if condition is verified.
November 18, 2017
Chapter IV: The while loop
Automatizing things Repeating a command many times can be extremely annoying. Luckily, Julia can help us automatize things using loops, which are a way to repeat the same command, or list of commands many times. Here we will continue on playing with Fibonacci numbers, without having to manually evaluate the same command at the console many times.
The while loop The while loop executes a statement as long as a given condition is verified.
November 16, 2017
Chapter III: Variable assignment
Giving names to things In the previous blog post, we have found a somewhat tedious way to compute the Fibonacci sequence. We started by typing 1+1 at the console, we looked at the result, which was 2, we typed 2+1, we got 3, we typed 3+2 and so on and so forth. In this and the following post, we'll discover a less excruciatingly boring way of doing the same computation. In the process, we'll learn two key building blocks of programming: assigning values to variables and looping.
November 15, 2017
Chapter II: Numbers
Numbers and math In the previous post we mainly played with strings, but Julia is also very good at math. In this post we will do some math in Julia.
Integer and and non integer numbers Julia accepts both integer numbers and non integer numbers (with a decimal point). All basic (and often non basic) mathematical functions are implemented in Julia. Here we will play a bit with the four basic operations (+, -, *, /), the exponentiation operator (^) and the comparison operators (>, ==, <).
November 14, 2017
Chapter I: Hello, Julia
Learning how to code This is the first of a series of posts aimed about the Julia programming language. Julia is a reasonably young language designed for scientific computing. Despite being free, fast and elegantly designed, Julia is not as widely used as I think it should be. I also believe that, due to its simplicity and clarity, Julia makes for a good first programming language. In case some newcomers to programming are curious enough to give Julia a try, I'm making a series of tutorials about it, starting from the very beginning.