《OOC》笔记(0)——为何要看这本书

《OOC》笔记(0)——为何要看这本书

《OOC》全名是《Object-oriented Programming with ANSI-C》,作者Axel-Tobias Schreiner写于1993年10月。全书221页,步步为营地讲述了作者用C来实现封装、继承、多态、异常处理和自动化工具的过程。

为何要看这本书

这本书吸引我的理由如下:

  • 我也研究过OOC的问题 ,想和作者对比对比,取长补短。
  • 学习C实现异常处理try{}catch()finally{}的方法。
  • 学习C语言中一些难缠的东西的用法。(const、static、extern、…)
  • 学习作者的自动化方法。

 

利用这几天粗略读了一遍,整体感觉还是有收获的,是本务实的书。这本书已经出了20多年了,至今仍有借鉴意义。

我认为,《OOC》中关于封装继承多态的写法不如我的写法,因为我更喜欢尽可能保守的类型安全的写法。毕竟能用是最基本的要求,跑得快是之后才有意义的问题。

作者使用的自动化工具awk我也不想学,我有我自己的工具,不必妄自菲薄。

关于异常处理、"难缠的东西"值得体会。

OOC这个小系列

除本文外,本系列计划分4篇,陈列如下。

《OOC》笔记(1)——C语言const、static和extern的用法

《OOC》笔记(2)——C语言实现trycatchfinally

《OOC》笔记(3)——C语言变长参数va_list的用法

《OOC》笔记(4)——自动化地将C#代码转化为C代码(结构版)

再往深入写的话,非我的时间精力所能及,暂且到此为止吧。

《OOC》pdf英文版及其附带代码我都不提供了。因为本系列写完后我就不必再看了,白白占用空间。

吐槽

国内的计算机教程大多如汉堡,tasty却是junk food。国外原版教程大多如馒头,不够美味,但细细咀嚼却有麦芽糖的甜感。外文翻译版常如炸旧馒头片,tasty一点,却又失掉了什么。至于各种大学教材,味同嚼蜡,不提也罢。

我希望我写的东西,能如杂粮煎饼,简单好吃又营养。

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
没有任何一种编程技术能解决所有问题; 没有任何一种编程语言只输出正确的结果; 没有任何一个程序员需要从零开始一个项目。 -----这三句似曾相识? 这是一本17年前的书,写的是用纯C来实现OOP。。。 亘古的C,永远的C。。。 关天C,我没有其它要说的了。 关于这个资源,还有一句:原书+源码,全在这儿 我希望10年后我还在读它,看它。。。 No programming technique solves all problems. No programming language produces only correct results. No programmer should start each project from scratch. Object-oriented programming is the current cure-all — although it has been around for much more then ten years. At the core, there is little more to it then finally applying the good programming principles which we have been taught for more then twenty years. C++ (Eiffel, Oberon-2, Smalltalk ... take your pick) is the New Language because it is object-oriented — although you need not use it that way if you do not want to (or know how to), and it turns out that you can do just as well with plain ANSI-C. Only object-orientation permits code reuse between projects — although the idea of subroutines is as old as computers and good programmers always carried their toolkits and libraries with them. This book is not going to praise object-oriented programming or condemn the Old Way. We are simply going to use ANSI-C to discover how object-oriented programming is done, what its techniques are, why they help us solve bigger problems, and how we harness generality and program to catch mistakes earlier. Along the way we encounter all the jargon — classes, inheritance, instances, linkage, methods, objects, polymorphisms, and more — but we take it out of the realm of magic and see how it translates into the things we have known and done all along. I had fun discovering that ANSI-C is a full-scale object-oriented language. To share this fun you need to be reasonably fluent in ANSI-C to begin with — feeling comfortable with structures, pointers, prototypes, and function pointers is a must. Working through the book you will encounter all the newspeak — according to Orwell and Webster a language ‘‘designed to diminish the range of thought’’ — and I will try to

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值