Application Programming Interface

Mark Pustejovsky
3 min readAug 9, 2020

This week Austin Coding Academy we spent a lot of time on API’s or application programming interfaces. I was surprised to how many companies allow access to their API’s. Companies like Twitter that allow you to send tweets via your program, if you follow the right API structure and have the proper permissions in your code. I have heard of API’s with client software, and using them to get data out of a system, but did not realize how widely they are used in so many different systems and how companies make their products more accessible by letting others access data in a controlled manner.

One of the items used in our practice code is a onload event. The onload event occurs when tan object has been loaded. Onload is most often used within the <body> element to execute a script once a web page has completely load all the content (including images, script files, CSS files, etc). This is useful to fetch data from an API as soon as the page is loaded.

AJAX = Asynchronous JavaScript and XML. AJAX is a technique for creating fast and dynamic web pages. AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page. AJAX just uses a combination of: A browser built-in XMLHttpRequest object (to request data from a web server) JavaScript and HTML DOM (to display or use the data). Some advantages of AJAX are:

1. Reduces the server traffic and increases the speed

2. Ajax is responsive and time taken is also less

3. Form validation

4. Bandwidth usage can be reduced

5. Asynchronous calls can be made this reduces the time for data arrival.

Some disadvantages to AJAX are:

1. Open-source

2. Active x request is created only in internet explorer and newly created web browser

3. For security reason, you can only access information from the web host that serve pages. Fetching information from other servers is not possible with Ajax.

Another term used a lot this week with API’s is JSONP. 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>).

This week we also covered different sorting techniques and discussed there time complexity of each algorithm. Time Complexity of an algorithm is the representation of the amount of time required by the algorithm to execute to completion. Time requirements can be denoted or defined as a numerical function t(N), where t(N) can be measured as the number of steps, provided each step takes constant time. This is a very important factor when determining the efficiency of your algorithm.

We covered recursive functions and discussed the three laws of recursion.

  1. A recursive algorithm must have a base case.
  2. A recursive algorithm must change its state and move toward the base case.
  3. A recursive algorithm must call itself, recursively.

This week we were exposed to a lot of new concepts and I found myself learning a lot about object oriented programming. I have had programming experience many years ago, but it was all functional based. Learning how to use objects and keyed pairs, has helped me see opportunity to model projects in a more real world method. I am looking forward to using these skills in future projects.

--

--

Mark Pustejovsky

Subject matter expert in P&C and electrical testing. Adding full stack development to resume to bring technology to my next employer.