til.duyet.net
blog
Search…
til.duyet.net
🤪
Today I Learned
Data Engineering
☁
AWS
⚒
Tools
💻
Shell
☸
Kubernetes, Helm, Kustomize
🔄
Apache Airflow
🐳
Docker
Database
Google BigQuery
Apache Hive
AWS Redshift / Postgres
Presto
Programming
🍪
Rust
cheats.rs
Imperative vs Declarative
Generate Struct from JSON
🐍
Python
👻
Golang
💎
Javascript / Typescript
✨
FE / React
Unix
Git - Pretty git branch graphs
Checking files in Docker build context
Bash get the directory of the current script
Vim
Find and replace
Miscellaneous
[Fig] Single machine and distributed system structure
Deploying Machine Learning Models at Scale
Bypass a Chrome certificate/HSTS error
Articles
Powered By
GitBook
Imperative vs Declarative
Declarative programs
we are describing
what
to do, rather than
how
to do it.
Imperative
1
let
mut
sum
=
0
;
2
for
i
in
1
..
11
{
3
sum
+=
i
;
4
}
5
println!
(
"{}"
,
sum
);
Copied!
Declarative
Imperative
1
let
mut
sum
=
0
;
2
for
i
in
1
..
11
{
3
sum
+=
i
;
4
}
5
println!
(
"{}"
,
sum
);
Copied!
Declarative
Declarative programs
we are describing
what
to do, rather than
how
to do it.
1
println!
(
"{}"
,
(
1
..
11
).
fold
(
0
,
|
a
,
b
|
a
+
b
));
Copied!
Previous
cheats.rs
Next
Generate Struct from JSON
Last modified
6mo ago
Copy link
Edit on GitHub
Contents
Imperative
Declarative
Imperative
Declarative