
Welcome to this class! I'll teach you the basics of programming and make sure you have the best possible start into this wonderful field, and I'll do this with one hand behind my back! Just kidding! I'll teach you how to think as a programmer and show you some of the most used programming languages.
Before writing one, we should define it, shouldn't we? The computer program is the untouchable system that transforms one interaction into a predictable result.
Outputs are what our programs produce. We know everything works because we see a trail of outputs.
Variables are the main "memory units" in a program. We'll use them to store information while the program runs. Make sure you download the materials attached for future reference.
We'll take a closer look at how texts are stored in the computer memory.
Let's store inside our program memory a sentence of your choosing.
The time has come to see how numbers are stored. Did you know that a round number is stored differently than one that has decimals?
One of the most valuable information is if a condition is true or false. This will allow us to teach our programs how to make decisions. But until then, let's see what TRUE and FALSE mean while programming.
What's the purpose of storing all that information if we cannot compare or alter it?
Let's apply everything we learnt up until now in a fun exercise!
This is the first instruction that we'll use. It's easy and we're actually using it while solving day to day uncertainties. Make sure you download the attached materials for future reference.
The basic IF.
And the not so basic IF.
Let's apply this new knowledge in a fun exercise!
There are two kinds of loops and even if they're similar, they have specific purposes. Make sure you download the attached materials for future reference.
Let's count from 1 to 10.
What if we could stop time for a little bit, just to take a peek inside the program memory? Wouldn't this be a glimpse into the Matrix?
We're going to have fun altering the behavior of our loops.
...and another approach.
This is actually the "generic" loop. For loops assume we're counting something. While loops, on the other hand, expect to run until a condition will break the cycle.
Let's take a closer look at what happens inside this loop.
And we're finishing this section with a mix of all the concepts we learnt so far.
All data is structured somehow and the array is the most basic data structure. Let's see how to handle a list of similar elements! Make sure you download the materials for future reference.
And what would be the point of storing a list if we cannot go through it?
Let's sift our list with a WHILE loop.
... and finally, let's test our knowledge!
Let's see how a good set of instructions can be wrapped and stored into a routine so we can reference it later on. Make sure you download the materials!
Let's build a component that, if given two numbers as parameters, outputs the larger one...
... and generalize this solution.
I'll teach you a nice trick that allows you to interact with the user!
In the end of this section, we'll test our knowledge with implementing a full featured pocket calculator! How fun!
A short introduction for a wonderful section. This is the actual moment you start programming and flexing your coder muscles.
A simple, warm-up, challenge. It's just an array.
.. and I'll walk you through my solution.
Another simple task. This is just to see how a string is array-ish.
... and my solution to the reverse string challenge, in case you got stuck somewhere.
Let's count the characters in a text. Believe it or not, this is something that's done when compressing stuff in archives.
... and my "oficial" solution to the counting characters challenge.
We'll imagine we have to implement a phone robot that just recites the caller's number.
... five five five one two nine ... etc
This is a classic challenge. We'll see how a prime number is defined and calculated.
... and this is my solution.
Another classic example. All these do is allow you to practice looping over a set of instructions to get to a specific goal.
... and my solution.
Of course we had to do this. Any programmer should know how integers are represented in the computer memory.
... and my solution to the conversion challenge.
This is to visualize how two nested loops are working together.
... and my solution. Real easy, isn't it?
This is a nice challenge that pushes that "strings are array-ish" concept to another interesting level.
... and my palindrome solution.
I bet you feel the need for some structure in your approach. We've had fun until now, but it's time to study some of the classic datastructures and algorithms that are out there. I promise all these will give you some perspective and will deepen the understanding of what programming should be.
A greedy algorithm is any algorithm that follows the problem-solving heuristic of making the locally optimal choice at each stage. In many problems, a greedy strategy does not usually produce an optimal solution, but nonetheless a greedy heuristic may yield locally optimal solutions that approximate a globally optimal solution in a reasonable amount of time.
Let's implement Greedy!
Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted.
So we have one approach ...
... and a second approach!
In computer science, a stack is an abstract data type that serves as a collection of elements, with two main principal operations: push, which adds an element to the collection, and pop, which removes the most recently added element that was not yet removed.
Let's implement a Stack!
In computer science, a queue is a collection of entities that are maintained in a sequence and can be modified by the addition of entities at one end of the sequence and the removal of entities from the other end of the sequence.
Let's implement a Queue!
Recursion (adjective: recursive) occurs when a thing is defined in terms of itself or of its type. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in mathematics and computer science, where a function being defined is applied within its own definition. While this apparently defines an infinite number of instances (function values), it is often done in such a way that no infinite loop or infinite chain of references can occur.
Let's implement some recursion!
In computer science, divide and conquer is an algorithm design paradigm based on multi-branched recursion. A divide-and-conquer algorithm works by recursively breaking down a problem into two or more sub-problems of the same or related type, until these become simple enough to be solved directly. The solutions to the sub-problems are then combined to give a solution to the original problem.
Let's implement some Divide et Impera!
The why behind pseudocode. This section is easy, I promise!
See? I told you this is easy. We're just writing what we see in the flowchart.
I think we're ready to apply our knowledge on previous exercises.
One more shot, just to see how functions work.
As we transition to programming languages we should pay closer attention to the history of these. This is a brief journey through time and purpose.
Things just got real! This lesson plows through 6 different programming languages while explaining how to OUTPUT in each.
I bet you can already read code! I've prepared a pocket calculator implementation for you to see and convince yourself that reading code is easy enough. We'll revisit the FUNCTION concept.
Let's take a closer look at the IF structure. This time we'll write actual code, not a flowchart or pseudocode.
In this lecture we'll see how loops are implemented in code and explore python's way of looping.
It's time to rewrite some of our flowcharts into code. Let's start with the GCD example.
We'll rewrite the prime number example, too. I wonder which programming language will be next!
Our firs compiled example. Look at this C implementation of the asterisk square challenge.
Could any other language than Java be more well suited for the Greedy Algorithm example?
Let's implement the recursion challenge, but this time using JavaScript.
Dear very beginners,
This is a course dedicated to you.
There are no prerequisites necessary. You just need a little bit of time for practice, and a windows PC if you want to run all the examples along with me.
Maybe you want to know why am I teaching this course?
As a team leader I have had the chance to work with and mentor many interns and juniors. Many of them were self-taught or had little formal education in the field of Computer Science. Do you know what their common trait was? They all felt that learning the tools of the trade is hard.
So, why should you take this course?
Programming (and learning how to program) should be fun! Take this course and see it for yourself. We will cover a lot of ground and learn all the important concepts, but we will start working visually and abstract those concepts later on, making the learning process as intuitive as possible. We will study how information flows through the program and how time "behaves" when the code runs.
Peek at the curriculum, watch the sample videos! We might have great chemistry and your decision to learn computer programming will be a life changing journey.
Here for you,
Radu