Ironhack Day 2

There are two kinds of students here: those who have spent years programming and/or have a science degree and the rest. I belong to the latter category. For the former group this bootcamp is a stroll in the park, for the latter it’s overwhelming. That’s just how it is, trying to face the music and hope I’ll come out of this experience with a bit more solid knowledge of web dev than what I’ve had before.

That being said here are my notes from day 2:

CSS:

Learned that the absolutely positioned div is relative to its parent if the latter is positioned relatively. If there’s no such parent, then it will be positioned relatively to the body.

JavaScript:

Learned i.a. about anonymous functions, recursion, high-order functions and forEach method, see details below.

1. Anonymous function:

var anon = function(){
console.log(”An0nym0us Funct10n”);
}

anon();

When calling this function the function itself will be printed, i.e. ”Function: anon”, instead of ”An0nym0us Funct10n”.

2. Recursion (function definitions that are implemented in a way they use their own definitions. It’s like function inception. Btw factorial of a non-negative integer n is the product of all positive integers less than or equal to n, e.g. 5 ! = 5 × 4 × 3 × 2 × 1 = 120):

function factorial(number) {
if (number === 0) { return 1; }
return number * factorial(number – 1);
}

3. High-Order Functions: functions can return functions or receive other functions as parameter.

var add = function (a) {
return function (b) {
return a + b;
};
};

var add2 = add(2);
add2(3);
// => 5

add(4)(5);
// => 9

4. forEach:
Example nr 1:
var raceResults = [’Hellen’, ’John’, ’Peter’, ’Mery’];
raceResults.forEach(function(elem, index){
console.log(elem + ’ finished the race in ’ + (index+1) + ’ position!’);
});

Example nr 2:
function averageWordLength(words) {
var sum = 0;
words.forEach(function(word){
sum = sum + word.length;
})
var average = sum/words.length;
return average;
}

var words = [
”seat”,
”correspond”,
”linen”,
”motif”,
”hole”,
”smell”,
”smart”,
”chaos”,
”fuel”,
”palace”
];
var averageLength = averageWordLength(words);
console.log(averageLength);

Syntax:
arr.forEach(function callback(currentValue, index, array) {
//your iterator
}[, thisArg]);

Ironhack Day 1

On the first day of my Ironhack Web Dev Bootcamp our teacher, Thor (great name, btw!) made a super-quick summary of Git, Github, HTML, CSS and JavaScript (mainly things we’ve had to read for the pre work exercises of the bootcamp). Below are the things that grabbed my attention:

Git & Github:

  • touch index.txt (create file)
  • nano index.txt (open the files, used for making small changes)
  • cat index.txt (check what the file contains)
  • going back to previous versions with the help of git log, was introduced to the concept of HEAD

 

JavaScript:
The following notes are related to the pair work we did after the actual teaching. Even though my head was spinning after that, given the fast pace at which my team mate, who’s been working with JS for 6 years, was coming up with different possible solutions to the exercises, it’s been incredibly useful for me. Besides the things listed below my main take-away was seeing in action how one translates to JS’ logic (functions, loops, if statements & all that jazz) the instructions given in more or less plain English.

  • use of functions: noticed there are two cases where we were supposed to print words backwards
  • use of .indexOf for ”translating” characters from a string into numbers (=their position in the string) in order to check which of the strings comes first in an alphabetical order
  • use of .replace in order to be able to ignore spaces between words when checking whether the string entered by the user is a palindrome or not
  • counting number of words in a text by checking how many blank spaces the text contains
  • counting how many times a word has been used in a text by checking: 1. if the first characters of the text match with the word we’re looking for; 2. if there are in the text cases when a blank space is followed by these characters, which are in turn followed by another blank space.

Got My Mind Set on You Part 2

Remember me saying last November that my long term goal is to get filthy rich, get a 13 weeks unpaid vacation and take a job guaranteed web dev bootcamp course? Well, I haven’t gotten rich (au contraire), but I did get a 3 months unpaid vacation and took an on-site web dev bootcamp that kind of guarantees a web developer job. The ”kind of means” here that the school (Ironhack) is pretty sure I could get a job after the course in the city where they hold these courses, the city being Barcelona. So, here I am in Barcelona, full of hopes and anxieties and freaked out and thrilled by the prospect of studying web dev about 11 hours a day (most of this time spent on pair work and individual work) for a while. I’ll try to post from now on at least once a week about my progress, just to keep track of what I’ve learned & make sure these things won’t be completely wiped out of my memory once I’ve finished the course.