Monday, January 13, 2014

Capitalizing On Skills With A Side Of Stupid


(sorry for the late post. As you'll see there was a loooot of stupid...)
     Well, I made it back for yet another week! Today's post is brought to us by some Blind Melon and a latté whipped up by the friendly barista. I was going to just work with no music, but then the place got swamped and everyone was talking and noise happened, but now I can plug in and plug away!
  
     I've been doing these classes for about a year, but this is my first REAL attempt at actually taking time every day to do at LEAST an hour's worth of studying in and I'm starting to see some of the skills that get picked up along the way. For instance, today I was working on some classwork and I got a syntax error. It used to be that I would be at a loss as to what the reason was, but now I'm starting to learn what to check before giving up hope when I get a syntax error, and today I took the time to check that all of my variables and such were in the correct place and that I had the correct capitalization. Turns out one of them needed to be moved AND capitalized. Good thing I'm a student and not a pro, because; that would have been embarrassing. I've also noticed I'm better at algebra too. Turns out I was right in thinking that there was a lot in common between the two. 

     Right now I'm working on a section that (once again) is using math involving a startup. Such as paying employees, rent and such. I'm also dealing with multiple parameters which are easy, it's just difficult to always get the correct ones in the correct places, but copy pasta!

I really don't like it when I don't pass the lesson and they won't tell we why. They're just like: fail. Try again. At least tell me what's wrong. The weirdest is when I get NaN, but they say I passed the lesson. No. I'm not going to NaN my way through this. Whoever wrote this lesson definitely didn't think of everything. 

Switch statements are awesome, but I had forgotten that you have to add a return at the end after the <}> and now I feel stupid. Duh, of course there should be a return. 
I just finished the function which tells you the total costs for a startup based on salary, number of workers and city. Kinda sounds cool when I write it out. 

Speaking of not thinking of everything, look at this:
var calculateTotalCosts = function(salary,numWorkers,city)
{
fixedCosts = 5000;
variableCosts = salary*numWorkers;
switch(city)
{
case "BEJ":
rent = 25000;
break;
case "NYC":
rent = 30000;
break;
default:
rent = 10000;
break;
}
return rent + variableCosts + fixedCosts;
};
  
console.log(calculateTotalCosts(50000,9,"BEJ"));
console.log(calculateTotalCosts(50000,9,"NYC"));
console.log(calculateTotalCosts(50000,9,"MUM"));

That is a perfectly working code and exactly how they TELL you it should be. They actually give you the code with everything except the console.log parts. 
Turns out they want you to change it to an if/else situation. WHAT?? why... omgosh this si so stupid.... gr... just going to peddle through this crap and hope they don't do something so mind boggingly stupid again....
Aaaaand they signed me out. None of my work from today is saved. Wow... Well, at least I know how to get through this crap.
Jeeze that was annoying. Ah well. All part of the experience, I hope. 
See y'all Wednesday!
--Martin