Skip to content

Commit

Permalink
✨ Config hightlight and more
Browse files Browse the repository at this point in the history
  • Loading branch information
H2Sxxa committed Jan 5, 2024
1 parent 1f315d1 commit ac3fce6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
27 changes: 23 additions & 4 deletions source/_posts/about_code_aesthetic.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,18 +199,37 @@ fn find_min_index(vec: Vec<i32>) -> usize {

#### 抽象

设计模式往往与抽象有关
设计模式往往与抽象有关,因此知道什么是抽象实际上是必要的,什么是抽象?抽象是从几个具体的事物抽离相似的部分,简单地从一段代码实例来说

```java
```python
class Pig:
def drink(self): ...
def eat(self): ...
...

class Dog:
def drink(self): ...
def eat(self): ...
...
```

可以看到`Pig``Dog`拥有相同的特征,`eat``drink`,把共同的特征抽离出来就是`Animal`,这就是一个抽象,此外,我们还可以把`Animal`定义为一个抽象类(Abstract Class)

```python
class Animal(ABC):
def drink(self): ...
def eat(self): ...


class Pig(Animal)
class Dog(Animal):...
```

TODO


## 参考文献

[^1]: [四种基本的编程命名规范 - 知乎](https://zhuanlan.zhihu.com/p/89909623)
[^2]: [C#官方文档中的接口](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/keywords/interface)
[^3]: [Confused about the Interface and Class coding guidelines for TypeScript(StackOverflow)](https://stackoverflow.com/a/41967120/4676238)
[^4]: [如何做好抽象?- 知乎](https://zhuanlan.zhihu.com/p/375730170)

4 changes: 2 additions & 2 deletions themes/fluid/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ code:
# 在链接中挑选 style 填入
# Select a style in the link
# See: https://highlightjs.org/static/demo/
style: "github gist"
style_dark: "dark"
style: "atom-one-light"
style_dark: "atom-one-dark"

prismjs:
# 在下方链接页面右侧的圆形按钮挑选 style 填入,也可以直接填入 css 链接
Expand Down

1 comment on commit ac3fce6

@vercel
Copy link

@vercel vercel bot commented on ac3fce6 Jan 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.