DEV Community

kealanheena
kealanheena

Posted on • Updated on

Makers Week 5: A Whole New Language

Weekly Goal:
Can you learn a new language and its patterns?

We started JavaScript this week which threw me because I thought I'd have a bit of a head start. I was wrong. We are using prototypes which I had never seen in JavaScript so I guess I'm in the same boat as everyone else.

Day 1

So the fist day of learning a new language was spent primarily on learning syntax. We read the documentation and converted fizzbuzz to JavaScript using TDD. This was fine for me because I had done some JavaScript so it was mainly just remembering the syntax. We used Jasmine for testing which was similar enough to especially to not cause many problems(mainly syntax). But it was still difficult to go back to it after 4 weeks of ruby!

Day 2

After the first day of JavaScript I got the hang of it. Although getting used to using prototypes is a little awkward. I’d never seen them before but they seem to work like classes so they’re not too new.

Day 3

We started on the DOM(domain object model). Which we can use to make a website dynamic. This seems very useful because if we wanted to change the page before we had to make a post request and redirect the page. We can now make changes without having to reload the page. This can be done through JavaScript but there’s a library that makes it a lot easier called jQuery. In plain JavaScript you’d have to get an element by using ”getElementById” where as all you need in jQuery is ”$(“#name of id”)”. The # is if you’re searching by id, It’s a . for a class and just a name for a tag. It seems like it has a lot of potential uses.

Day 4

On day 4 we were using API’s which were awkward to set up. The way I understand them is they have loads of information that you can then use in your app. Although I’m sure there’s more to them. We used a weather API for the thermostat to tell the current weather in a selected location. It took us a lot of time to get them set up but once we did it was awesome to see it working.

Day 5

After we were introduced to API’s we thought it was best to revisit them. So that’s what we did and we managed to get them done. But we still had a bit of trouble mainly because I downloaded the slim jQuery file which doesn’t have some important functions. Anyway we got it working in the end.

Summary

Overall a lot to take in I think having a fair bit of knowledge of JavaScript really helped me out. The API’s are cool and very useful. I also like using JavaScript. I reached my weekly goal so it was a good week.

Top comments (0)