Blazor:
- UI web framework based on .NET
- .NET based web framework for building UI components(Razor components)
- compiles to Web-Assembly (wasm)
Design principle: loose coupling
corollary of principle of least privilege
example
object a b c
a calls b and should know nothing about b's internal structure
if c is inside b, a should know nothing about c
the mistake is: you could write a to call c(inside b) which would introduce coupling and harder debugging
https://stackoverflow.com/questions/32304595/whats-the-difference-between-self-and-self
Self is the type of the current object. It may appear either in a trait or an impl, but appears most often in trait where it is a stand-in for whatever type will end up implementing the trait (which is unknown when defining the trait):
trait Clone {
fn clone(&self) -> Self;
}
If I then implement Clone:
Will I use this function anywhere else?
If the answer is yes, I name/define it. If not, pass it as an anonymous function.
If you only use it once, it doesn't make sense to crowd the global namespace with it. (namespace budgeting)
code --> [ serialize ] --> JSON --> [ deserialize ] --> code
ws = whitespace
{
"property": "value"
}
camelCase
PascalCase
kebab-case
snake_case
A Turing tarpit (or Turing tar-pit) is any programming language or computer interface that allows for flexibility in function but is difficult to learn and use because it offers little or no support for common tasks.
Beware of the Turing tar-pit in which everything is possible but nothing of interest is easy. - Alan Perlis, Epigrams on Programming, 1982
typical cpu clock rate = 2.4 GHz = 2.4 * 10^9 Hz = 2.4E9 Hz
2.4E9 CPU clock cycles/ 1 sec = 2.4E9 clock cycles / 1E9 ns
Typical operation timings src
TypeScript setup
typscript is a classed superset of javascript and has
typescript.ts -> tsc -> javascript.js -> browser
tsc is the typescript compiler and is a node package installed with npm (node package manager)