Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Integrating Together

6(ASI)
Week 2
Programming is Problem Solving
● Programmers must first understand how a human solves a problem,
then be able to translate the "algorithm" into something a computer
can do, and finally how to "write" the specific syntax (required by a
computer) to get the job done
● Programmers know how to represent the information (data) describing
the problem
● Programmers apply their solutions in making different processes
easier and faster in the real world (e.g. ATM machines)
Majority of the problems in CS / Programming Cases
● Most of the time these problems must
have a solution addressed as soon as
possible
● In terms of industry, time is money for
their solutions
○ Big software companies (E.g. FB,
Google, Microsoft, etc.) loses
thousand to billions of dollars when
they’re having downsides in their
software products
Problems in Programming
● Arithmetic operators
● Web development
● Mobile development
● Big Data
● Machine Learning
● Security
● A whole lot more
We want to solve problems,
FAST!
WE ALL WANT TO END THE MISERY QUICKLY!
Application Program Interface (API)
● Works from other programmers solely intended in making certain
processes fast for other programmers
● In web they known of harnessing the following: subroutines, methods,
requests, or endpoints
○ Post requests
○ Email verifications from other applications
● Imported libraries/packages for programming languages
● May be free or paid
○ Twitter API
Why use an API?

● Eliminates error risks as


much as possible
Why use an API?
● Makes solution delivery faster
Other best examples and applications
How do we develop APIs for future use? (High level)
How do we develop APIs for future use? (High level)
● Identify whether or not the problem you’re facing is most likely to occur
again or not?
○ Remember why you create functions
● Make a function which basically solves the identified recurring problem
○ Libraries commonly used are composed of multiple functions
■ E.g. console.log()
● Save the script and test it for importing
● Improve and make it a package if applicable
● Make it an endpoint if it is a web service API
Node JS Modules
● Set of functions that are intended to be included in the application
● Comparable to Javascript libraries
○ E.g. importing packages/libraries
Node JS Modules
● Set of functions that are intended to be included in the application
● Comparable to Javascript libraries
○ E.g. importing packages/libraries
● Export:
○ Readies all of your functions to be used by other scripts by
providing the intended function names
● Import:
○ Includes the specified exported functions/packages in the
script
Activity
● Create 5 different functions on a function script, export it and use it on a different script (main)
○ 1 does not require parameters
○ 4 requires parameters
■ Show arithmetics
■ Show loops
■ Show booleans
● Save as:
○ Functions: lastname1_lastname2_lastname3_lastname4_functions.js
○ Main File: lastname1_lastname2_lastname3_lastname4_main.js
■ Combined Section

● Reference: https://www.w3schools.com/nodejs/nodejs_modules.asp
References
● https://www.cs.utah.edu/~germain/PPS/Topics/problem_solving.html
● https://techcrunch.com/2018/07/26/facebook-officially-loses-123-billion-in-value/
● https://www.ubuntupit.com/best-python-libraries-and-packages-for-beginners/
● https://uxplanet.org/designing-ux-login-form-and-process-8b17167ed5b9?gi=412294a
7735f
● https://blog.logrocket.com/how-to-send-emails-with-node-js-using-sendgrid/
● https://www.w3schools.com/nodejs/nodejs_modules.asp

You might also like