C# Coding

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

ESLint

Checks syntax and common errors in JS when the project is built

Describe what happens when a browser requests a web page

Communication between clients (users) and servers is executed through an HTTP Request / Response process 1. A client (a browser) sends an HTTP request to the web 2. A web server receives the request 3. The server runs an application to process the request 4. The server returns an HTTP response (output) to the browser 5. The client (the browser) receives the response

JS function signature

Components of a JS function signature are the function name and the function parameters: function name(x, y....){} Note: Function names should be descriptive of the action performed, camel-case, and they must be unique across all JS code that's loaded into the page. If there is a name conflict, the function that's loaded last overwrites the other one. JS doesn't support method overloading.

Babel

Converts modern JS to JS code that is compatible with all major browsers

CRUD

Create, Read, Update, and Delete are the four basic operations of persistent storage. In terms of SQL it is Insert, Select, Update, and Delete

Vue Command Line Interface (Vue CLI)

Front end application that simplifies the work of setting up a project and creating new components. React: wild, wild, west...Angular: super strict...Vue: Goldilocks

JS Anonymous Functions

Functions that don't have names

HTTP POST vs HTTP GET

GET is used to request data from a specified resource. POST is used to send data to a server to create/update a resource.

HTTP POST vs PUT

Generally, in practice, always use PUT for UPDATE of an object in a database, and always use POST to CREATE an object in a database. PUT is considered idempotent because no matter how many times you perform the PUT operation, the results remain the same. You've just updated the resource with the same values again. POST isn't idempotent. Each time you POST, you create a new resource. If you POST a set of values five times, you've created five new resources.

Difference between HTML, CSS, and JavaScript

HTML, CSS, and JavaScript are the building blocks of the web. Each of these languages play their own significant roles in building the web: HTML: Provides the basic structure or markup of a document. CSS: Provides formatting of the document to control presentation and layout JS: Provides functionality and behavior and allows interaction with browser / website

What is a request header?

HTTP headers are used to pass additional information between the clients and the server through the request and response header. A request header is an HTTP header that can be used in an HTTP request to provide information about the request context, so that the server can tailor the response.

Why is HTTP a "stateless" protocol?

HTTP is called as a stateless protocol because each command requested is executed independently, without any knowledge of the request that was executed before it.

Node Package Manager (NPM)

Handles the required libraries and frame works for JavaScript applications

What is hoisting? /* Need more explanation here

Hoisting means "moving to the beginning of a scope." All function declarations are hoisted completely, variable declarations only partially. They are basically the same, but function declarations have two advantages over function expressions: They are hoisted, so you can call them before they appear in the source code. They have a name. However, JavaScript engines are getting better at inferring the names of anonymous function expressions.

HTTP / HTTPS

Hypertext Transfer Protocol / Hypertext Transfer Protocol Secure - the data transfer protocol created for the transfer of "hypertext resources", in other words, web pages. HTTPS is an encrypted protocol, and therefore, more secure

Primary key (PK)

In a relational database, each table must have a primary key, which is an attribute that uniquely identifies a specific row in a table. A primary key must always have a value and can not be null.

Inheritance

Inheritance allows subclasses to take on the properties and methods defined in a superclass. It is useful for code reusability: reuse fields and methods of an existing class when you create a new class

Component-based JavaScript

Instead of considering JS code as separate from HTML and CSS, component-based JS is an approach to JavaScript development that considers a webpage as a collection of components that join HTML, CSS, and JS into a single, functional unit. Angular, React, and Vue.js are all component-based JavaScript frameworks. Vue is a single-page application (SPA)

JavaScript Object Notation (JSON)

JSON is a data-interchange format that is language independent and human-readable. JSON is often used when data is sent from a server to a web page. JSON does not rely on or work only in JavaScript - it works in many programming languages.

JS Event Handling

JavaScript logic which responds to events that occur when users interact with a web page (scrolling, moving mouse over elements, clicking forms or buttons)

Encapsulation

Keeping details (like data and functions) together in one part of a program so that programmers working on other parts of the program don't need to know about them. Difference with abstraction:

Image tag

Links an image to a webpage and is a placeholder signifying where the image appears in the page. The <img> element has one required attribute: src, and another highly recommended attribute, alt. src specifies the path to the image. alt contains alternative text if the browser can't be display the image.

MVC (Model-View-Controller)

MVC is a design pattern used to decouple user-interface (view), data (model), and application logic (controller). This pattern helps to achieve separation of concerns. Makes applications scalable. Using the MVC pattern for websites, requests are routed to a Controller that is responsible for working with the Model to perform actions and/or retrieve data. The Controller chooses the View to display and provides it with the Model. The View renders the final page, based on the data in the Model. 1. Models are classes that represent the data in an application, define the properties of the data that you need to present, and provide the business logic and validation rules that must be enforced. 2. Views are the pieces of an application that display the user interface. 3. All incoming web requests from a client are routed to a controller that knows how to retrieve model data. The controller then determines how to return the data to the client and returns the appropriate view.

Can a GET request include a message body?

No, it is not advisable to include a message body with a GET request.

JS data types

Number; String; Boolean; Object; Null; Undefined

Object-oriented programming (OOP)

OOP is a programming model that organizes application development around objects. An object is a structure that combines state (properties / data) and behavior (methods) into a usable and useful abstraction. OOP is used to structure a software program into simple, reusable pieces of code blueprints (usually called classes), which are used to create individual instances of objects. Thinking in terms of objects when we program.

HTML forms

One of the most important parts of a website. You can use them to collect information from your visitors.

HTML attributes

Additional values that configure the elements or adjust their behavior in various ways to meet the criteria the users want.

URL - Uniform Resource Locator

Address of an online resource, like a website or a document. (Protocol:Sub-domain.domain name.tld)

Web API Endpoint

An API endpoint is the point of entry in a communication channel when two systems are interacting. It refers to touchpoints of the communication between an API and a server. It is a URL that enables the API to gain access to resources on a server.

Abstract class

An abstract class is a base class that you can't create an instance of. To use an abstract class, you must inherit from it. An abstract class is the basis for one of the main benefits of inheritance. It allows several classes which have features such as properties and methods in common to reference these common features by putting them in a base class.

HTML element

An individual component of HTML, such as its body, or a paragraph

Interface

An interface is a completely "abstract class", which can only contain abstract methods and properties (with empty bodies). Why use an interface? 1) To achieve security - hide certain details and only show the important details of an object 2) C# does not support "multiple inheritance" (a class can only inherit from one base class). However, it can be achieved with interfaces, because the class can implement multiple interfaces. Note: To implement multiple interfaces, separate them with a comma.

DOM (Document Object Model)

An internal data structure that browsers use to represent the structure and content of a web page. It is arranged as a tree structure, which is a hierarchical model of parent and child elements.

Foreign key (FK)

Attribute that allows database tables to be linked together; foreign keys are the primary keys of other tables placed in the current table to support the link between the two tables.

Differences between C# and JS

C#: Runs on the server-side | JS: Runs in browser C#: Compiled | JS: Interpreted C#: Must be syntactically correct or will not run | JS: May run, but won't give expected results; also may just stop running

Overloading vs Overriding

Overloading is the ability to have multiple methods within the same class with the same name, but with different parameters. Each of these methods has their own implementation as well, meaning that they can behave differently depending on what is passed in. Overriding is the ability to redefine the implementation of a method in a class that inherits from a parent class. When a method is overridden, the name and the parameters stay the same, but the implementation that gets called depends on the type of the object that's calling it. Mark the method as virtual in the parent class to signify that this method can be overriden by inheriting classes.

Subscribe

Part of the system can listen for certain messages to be published and perform logic in response to it

Publishing

Parts of the system can send messages out for other parts to act on

Polymorphism

Polymorphism means "the ability to have multiple forms." In object-oriented programming, polymorphism is the idea that something can be assigned a different usage based on its context. This specifically allows variables and objects to take on more than one form.

Event-driven interface

Program's logic doesn't run from start to finish, but the program is written to listen for user-triggered events, and then run a small piece of logic in response to it.

Publish/Subscribe model (browser events)

Programmatic way to pass messages between different parts of a system while keeping those different parts decoupled from each other, meaning that the parts don't have to know about each other, they just need to know which messages to watch out for

Hyper Text Markup Language (HTML)

Provides the basic structure or markup of a document.

What array methods do you know in JS, and what do they do?

Push / POP ; for/foreach; slice/splice; map; find/findindex; filter;

HTML REM vs EM

Refers to the sizing of content on a website REM = Relevant to size of the root document EM = Relevant to the size of the parent

Design Patterns

Represent best practices used in object-oriented software developments. Design patterns are solutions to general problems that software developers face during software development. (MVC is the pattern we've learned/used)

HTML <body> tag

Represents the content of an HTML document. There can be only one <body> element in a document

HTTP Request

Request from client to server. Contains an HTTP method (GET, POST, PUT, DELETE); path to resource client interacts; headers which contain information about the request; message body used when client sends data to the server

HTTP Response

Response from a server to a client. Contains an HTTP status code; headers which contain information about the response; message body used when server sends data to the client

How does scope work with LET and CONST in JS?

Scope means something is only available within the function that it is called. /* Needs a little more here */

Difference between C# and JS

See Matt's Notes from Jul-22

What data types does JS have?

See Matt's Notes from Jul-22

What happens if you pass too many parameters to a function in JS?

See Matt's Notes from Jul-22

querySelector

Selects single elements that don't have an ID. Takes a standard CSS selector and returns the first element it finds that matches that selector.

What is serialization?

Serialization is the process of converting an object into a stream of bytes in order to store the object or transmit it to memory, a database, or a file. Its main purpose is to save the state of an object in order to be able to recreate it when needed. The reverse process is called deserialization.

JS Functions

Similar to methods in C#/Java, they are callable blocks of code which can accept parameters and return values. They aren't limited to classes in JS, and are essentially about code reuse and avoiding duplication.

JS arguments

Special variable in JS which allows a function to handle an unknown number of parameters. Treats all parameters passed to the function as an array, even if no parameters are defined in the actual function definition.

HTML tag <html>

The root tag for an entire document. There can be only one <html> tag, and all other elements must be descendants of this tag.

Domain Name System (DNS)

The server a computer connects to when presented a website URL. It is like a phone book for websites which translates web addresses (www.howtogeek.com) into the internet protocol (IP) address for a website (172.217.15.78)

What is an event target?

The thing an event occurs on

Falsey values

false ' ' (empty string) 0 null undefined NaN

What is event bubbling?

<window> <div> <form> <button> If I click the button it will bubble up and a click will occur on the button, form, div, and window.

What version of .NET do we use?

.NET Core 3.1

Advantages of JS

1. No waiting for builds 2. Broader ecosystem (crosses all programming) 3. Fewer restrictions 4. Less focus on syntax 5. Dynamic programming is easy 6. Functions are "first-class citizens"

Key differences between let, var, and const (JS)

1. VAR declarations are globally scoped or function scoped while LET and CONST are block scoped. 2. VAR variables can be updated and re-declared within its scope; LET variables can be updated but not re-declared; CONST variables can neither be updated nor re-declared. 3. VAR and let can be declared without being initialized, const must be initialized during declaration.

What is a block level element?

A block-level element always starts on a new line and takes up the full width available (stretches out to the left and right as far as it can). Two commonly used block elements are: <p> and <div>

index.html

A common, default document used to begin development of a website

Constructor

A constructor is a special method that is used to initialize objects. The advantage of a constructor, is that it is called when an object of a class is created. It can be used to set initial values for fields. All classes have constructors by default: if you do not create a class constructor yourself, C# creates one for you. However, then you are not able to set initial values for fields

CSS (Cascading Style Sheets)

A language that can be used to style a web page via changes in colors, sizes, spacing, fonts, and more

Client/Server

A network architecture in which a system is divided between the instructions received from clients requesting information and the server tasks performed to fulfill the client request.

Transpiler

A program which converts one programming language into another. A transpiler converts Vue source code into a version of JS that's more compatible with web browsers.

Reference data types

A reference data type does not contain the actual data for the variables, but refers (points) to the data. Objects and arrays are the most common example of a reference data type. The data is stored on the heap, and the variable reference (name) points to the location of the data on the heap

Application Programming Interface (API)

A software interface that allows two applications to talk to each other and allows the transfer of data between different computer applications. A Web API is an API that is accessible on the internet. In essence, an API is a messenger that pulls information from one place and feeds it to another.

Class

A user-defined data type that groups variables and methods in a source code file, from which objects can be created. A class is like a blueprint is to a house.

What is ASP.NET?

ASP.NET is a Microsoft web development platform. ASP and ASP.NET are server side technologies .

For loop vs foreach loop

Both a for loop and foreach loop provide a procedure for looping/executing a set of statements. For loop has more control/flexibility on how the loop is executed and how many times it is executed. A foreach loop basically iterates across every element within a collection.

Responsive design

Designing a website so that it changes depending on the device on which it is displayed.

Stateless request

Each request from the client to the server must contain all of the necessary information to understand the request. There is no stored context on the server. The application's session state is therefore kept entirely on the client

== vs ===

Equals vs strictly equals "1" == 1 : True (value quality only) "1" === 1 : False (value and type quality)

JavaScript = ECMAScript

European Computer Manufacturers Association Script

HTML tag

The code used to indicate to the browser where an element begins and ends, such as <p>...</p>

Primitive data types

The data for the variable is stored on the stack. Byte, short, int, long, float, double, char, boolean are primitive data types

CSS Specificity (0,0,0) (ID, Class, Element)

The importance, based on specificity, with which CSS style rules are applied, IDs are more specific than classes, which are more specific than tag selectors, if two rules with equal specificity are active, the bottom one is applied.

HTML <title> tag

The page title is the text that appears in the tab of your browser window. The page title is metadata, which belongs in the <head> of your document.

HTML <head> tag

The part of an HTML document that contains metadata about that document, such as the author, description, and links to CSS or JavaScript files that apply to the HTML

Subdomain

The part of the URL which contains a website's homepage and its most important pages. The most common subdomain is www, which stands for World Wide Web

Anchor tag <a> </a>

The primary purpose of an anchor tag is to link one page to another page or to a section of the same page. Defines a hyperlink. It adds the hyper to hypertext, and is at the heart of the Hypertext Transfer Protocol and the web

Second Level Domain (SLD)

The unique part of the domain name, often a business or brand name.

Semantic HTML

The use of HTML markup to reinforce the semantics, or meaning, of the information in webpages rather than merely to define its presentation or look.

What is an arrow function? (Lambda)

There is no "function" declaration

getElementById()

This function gets a single HTML element from the DOM and returns a reference to it

Language Integrated Query (LINQ) requires `using System.Linq;`

This provides a set of methods and expressions that can be used to query data sources without writing text-based queries or dealing with low-level implementation specifics.????

Emmet

Tool that helps write HTML and CSS faster. It's built into Visual Studio Code.

Top-level domain (TLD)

Top-level domains, also known as TLDs or domain extensions, are the final segment of your website domain. The group into which a domain is categorized, by common topic (company, educational institution) and/or geography (country, state).

What's the difference between Null and undefined

Undefined means it doesn't exist, null means there is nothing there

querySelectorAll

Used to get all of the items and returns a NodeList of all the elements, which can be uses as an array

JQuery vs document.querySelector / .querySelectorAll

Very similar and can be an answer to interview question on whether we've used JQuery

What is an event and how do you work with it in JS?

click; dblclick; blur; focus (case matters on events)


Set pelajaran terkait

Medical mathematics & number basics

View Set

Chapter 5 - Integumentary System

View Set

Chapter 9 - The complex carbohydrates: starches, cellulose, gums, and pectins

View Set

Web Programming C298 (JavaScript)

View Set

Biology- Sustainability & Interdependence

View Set

What Was Ancient Civilization in Greece Like?

View Set