Ch 1- Key Ideas Flashcards
What are the steps taken in writing a script/full webpage?
Well before writing a webpage you’d have to first have the requirements of the webpage. What languages you’d be using, what tools you’d be using and what exactly you’d be creating. JS is a programming language, while HTML and CSS are both markup languages.
Describe in detail what the three layers of web development are.
Developing a website requires the use of the JS programming language as well as the two markup languages HTML and CSS.
JS controls the behavior, HTML is responsible for the content and CSS is responsible for the styling.
The separation of tasks in this way is by design, the theory behind this is called progressive enhancement, which is the idea that websites are built first with content in mind and then progressively enhanced first with styling and then with dynamic behavior.
When developing a website there’s typically a system in which you utilize to develop it, what are the two present systems in which one develops a website?
A website can be developed using the system of progressive enhancement, the other option is graceful degradation.
Progressive enhancement depends on the three layers of a website, starting from content to styling to functionality.
Graceful degradation is the idea that websites should or can be built to meet all present technological capabilities, and once the website is completed developers must look to remove the features necessary so that their sites can still be useful to users who don’t have access to all the latest web technologies the original site was created with.
What is a programming language?
What is a markup language?
Give examples of both.
A programming language are a series of instructions readable by humans that serve to instruct computers on what to do. Web sites and software of all kinds are created using programming languages.
Know high level vs low level languages.
Machine code, Assembly, C, etc.
A markup lanuage is the base content language of the web, before JS or CSS the HTML was used to transport information over the web via webpages.
Ex. of markup languages: PostScript, XML, HTML, CSS
Ex. of programming languages: JS, Python, Ruby, C, C++, C#, Haskell, COBOL, Java.
How does HTML, CSS, JS work (in as much detail as possible)?
HTML describes the structure of your content, and represents the standard markup language for websites. So you can embed and organize varied page content elemenets easily, even styling is possible inside HTML.
CSS takes the styling away from HTML and makes for easier to maintain and manage code.
JS is the behavioral layer when developing a website and has 4 differentiating components:
- JS uses first class functions
- JS is dynamically typed
- JS has its own API and uses others
- JS can be used for functional, imperative or OOP.
JS uses first class functions. Explain.
JS can be used as an OOP language, and in OOP languages functions are treated as objects.
Functions considered first class have 3 features:
- can be assigned to variables.
- can be passed as arguments to other func. (in variable form or not)
- can be created inside functions.
- can be returned from other functions.
This is most evident when you utilize functions such as the map function which takes a function and an array as arguments.
-
Call back functions. What are they?
Callback functions are the most widely used JS technique. JS is OO, it treats functions as objects and therefore allows objects to be passed into other objects. Callback functions are functions that are passed into other functions to be returned or used.
JS is dynamically typed. Explain.
JS has 6 types (U SNNOB- undefined, string, null, number, object, boolean) and when dealing with variables every variable has a type.
The time at which the browser reads the contents of a variable or variables determines whether or not a language can be considered strongly typed or weakly typed.
JS is dynamically typed (not static) and that means it reads the contents of variables, functions and modules when the program is actually being run, not before.
Statically = type checked at compile time, and variables declared before use.
Dynamically = type checked at run time.
Also in dynamic typing declaration of types are not necessary. So rather than having to say var a; then a = 5, we can say var a = 5.
Why does it matter? It matters mainly because it allows for JS to be more dynamic in its treatment of variables, objects and functions.
The downside of dynamic typing is that rather than seeing errors as they are being made errors are seen after the code is completed.
JS has its own API and employs others. Explain.
An API (Application program interface) allows you access services outside of your own code, so for example rather than having to download the entirety of google maps you can have access to it by linking in the google maps API to your site.
Googles API would take requests and returns responses.
Describe what you know about JS as an Object oriented programming lanuage.
What do you know about objects, methods, and functions.
JS is an object oriented programming language, a OOP. This means that JS treats everything as it would objects. This means mainly that all functions can be passed into other functions, just as objects can.
Functions are collections of code that return a value upon completion of their being ran. Methods are functions that exist inside objects, and objects are collections of data-value pairs. Much of JS coding is dependent on the manipulation and use of objects, their methods and functions.
What is the entire process, to the best of your knowledge, by which your text files are translated to a web page and seen by users via a web browser.
Or how is Google seen by millions of users?
Page 73 and 74 of code notebook.
When you type ‘google.com’ into your browsers search box and click enter the following things happen:
- Your computer asks your router for an IP address ..
How do browsers communicate with servers.
What do the terms client side and server side mean?
…