API’S

Omar Gonzalez
3 min readSep 17, 2020

With only two weeks left in the course, we are just about wrapping everything up and can officially say we have learned the basics of programming. (Hit me up NASA). Even though my programming career hasn’t officially started an I am still a very far length away from where I want to be, I am excited about what I have learned and where I am heading. I hope to one day look back in these notes and smile about how clueless I actually was.

  1. Write about something that you learned this week?

This week in class we mainly focussed on API’s. API’s are a great way to get data incorporated into your app or website that you have deigned. There are thousands, probably millions of API’s that range anywhere from a famous celebrity quote generator, to an API that gives you the weather at your current location. Hell, there probably even an API that gives you the weather at a certain famous person’s location.

2. Why would you use something like the load event? Does this event have disadvantages? Do you know any alternatives, and why would you use those?

The loading event happens after the entire document has been loaded up. This is useful because if there is a great amount of JavaScript that has to be loaded up, it can have an effect on how fast your web page gets rendered. So placing the loading event at lease lets the web page get displayed before having to start loading up any of the script!

3. What are the advantages and disadvantages of using Ajax?

A disadvantage is that it can not only increase development time but design time as well. Its adds complexity versus building a good old classic web application. JavaScript disabled browsers will not be able to use the application. Some advantages are that the response time is faster so the performance speed is also increased. There is a ton of open-source JS libraries that are ready to be used, such as JQuery, Prototype, Scriptaculous…..

4. Explain how JSONP works (and how it’s not really Ajax).

JSONP(as in “JSON with Padding”) is a method commonly used to bypass the cross-domain policies in web browsers (you are not allowed to make AJAX requests to a webpage perceived to be on a different server by the browser). JSON and JSONP behave differently on both the client and the server. JSONP requests are not dispatched using the XMLHTTPRequest, instead a <script> tag is created, whose source is set to the target URL. This script tag is then added to the DOM (normally the <head>). -Neha Nupoor (2016)

5. Explain Ajax in as much detail as possible.

Ajax is a way to communicate to the server without reloading the page. Once that info is loaded, we have the ability to manipulate that data without ever having to refresh the page. Ajax uses a host object called XMLHttpRequest to communicate to a server-side script to retrieve data formatted in either JSON, XML, HTML, or plain text.

6. What does it mean when we talk about complexity of an algorithm?

This simply comes down to the amount of time that it takes to run the algorithm. The more complex (bigger numbers etc.) the longer it takes for the calculations to come back.

7. What are the three laws of algorithm recursion?

A. Base case

B. Algorithm must change its state and move toward the base case

C. It has to keep calling itself recursively!

8. How do you see yourself growing as a web developer?

I am learning new techniques and information every single day. I have finally found something that I can see myself doing everyday for a living. I am actively working to build friends and family websites for their small websites and every time I learn a new skill I like to try and incorporate that into something that I have built previously.

--

--