yaobinwen / robin_on_rails

Robin on Rails: my notes about technology and some other knowledge.
1 stars 0 forks source link

Thinking in software development #157

Open yaobinwen opened 1 year ago

yaobinwen commented 1 year ago

Description

This issue tracks my thoughts on software development. I may extend every comment into an article to talk more about it.

yaobinwen commented 1 year ago

Error Reporting and Handling

See yaobinwen/error-handling.

yaobinwen commented 1 year ago

OOP and Encapsulation

OOP promotes encapsulation, saying that the API users should not have to know the implementation details. This only works if the API is fully documented. Many times, when the users run into a problem, they do not have the sufficient information to understand the internal behaviors especially when the documentation cannot explain the observed behaviors. In this case, the users should be able to look into the implementation details to figure out what is going wrong.

In other words, encapsulation works well only when the implementation details can be easily obtained when necessary.

yaobinwen commented 1 year ago

Full Configurability

The software should be broken into small reusable pieces to avoid duplicated code. The final software is integrated by putting all the pieces together. (In fact, COM has been trying to do this because it provides binary level interface.)

yaobinwen commented 1 year ago

Switch logging modes dynamically

We don't want to write too many log messages (e.g., the debug level) for release builds. However, we should make it easy to re-enable debug level logging at run time, so the users don't need to recompile the code.

Envoy's runtime configuration seems to work this way.

yaobinwen commented 1 year ago

Documentation

(Refer to yaobinwen/document-shredded.)

The knowledge should be presented in levels: Lower levels are more fundamental than the upper levels. In other words, in order to understand the upper levels, one needs to understand lower levels.

However, sometimes a few concepts may be related with each other and cannot be divided into levels. In this case, they should be put into a "focus group" to allow the learners to study them altogether.

If possible, the knowledge should be presented in a "graph" to make it easier for the users to figure out what else should be studied. Using a lot of external links is not the best way.

In other words, maybe we should let the readers read the documentation bottom-up, not top-down. However, they have pros and cons:

Example: I'm reading Envoy's documentation. This page talks about "listeners" but in order to understand it, I must read a few other external links: filter_chain, filter_chain_match, filter. I wish the documentation could have explained them before I have to study listeners.

yaobinwen commented 1 year ago

Progress Tracking

Every part of the software that potentially take long time to finish should probably provide some kind of progress update mechanism, so the caller can tell the progress and send feedback to the caller's caller.

yaobinwen commented 1 year ago

Taking Notes

  1. Notes should not have to have a file name. Similar to a tweet: You don't give your tweet a tweet name. You just publish the content.
  2. The problem with tweets are: they can't be linked to each other; they can't be easily modified (?); they can't be easily broken into smaller ones, or merged together when you find two are related.

For the note taking system:

  1. Just throw in the contents.
  2. The topics will emerge gradually.
  3. Able to break one into smaller ones, or merge multiple ones into one.
  4. Able to link one note to another.

(Ask ChatGPT how to implement it.)

yaobinwen commented 1 year ago

Logging

yaobinwen commented 5 months ago

Will AI fully replace human programmers?

See this Linked-in post.

Possibly, we call them "programmers".

===

In the early days, programmers must understand hardware and write code for the hardware. When OS became more mature, programmers nowadays no longer need to understand hardware that much but learn how to program using the services that the OSs provide. In the future, we probably do AI-oriented programming.

===