Your Coding Teacher
380 subscribers
10 links
Coding, software engineering & #bitcoin technologies. I'll make you a better thinker, not just a better developer | Ex
Amazon, Senior DevOps @eBay
Download Telegram
5 Tools for devs

- IDE: Intellij/VS Code
- Lightweight editors: Vim/Emacs
- Python interactive shell (for small snippets of code, calculator, ...)
- Git: learn it well
- Shell - learn bash/zsh well
In GCP, identities are represented by Google accounts. There are different types:

- Google accounts. For people
- Service accounts (SAs). For apps, services, vms,...
- Google Groups (of users and SAs)
- G Suite Domain: for orgs
- allAuthenticatedUsers
- allUsers
Algorithmic paradigms

- Divide & conquer: combine non-overlapping subproblems. Merge sort
- Dynamic programming: overlapping subproblems + optimal substructure -> optimal solution. Fibonacci
- Greedy: best choice at each step to arrive to optimal global solution. Dijkstra
Object-oriented programming (OOP) is a programming paradigm based on the idea of "objects", which can contain attributes and functions to operate on them.

Simula is considered the first language with the primary features of an object-oriented language. It was created in 1967.
Classic MATLAB interview question:

What's the difference between A' and A.'?

A' performs conjugate transpose, A.' only tranpose. The results are only different if you're dealing with complex numbers
"No one hates software more than software developers."
- Jeff Atwood
Java is to JavaScript what Car is to Carpet
Every application or service you want to develop has:

-Functional requirements: what is it supposed to do?
- Non-functional requirements: security, robustness, scalability, and maintainability

Both are important
Dijkstra is a greedy algorithm to find the shortest paths between 2 nodes in a graph.

It was developed by Edsger W. Dijkstra in 1956.

In 1968, A* was published. It achieves better performance by using heuristics to guide its search.
Errors should never pass silently

Unless explicitly silenced

- The Zen of Python
GCP Resource Manager manages

- Organization. Root node in the resource hierarchy. Optional
- Projects. Required to create resources. Prod vs Dev envs
- Folders. Extra level of project isolation. Departments in a company. Optional
- Resources. VMs, load balancers, and so on.
"A computer programmer is a device for turning coffee into bugs."
- Bram Moolenaar
You are still writing if-else statements and while loops, like 60 years ago.

Never forget the fundamentals
Race condition: the end result of multiple operations depends on the sequence of uncontrollable events

Examples:

- Dirty reads/writes: Client X read/overwrites a value ClientY has written but not commited
- Read/Write skew
- Phantom reads
- Lost updates
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
- Martin Fowler
Use const (in C++) or final (in Java) when something is not supposed to change.

Compilers can detect if you're attemping to change a const/final variable

Humans will understand better the code.
Can you find what's wrong with this piece of code?

It's supposed to delete the head of a linked list

void removeHead(Node *head){
delete head;
head = head->next;
}
It's fun to write code alone, but writing code that is successful is a collaborative activity
If you can build it, your users can break it
Arrays

- Constant-time random access. Map to a memory address
- Space efficient. Just the data
- Data locality. Better cache usage (image scanning all elements)
- Fixed size. Overcomed by allocating huge arrays (wasteful) or resizing dynamically (good amortized performance)
Cloud Armor protects your infrastructure from DDoS attacks

You define rules (for example to whitelist or deny certain IP addresses or CIDR ranges) to create security policies

These policies are enforced at the Point of Presence level (closer to the source of the attack)