一个大学毕业N年的菜鸟对程序设计的几点体会

kou369830863 2011-11-28 06:08:27
一个大学毕业N年的菜鸟对程序设计的几点体会

-v0.01-2011-11-28

我从军医大毕业8年了,以前懒散学编程,最近两、三年开始认真学编程了,现在谈谈个人体会,不妥之处欢迎拍砖:

1:C++好啊,为什么叫C++呢,意思就是C的超集,不明白为什么还有人在讨论C和C++哪个好,类似于讨论中国和广东哪个好一样无聊啊。

2:C++好啊,学会了C++,很多语言就是小菜啊。只可惜C++ primer和The C++ Programming language上的习题难度真大啊,每道题最好都要力争用两种以上方法解出来,反正我是95%的时间都用来做题,调试了,那些宣称很快就能很快看完书的人,你们是不是应该好好做题啊,单看书我估计2个月就能看完了,因为我英文阅读水平也不是很差啊,但时间全用到做题上了,可怕的习题啊,更可怕的调试啊,看书不是目的啊,把上面的题目都做出来,例子都做好笔记才是最最关键的啊,可惜大多数人看书都是皮毛啊。

3:汇编真复杂啊,一本《The Art of Assembly Language》1600页,注意不是亚马逊美国上的阉割版,更不是中国的翻译版,而是网上下载版,看死我了,还要把课后习题都做出来,可恨的HLA啊,可恨啊,加上做题估计这本书飙升到3000页了,不懂汇编就不能深刻理解高级语言啊,3000页也得拼命看啊。看完以后貌似还有一套叫什么 计算机编程艺术 的书还得看,也用得是一种比较特殊的汇编,又是几千页!

4:数学真重要啊,代数、几何、微积分、离散数学、线性代数、矩阵计算、概率论、数理统计、随机过程、数论、近世代数、博弈论、具体数学、运筹学、复变函数、拓扑学、复分析、实分析、复变函数、组合数学,等等等等。妈呀,要学好编程单学习数学就得学10年啊,学精通得至少30年,我的体会是以上课程要用英文经典教程,配合习题集,力争独立完成每一道习题,当然还是英文版,呵呵貌似
华罗庚就是这么学的。负担太重了,一本stewart的微积分加上习题集3000页,一本离散数学及其应用加习题集1900页,妈啊,路漫漫啊。

5:说数学对编程无用的人,估计更是菜鸟啊,或者混淆视听啊,不多说了。我大学高等数学刚及格,那个后悔啊,真可谓年少不努力,老大徒伤悲啊。

6:学好编程,单单打好数学基础就要至少10年,为什么有些30岁的小伙子,25岁的小年轻,甚至18岁的孩子们就敢说自己精通编程了,我的苍天啊,是不是
我太笨了还是你们学习得太快了啊,我觉得除非你是布劳恩再世,一般人还是把菜鸟当老鸟了吧,老老实实学习吧。

7:不要根我说这个语言,那个语言,我觉得都是一回事啊,目前个人觉得需要掌握的语言就是C++和汇编啊,其他的可以触类旁通啊。

8:什么数据结构啊,什么算法啊,什么思想啊,那个原理啊,什么这个系统,那个体系、工程啊,统统都不重要。要想成为大牛和牲口,你需要的就是:狂数学数学再数学,狂做题做题再做题,狂纯英文纯英文再纯英文,其他真的都是浮云啊。只可惜绝大多数人一见英文数学书就头疼啊,悲剧往往是绝大多数人。

9:要想成为编程高手,不是上什么博士后,博士,硕士,本科,大专,高中,初中,小学就能搞定的,那些都没用,你需要的是时间和不浪费时间去学上面所说的,可惜绝大多数人,包括我在内,都是悲剧啊,都没做到啊。

10:最后一句:一个人的寿命太短了,时间干掉的是所有人。
...全文
684 34 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
34 条回复
切换为时间正序
请发表友善的回复…
发表回复
AppleTree_zm 2012-02-19
  • 打赏
  • 举报
回复
楼主说的很有道理,我深有同感,目前仍在恶补数学中,尽管当年本科学的还是数学···,但是也就勉强及格出来了。那个时候觉得搞不懂数学的作用,今天深刻理解了,所以又把当年没学会的重学一遍,呵呵
kou369830863 2011-12-06
  • 打赏
  • 举报
回复
一个大学毕业N年的菜鸟对程序设计的几点体会

-v0.04-2011-12-2

引言:
我从军医大毕业8年了,以前懒散学编程,最近两、三年开始认真学编程了,现在谈谈个人体会,分别从编程语言及如何深入理解编程语言,相关基础知识,编程哲学思想这几个方面扯几句,不妥之处欢迎拍砖:

1:学什么呢?个人觉得学C++挺好,为什么叫C++呢,意思就是C的超集,C能支持的C++也支持(需要足够的编译环境),不明白为什么还有人在讨论C和C++哪个好,类似于讨论中国和广东哪个好一样无聊啊,我觉得用相对较短的代码达到相对较快的执行速度以完成不同复杂度的任务才是需要重点关注的问题。

2:既然C++挺好,学会了C++,很多语言就是小菜,那怎么学呢?看书!只可惜 Stanley Lippman的《C++ Primer》 4th和Bjarne Stroustrup的《The C++ Programming Language》 3rd上 的习题难度还是不小的,且现存的答案资源不是很让人满意(解题繁琐,答案不完整),建议解题最好都要亲自操刀,力争用两种以上方法解出来,反正我是95%的时间都用来做题和调试了,那些宣称很快就能很快看完书的人,真的应该好好做题了,不做题是不能体现看书效果的,仅仅是看书不能互动性的思考书上的知识点,当然看书和做题需要一定的耐心、时间、编译环境和英文阅读、写作水平。但我觉得:看书不是目的,最重要的,是把书中的练习题认真做出来并争取补写完整编译执行,书中的例子用键盘敲到计算机里并争取补写完整编译执行,编译通过的代码应作为重要的个人资料保存,随着认识的深入不断修改和完善存档资料,要学会类举和模仿,为将来更进一步的学习打好基础。

3:要进一步理解上述的高级语言,汇编语言是有必要掌握的,国家举办的程序员高等级考试很多地方都用到它了,我手头有一本自己打印制作的Randall Hyde的《The Art of Assembly Language》,近1600页(注意不是亚马逊美国上的阉割版,更不是中国的翻译版,而是网上下载版),看的人很累且书写的也比较啰嗦,还要把课后习题都做出来,里面用到的HLA也让人些许有陌生感,加上做题估计这本书飙升到3000页了,需要很强的意志力才能坚持下来。看完以后貌似还有一套Donald Knuth写的《The Art Of Computer Programming》需要看,用得是一种比较特殊的类似汇编的一种语言,又是几千页!

4:真正学好以上的这些书本上的知识是需要一定的数学基础的,你掌握多少数学知识很可能决定了你在编程上能走多远。根据Mathematics Subject Classification 2010的相关资料, 数学分为5大分支(作为高深数学的门外汉,我翻译的不是很专业请谅解,后附上英文名):

1)基础数学(foundations):数学哲学思想(philosophy of mathematics),
数学建模(Mathematical modeling),
逻辑(logic),集合论(set theory),证明理论(proof theory)

2)离散数学和代数(Discrete mathematics / algebra):
组合数学(combinatorics),排序理论(Order theory),
代数(algebra),数论(Number theory),域和多项式(Field theory and polynomials),
交互环和几何(Commutative rings and algebras),代数几何学(Algebraic geometry),
线性代数及矩阵理论(Linear and multilinear algebra; matrix theory),
协同环及协调几何(Associative rings and associative algebras),
非协同环及非协调几何(Non-associative rings and non-associative algebras),
分类理论与同源代数(Category theory; homological algebra),K-理论(K-theory),
群论(Group theory),拓扑群(Topological groups)

3)分析(Analysis):实函数(Real functions),测量与整合(Measure and integration),
复变函数(Complex functions),潜力论(Potential theory)
多复变量与解析空间(Several complex variables and analytic spaces),微积分(calculus)。

4)几何与拓扑(Geometry and topology):几何学(Geometry),
凸面和离散几何(Convex geometry and discrete geometry),微分几何(Differential geometry)
普通拓扑学(General topology),代数拓扑(Algebraic topology),多面(层)(Manifolds),
Global analysis, analysis on manifolds (including infinite-dimensional holomorphy)

5)应用数学(Applied mathematics):
概率论与随机过程(Probability theory and stochastic processes),
统计学(Statistics),计算机科学,博弈论(Game theory)

要学好编程单学习数学就得学10年啊,学精通得至少30年,我的体会是以上课程要用英文经典教程,配合习题集,力争独立完成每一道习题,当然还是英文版,呵呵貌似华罗庚就是这么学的。负担太重了,一本Stewart的微积分加上习题集3000页(第五版),一本离散数学及其应用加习题集1900页(第五版)。如此厚重的书本,可见学习乃路漫漫其修远兮。
扯了这么多,现在推荐些书供参考,根据经济状况和获取难易度,本人推荐:
人民邮电出版社-原版数学统计学系列(价格相对以下系列是最贵的,是图灵分公司出版的);
机械工业出版社-经典原版数学相关(貌似性价比最高,好像是50多本,我有大约20多本,不过大部分都是2-4折购买的);
科学出版社数学-研究生原版书籍(估计国家为出版这些书补贴了不少钱);
世界图书出版社-数学原版系列(国家为出版这些书也补贴了不少钱);
高等教育的原版数学系列(不是很多,但很便宜也很经典)。
此外还有天元基金资助系列等等,这次暂时不多说了,当然如果你钱多,也可以去亚马逊美国买原版,价格估计是影印的10倍以上吧。
另:从以上书籍如此便宜的价格和质量,也体现了国家对于呼唤和培养高端人才的良苦用心啊!

5:数学和编程关系的补充阐述。
说数学对编程无用的人,估计是菜鸟或混淆视听。简单来说:程序设计是计算机科学的一个分支,而计算机科学是应用数学的一个分支,应用数学是数学科学的一个大分支,可见这几者的关系,其他不多说了。我大学高等数学刚及格,那个后悔啊,真可谓年少不努力,老大徒伤悲啊。
学习过程是漫长的。学好编程,单单打好数学基础就要至少10年,不打好数学基础你只能在代码工人或有经验的代码工人这一阶层徘徊。我有时在想:为什么有些30岁的而立,25岁的小年轻,甚至18岁的孩子们就敢说自己精通编程了,苍天啊,除非你是布劳恩再世,还是老老实实学习吧,不要当井底癞蛤蟆。

6:透过现象看本质。程序设计的数据结构、算法、思想、原理、某模式、某系统、某体系、某工程、某模式,其实统统都不重要(但不代表可以不用学),要想成为大牛大师,你需要的就是:狂数学数学再数学,狂做题做题再做题,狂计算计算再计算,挖掘数学本质再挖掘再挖掘,狂抽象抽象再抽象,狂纯英文纯英文再纯英文(如果你还在边看英文版边不停查字典多年,你也快挂了),其他真的都是浮云啊。只可惜绝大多数人一见英文数学书就头疼,故悲剧往往是绝大多数人,人类近几百年来庞大的数学积累使得我们需要站在巨人的巨人的巨人的尸体上才能有所建树。

举例1:如果你把离散数学及其应用第五版的图论、关系、集合论学好了题目真正做好了、领会了、旁通了,你看MIT的那本算法导论第三版也就小菜了(MIT的那本书没有完整的习题解答,看起来很不划算,参考参考还可以。)

语言是相通的,个人觉得需要掌握的语言就是C++和汇编(仅仅是个人观点),其他的可以触类旁通,当然你也可以学习其他的语言来触类旁通。

7:关于时间,学历和寿命。要想成为编程高手,不是上什么博士后,博士,硕士,本科,大专,高中,初中,小学就能搞定的,那些都不是核心,你需要的是时间和不浪费时间,在你有限的寿命范围内(一般情况0到120年),去学上面所说的,可惜绝大多数人,包括我在内,都没做到。

8:关于成才环境。要想成功:最好一个人关在小黑屋里面,除了获取知识的必要沟通外,建议尽可能与世隔绝,如果你想边上网,聊天和游戏,边成为设计高手,真得难度很大;嘈杂的环境,多线程的思维,反复的移动和迁徙,都是阻碍成功的不利因素。

9:年纪大了怎么办?任何行业都是活到老学到老,你会越来越吃香;反之,如果你仅是一名搬运工,只掌握最基本的扛东西的能力,随着年龄的增长,你的技能却没有响应提高,但体能却在随着时间的推移而衰减,你可能会出局,做coder的同理。只是遗憾的是能一直坚持学习的人太少了。

10:悲剧是永恒的。一个人的寿命太短了,时间干掉的是所有人,学得好也没什么了不起,学得差也不用担心,迟早得去阎王爷那里报到,呵呵。
leaderYU 2011-12-04
  • 打赏
  • 举报
回复
感觉有很大的启发意义,真的要下苦功夫啊
天云 2011-12-03
  • 打赏
  • 举报
回复
[Quote=引用 19 楼 zhao4zhong1 的回复:]

别忘了“学以致用”!

英语也是一门计算机语言的说。

对学习编程者的忠告:
眼过千遍不如手过一遍!
书看千行不如手敲一行!
手敲千行不如单步一行!
单步源代码千行不如单步对应汇编一行!
[/Quote]

++
kou369830863 2011-12-03
  • 打赏
  • 举报
回复
对下一个v0.05版本的修改建议:
1.仔细修改每一条的语句,语句中仍有病句和不流畅的现象;
2.揣摩标题,并适当修改;
3.强化每条间的逻辑关系;
4.修改英文单词排版,保证同一单词不跨行;
5.考虑将v0.05用英文写一遍?
kou369830863 2011-12-02
  • 打赏
  • 举报
回复
一个大学毕业N年的菜鸟对程序设计的几点体会

-v0.04-2011-12-2

引言:
我从军医大毕业8年了,以前懒散学编程,最近两、三年开始认真学编程了,现在谈谈个人体会,分别从编程语言及如何深入理解编程语言,相关基础知识,编程哲学思想这几个方面扯几句,不妥之处欢迎拍砖:

1:学什么呢?个人觉得学C++挺好,为什么叫C++呢,意思就是C的超集,C能支持的C++也支持(需要足够的编译环境),不明白为什么还有人在讨论C和C++哪个好,类似于讨论中国和广东哪个好一样无聊啊,我觉得用相对较短的代码达到相对较快的执行速度以完成不同复杂度的任务才是需要重点关注的问题。

2:既然C++挺好,学会了C++,很多语言就是小菜,那怎么学呢?看书!只可惜 Stanley Lippman的《C++ Primer》 4th和Bjarne Stroustrup的《The C++ Programming Language》 3rd上 的习题难度还是不小的,且现存的答案资源不是很让人满意(解题繁琐,答案不完整),建议解题最好都要亲自操刀,力争用两种以上方法解出来,反正我是95%的时间都用来做题和调试了,那些宣称很快就能很快看完书的人,真的应该好好做题了,不做题是不能体现看书效果的,仅仅是看书不能互动性的思考书上的知识点,当然看书和做题需要一定的耐心、时间、编译环境和英文阅读、写作水平。但我觉得:看书不是目的,最重要的,是把书中的练习题认真做出来并争取补写完整编译执行,书中的例子用键盘敲到计算机里并争取补写完整编译执行,编译通过的代码应作为重要的个人资料保存,随着认识的深入不断修改和完善存档资料,要学会类举和模仿,为将来更进一步的学习打好基础。

3:要进一步理解上述的高级语言,汇编语言是有必要掌握的,国家举办的程序员高等级考试很多地方都用到它了,我手头有一本自己打印制作的Randall Hyde的《The Art of Assembly Language》,近1600页(注意不是亚马逊美国上的阉割版,更不是中国的翻译版,而是网上下载版),看的人很累且书写的也比较啰嗦,还要把课后习题都做出来,里面用到的HLA也让人些许有陌生感,加上做题估计这本书飙升到3000页了,需要很强的意志力才能坚持下来。看完以后貌似还有一套Donald Knuth写的《The Art Of Computer Programming》需要看,用得是一种比较特殊的类似汇编的一种语言,又是几千页!

4:真正学好以上的这些书本上的知识是需要一定的数学基础的,你掌握多少数学知识很可能决定了你在编程上能走多远。根据Mathematics Subject Classification 2010的相关资料, 数学分为5大分支(作为高深数学的门外汉,我翻译的不是很专业请谅解,

后附上英文名):

1)基础数学(foundations):数学哲学思想(philosophy of mathematics),数学建模(Mathematical modeling),
逻辑(logic),集合论(set theory),证明理论(proof theory)

2)离散数学和代数(Discrete mathematics / algebra): 组合数学(combinatorics),排序理论(Order theory),
代数(algebra),数论(Number theory),域和多项式(Field theory and polynomials),
交互环和几何(Commutative rings and algebras),代数几何学(Algebraic geometry),
线性代数及矩阵理论(Linear and multilinear algebra; matrix theory),
协同环及协调几何(Associative rings and associative algebras),
非协同环及非协调几何(Non-associative rings and non-associative algebras),
分类理论与同源代数(Category theory; homological algebra),K-理论(K-theory),
群论(Group theory),拓扑群(Topological groups)

3)分析(Analysis):实函数(Real functions),测量与整合(Measure and integration),
复变函数(Complex functions),潜力论(Potential theory)
多复变量与解析空间(Several complex variables and analytic spaces),微积分(calculus)。

4)几何与拓扑(Geometry and topology):几何学(Geometry),
凸面和离散几何(Convex geometry and discrete geometry),微分几何(Differential geometry)
普通拓扑学(General topology),代数拓扑(Algebraic topology),多面(层)(Manifolds),
Global analysis, analysis on manifolds (including infinite-dimensional holomorphy)

5)应用数学(Applied mathematics):
概率论与随机过程(Probability theory and stochastic processes),
统计学(Statistics),计算机科学,博弈论(Game theory)

要学好编程单学习数学就得学10年啊,学精通得至少30年,我的体会是以上课程要用英文经典教程,配合习题集,力争独立完成每一道习题,当然还是英文版,呵呵貌似华罗庚就是这么学的。负担太重了,一本Stewart的微积分加上习题集3000页,一本离散数学及其应用加习题集1900页。这么多个上千页才能学出来,可谓路漫漫其修远兮。

5:数学和编程关系的补充阐述。
说数学对编程无用的人,估计是菜鸟或混淆视听。简单来说:程序设计是计算机科学的一个分支,而计算机科学是应用数学的一个分支,应用数学是数学科学的一个大分支,可见这几者的关系,其他不多说了。我大学高等数学刚及格,那个后悔啊,真可谓年少不努力,老大徒伤悲啊。
学习过程是漫长的。学好编程,单单打好数学基础就要至少10年,为什么有些30岁的而立,25岁的小年轻,甚至18岁的孩子们就敢说自己精通编程了,苍天啊,是不是我太笨了还是你们学习得太快了啊,我觉得除非你是布劳恩再世,一般人还是老老实实学习吧。

6:透过现象看本质。程序设计的数据结构、算法、思想、原理、某模式、某系统、某体系、某工程、某模式,其实统统都不重要(但不代表可以不用学),要想成为大牛大师,你需要的就是:狂数学数学再数学,狂做题做题再做题,狂计算计算再计算,挖掘数学本质再挖掘再挖掘,狂抽象抽象再抽象,狂纯英文纯英文再纯英文(如果你还在边看英文版边不停查字典多年,你也快挂了),其他真的都是浮云啊。只可惜绝大多数人一见英文数学书就头疼,故悲剧往往是绝大多数人,人类近几百年来庞大的数学积累使得我们需要站在巨人的巨人的巨人的尸体上才能有所建树。

举例1:如果你把离散数学及其应用第五版的图论、关系、集合论学好了题目真正做好了、领会了、旁通了,你看MIT的那本算法导论第三版也就小菜了(MIT的那本书没有完整的习题解答,看起来很不划算,参考参考还可以。)

语言是相通的,个人觉得需要掌握的语言就是C++和汇编(仅仅是个人观点),其他的可以触类旁通,当然你也可以学习其他的语言来触类旁通。

7:关于时间,学历和寿命。要想成为编程高手,不是上什么博士后,博士,硕士,本科,大专,高中,初中,小学就能搞定的,那些都不是核心,你需要的是时间和不浪费时间,在你有限的寿命范围内(一般情况0到120年),去学上面所说的,可惜绝大多数人,包括我在内,都没做到。

8:关于成才环境。要想成功:最好一个人关在小黑屋里面,除了获取知识的必要沟通外,建议尽可能与世隔绝,如果你想边上网,聊天和游戏,边成为设计高手,真得难度很大;嘈杂的环境,多线程的思维,反复的移动和迁徙,都是阻碍成功的不利因素。

9:年纪大了怎么办?任何行业都是活到老学到老,你会越来越吃香;反之,如果你仅是一名搬运工,只掌握最基本的扛东西的能力,随着年龄的增长,你的技能却没有响应提高,但体能却在随着时间的推移而衰减,你可能会出局,做coder的同理。只是遗憾的是能一直坚持学习的人太少了。

10:悲剧是永恒的。一个人的寿命太短了,时间干掉的是所有人,学得好也没什么了不起,学得差也不用担心,迟早得去阎王爷那里报到,呵呵。
xiaohuh421 2011-11-30
  • 打赏
  • 举报
回复
当你学完这些,就已经不是coder了,已经变成"叫兽"了
一般意义上的的coder和所谓的精通者 都是不可能去学这么多东西的.
pathuang68 2011-11-30
  • 打赏
  • 举报
回复
楼主讲的内容很有深度... 学习了:)

数学的确很重要,越往高处走,越是如此。
daimiaomiao 2011-11-30
  • 打赏
  • 举报
回复
作为一个英语很搓的人,感到鸭梨很大
hongwenjun 2011-11-30
  • 打赏
  • 举报
回复
顶 0分的帖子。
学以致用,用不到,就当业余爱好
ctreewang 2011-11-30
  • 打赏
  • 举报
回复
学了可以,但是学了要让他产生价值才是最重要的。。。。。人生短啊。因为短才要创造出价值啊。。。要学的东西多了。。。。
kou369830863 2011-11-30
  • 打赏
  • 举报
回复
对下一个v0.04版本的修改建议:

1.补齐数学分支并核查翻译结果的准确性;

2.修改错别字,调整句子的通顺程度;

3.看看12条之间有没有可以精简的内容;

4.整合英文论坛的文字的思想入v0.04;

5.关于Donald E. Knuth那本书用了什么语言,我得好好去看看,呵呵。

6.根据大家的建议,尽可能的修改帖子中出现的逻辑错误和常识性错误。
xxweilw 2011-11-30
  • 打赏
  • 举报
回复
[Quote=引用 19 楼 zhao4zhong1 的回复:]
别忘了“学以致用”!

英语也是一门计算机语言的说。

对学习编程者的忠告:
眼过千遍不如手过一遍!
书看千行不如手敲一行!
手敲千行不如单步一行!
单步源代码千行不如单步对应汇编一行!
[/Quote]
同意
赵4老师 2011-11-30
  • 打赏
  • 举报
回复
为什么要有数据结构这个东东?
因为要将现实世界或者抽象理论中的各种数据保存在计算机外存(光盘、硬盘、U盘……)或内存(ROM、RAM、SRAM……)里面的一维二进制字节数组中。
然后让CPU这个只会执行预先保存好的加减乘除移位条件转移……等机器指令的家伙按照人的意志去处理这些数据。
赵4老师 2011-11-30
  • 打赏
  • 举报
回复
别忘了“学以致用”!

英语也是一门计算机语言的说。

对学习编程者的忠告:
眼过千遍不如手过一遍!
书看千行不如手敲一行!
手敲千行不如单步一行!
单步源代码千行不如单步对应汇编一行!
stecdeng 2011-11-30
  • 打赏
  • 举报
回复
很极端
不是高手
楼主的思想有参考价值
luciferisnotsatan 2011-11-30
  • 打赏
  • 举报
回复
Donald E. Knuth那书不是用他自己发明的一种算法描述语言么?和汇编没什么关系吧。不过那书我没看过。
kou369830863 2011-11-30
  • 打赏
  • 举报
回复
If you just want the design specs handed out to you by your boss, then it's not much math but such a work isn't fun at all... However, coming up with how to do things does require mathematical ideas, at least things like abstraction, graphs, sometimes number theory stuffs and depending on the problems, calculus. Personally, more I've been involved with programming, more I see the mathematical side to it. However, most of the times IMO, you can just pick up the book from library and look up the basics of the thing you need to do but that requires some mathematical grasp upfront.

You really can't design "good" algorithms without understanding the maths behind it. Searching in google takes you only so far.


As a mathematician, it is clear to me that Math is not equal to Programming but that the process which is used to solve problems in either discipline is extremely similar.

Solving a higher level mathematics questions requires analytical thinking, a toolbox of possible ways of solving problems, experience with the field, and some formalized ways of constructing your answer so that other mathematicians agree. If you find a particularly clever, abstract, or elegant way of solving a problem, you get Kudos from your fellow mathematicians. For particularly difficult math problems, you may solve the problem in stages, and codify your stage arguments using things called conjectures and proofs.

I think programming involves the same set of skills. In programming, the same set of principles applies to the solving and presenting of solutions to problems. When you have a partial solution to a programming dilemna, you include it as part of your personal library and use it as part of another bigger problem later. These skills seem very similar to the skills used in mathematics.

The major difference between Math and Programming is the latter has a lot more in common between different disciplines of programming than Math does. Two fields of mathematics can be very, very different in presentation and what is used to communicate the field. By contrast, programming structures, to me at least, look very similar in many different languages.


The difference between programming and pure mathematics is the concept of state. A program is a state machine that uses logic (maths) to transition between states. The actual logic used to transition between states is usually very simple, which is why being a math genius doesn't necessarily help you all that much as a programmer.



Programming may have originally started as a quasi-subset of math, but the increasing complexity of the field over time has led to programming being the art and science of creating good abstractions for information processing and computation.

Programming does involve math, engineering, and an aesthetic sense for good design and implementation. Algorithms are an extension of mathematics, and the systems engineering side overlaps with other engineering disciplines to some degree. However, neither mathematics nor other engineering fields have the same level of need for complex, flexible, and yet understandable abstractions that can be used and adapted at so many different levels to solve new and evolving problems.

It is the need for useful, flexible, and dynamic abstractions which led first to the creation of function libraries, then class/component libraries, and in more recent years design patterns and service-oriented architectures. Although the latter have more of a design focus, they are a reaction to the increasing need to build high-level abstractional bridges between programming problems and solutions.

For all of these reasons, programming is neither a subset nor a superset of math. It is simply yet another field which uses math that has deeper roots in it than others do.



Programming is about interconnecting information, generally symbols, often to some end. Maths is about certain types of symbols, that interact in cirtain ways. Clearly maths is a subset of programming in the same way as a square is a specific type of polygon.

It may be stated that maths better deals with infinite, both in magnitude and possibilities (such as the size of a set), but it dosn't when all programming, in all enviroments are taken into consideration. The same sort of uncertainties, infinities and partial-definedness can be represented in programming even if not every programmer uses them or every language makes this sort of abstraction straightforward, many languages are deliberately restrictive, in programming this is often for performance or neatness (coding style) reasons. Pure mathematics is unsurprisingly also restrictive in many respects, with it's fair share of botches and idiosyncrasies.

Beyond just the limits on relationships between information, maths is by design about numbers. Abstractly think about concatenating a word and you are not/not just reducing the size of a set of numbers even if that's how concatenation is implemented/defined. If you think that you are then anything could be made to be maths, with this thinking anything could seem more general than anything else.

Everything is determined by the past, therefore everything is archaeology, therefore archaeology is the purest form of expression.


The topics you listed are topics in Theoretical Computer Science, and THAT is a branch of Pure Mathematics. Programming is an applied science which uses theoretical computer science. Programming itself isn't a branch of mathematics but the Lambda Calculus/theory of computation/formal logic/set theory etc that programming languages are based on is.

Also I completely disagree with Dijkstra. It's either self-congratulatory or Dijkstra is being misquoted/quoted out of context. Pure mathematics is a very very very difficult field. It is so enormously abstract that no branch of applied mathematics is comparable in difficulty. It is one field that requires enormous leaps of imagination. I did my first degree in computer science where I focused a lot on theoretical CS and applied areas like programming, OS, compilers. I also did a degree in Electrical Engineering - arguably the most difficult branch of engineering - and worked on difficult areas of applied mathematics like Maxwell's equations, control theory and partial differential equations in general. I've also done research in applied and pure mathematics, and to this day I find applied far easier. As for the pure mathematicians, they're a whole different breed.

Now there's a tendency for someone to study an year or two of calculus unhinged from application and conclude that pure mathematics is easy. They have no idea what they're talking about. Studying calculus or even topology unhinged from application does not give you any inkling of what a pure mathematician does. The task of actually proving those theorems are so profoundly difficult that I will defer to a computer scientist to point out the distinction: "If P = NP, then the world would be a profoundly different place than we usually assume it to be. There would be no special value in 'creative leaps,' no fundamental gap between solving a problem and recognizing the solution once it’s found. Everyone who could appreciate a symphony would be Mozart; everyone who could follow a step-by-step argument would be Gauss..." —Scott Aaronson, (Theoretical Computer Scientist, MIT)



If it doesn't involve numbers, it's not math.

Some people may try to extend the definition of "math" beyond dealing with numbers. But that basically makes the word "math", useless. If you extend the meaning of a word till who knows what it means... you can't really communicate using that word.

I could say that doing stuff with numbers isn't math, it's... physics. If I extended the definition of physics. It would be a BAD definition, but I could do it. I'd be wrong, but I'd still have defined it that way.

The same thing for saying programming is math, or that doing stuff that doesn't involve numbers, is math.

Simple rule: NO NUMBERS = NOT MATH

Programming is about using logic. But logic is a super-set of math.

For example, if A is inside B, and B is inside C, then A is inside C. Now... at no point have we talked about numbers. I might be talking about my coin that's inside my wallet that's inside my pocket. THAT is logic. Logic talks about things. Things can be numbers, but things can be not numbers too. A coin is not a number.

Math is the subset of logic that deals with numbers.

If you say that math=logic, then... you've basically made the term "logic" and "math" useless.

math is inside of logic.

math does not contain logic, it is contained by logic

Anyone who says otherwise is probably a bad programmer and a good mathematician trying to make him self feel better.



kou369830863 2011-11-30
  • 打赏
  • 举报
回复
关于数学和编程的关系,找了一些个人觉得有意思的分析,英文论坛上的,如下:


http://stackoverflow.com/questions/2436867/what-is-the-the-relation-between-programming-and-mathematics

It seems like you could have confused programmers and computers. A lot of programming involves higher level math and computers. And the mental process by which you construct the program isn't that simple at all.

IMHO the fact is that math and programming are similar as they both deal with solving problems (well posed ones, generally). Sometimes mathematicians think that their problems are harder (or more pure, or more elegant, or whatever). But when it comes to solutions it turns out that programmers care more about better ones.

Let me show you an example: say your problem is to prove the Fermat's Last Theorem, now say that you are Andrew Wiles and come out with 100+ pages long article on Annals of Mathematics filled with beautiful diagrams, lemmas, theorems and propositions about semistable elliptic curves. Basically material that only a handful o persons can understand and it will take them weeks to do that. Not mentioning that it had taken you 7 years to figure out the solution. So from a programmers point of view your solution is bad as it is difficult to understand, difficult to debug, difficult to maintain and is not scalable. And that is where programming and math are different. So I'd say that programming is about solving the problem and doing it the best way possible.

Now if you are wondering if programming is part of math then I think the answer is yes iff you also consider physics to be part of the math.



http://stackoverflow.com/questions/137550/is-programming-a-subset-of-math

Overall, remember that mathematics is a formal codification of logic, which is also what we do in software.

The list of topics in your question is loaded with mathematical problems. We are able to do programming on a fairly high level of abstraction, so the raw mathematics may not be staring you in the face. For example, you mentioned DFAs.. you can use a regular expression in your programs without knowing any math, but you'll find more of a need for mathematics when you want to design a good regular expression engine.

I think you've hit on an interesting point. Programming is an art and a science. There are a lot of "tools of the trade", and you don't necessarily sit down and do a lot of high-level mathematics in order to simply write a program. In fact, when you're programming, you many not really being doing much mathematics or computer science.

It's when we start to solve difficult problems in computer science that mathematics shows up. The deeper you go, the more it will flesh itself out.. often in lower levels of abstraction.

There are also some realms of programming that you don't necessarily have to work in, but they involve more math. For example, while you can certainly learn a language and write some apps without any formal mathematics, you won't get very far in algorithm analysis without some applied math.



Programming is one of the most difficult branches of applied mathematics; the poorer mathematicians had better remain pure mathematicians.

E. W. Dijkstra


OK, I was a math and CS major in college. I would say that if the set A is Math and the set B is CS, then A intersects B. It's not a subset.

It's no doubt that many of the fathers and mothers of computer science were Mathematicians like Turing and Dykstra. Most of the founders of the internet were either Phd's in Math, Physics, or Engineering. Most of the core concepts of computer science come from math, but the act of programming isn't really math. Math helps us in our daily lives, but the two aren't the same.

But there is no doubt that the original reasoning behind the computer was to well, compute things. We have come a long way from there in such a short time.


Einstein was known in 1917 as a famous mathematician. It wasn't until Hiroshima that the general public finally came around to the realization that physics is not just applied mathematics.

When people don't understand something, they try to understand it as a type of something that they do understand. They think by analogy. Programming has been described as a field of math, engineering, science, art, craft, construction... None of these are completely false; it borrows from all of these. The real issue is that the field of programming is only about 50 years old. People have not integrated it into their mental taxonomies.



There's a lot of confusion here.

First of all, "programming" does not (currently) equal "computer science." When Dijkstra called himself a "programmer" (more or less inventing the title), he was not pumping out CRUD applications, but actually doing applied computer science. Let's not let that confuse us-- today, there is a vast difference between what most programmers in a business setting do and computer science.

Now, the argument can be made that computer science is a branch of mathematics; but, as Knuth points out (in his paper "Computer Science and its Relation to Mathematics", collected in his Selected Papers on Computer Science) it can also be argued that mathematics is a branch of computer science.

In fact, I'd strongly recommend this paper to anyone thinking about the relationship between mathematics and computer science, as Knuth lays out the territory nicely.

But, to return to your original question: to a practitioner, "enterprise/OO development" is pretty far removed from mathematics-- but that's largely because most of the serious mathematics involved at the lower levels of operation have been abstracted away (by compilers, operating systems, instruction sets, etc.). Similarly, advanced knowledge of the physics of the internal combustion engine are not required for driving a car. Naturally, if you want to design a more efficient car....


Disclaimer: I work as an IT consultant and develop mainly portals and Architecture stuff. I have a Psychology degree. I never studied Maths in University. And i get my job done. And usually well. Why? Because I don't think you need to know Maths (as in 'heavy' Maths stuff) to write code. You need analytical thinking, problem-solving skills, and a high level of abstraction. But Maths does not give you that. It's just another discipline that requires similar skills. My studies in Psychology also apply to my daily work when dealing with usability issues and data storage. Linguistics and Semiotics also play a part.

But wait, just don't flame me yet. I'm not saying Maths are not needed at all for computers - obviously, you need real Math skills when designing encryption algorithms and hardware and etc -- but if, as lots of programmers, you just work an a mid/low level language (like C) or higher level stuff (like C# or java), consuming mostly pre-built frameworks and APIs, you don't really need to understand the mathematical principles behind Fourier transforms or Huffman trees or Moebius strips... let someone else handle that, and let me build value on top of it. I am not stupid. I know the difference between linear and exponential algorithms and data structures and etc. I just don't have the interest to rewrite quicksort or a spiffy new video compression technique.


I would say...

It's partly math, especially at the theoretical level. Imagine designing efficient searching/sorting/clustering/allocating/fooifying algorithms, that's all math... running the gamut from number theory to statistics.

It's partly engineering. Complex systems can rarely achieve ideal levels of performance and reliability, and software is no exception. A lot of software development is about achieving robustness in the face of unreliable hardware and (ahem) humans.

And it's partly art. Creative and idiosyncratic software design often comes up with great new ideas... like assembly language, multitasking operating systems, graphical user interfaces, dynamic languages, and the web.




kou369830863 2011-11-30
  • 打赏
  • 举报
回复
一个大学毕业N年的菜鸟对程序设计的几点体会

-v0.03-2011-11-30

引言:
我从军医大毕业8年了,以前懒散学编程,最近两、三年开始认真学编程了,现在谈谈个人体会,分别从编程语言及如何深入理解编程语言,相关基础知识,编程哲学思想这几个方面扯几句,不妥之处欢迎拍砖:

1:C++挺好,为什么叫C++呢,意思就是C的超集,C能支持的C++也支持(需要足够的编译环境),不明白为什么还有人在讨论C和C++哪个好,类似于讨论中国和广东哪个好一样无聊啊,我觉得用相对较短的代码达到相对较快的执行速度以完成不同复杂度的任务才是需要重点关注的问题。

2:既然C++挺好,学会了C++,很多语言就是小菜,那怎么学呢?看书只可惜 Stanley Lippman的《C++ Primer》 4th和Bjarne Stroustrup的《The C++ Programming Language》 3rd上 的习题难度还是不小的,且现存的答案资源不是很让人满意(解题繁琐,答案不完整),建议解题最好都要亲自操刀,力争用两种以上方法解出来,反正我是95%的时间都用来做题和调试了,那些宣称很快就能很快看完书的人,真的应该好好做题了,不做题是不能体现看书效果的,仅仅是看书不能互动性的思考书上的知识点,当然看书和做题需要一定的耐心、时间、编译环境和英文阅读、写作水平。但我觉得:看书不是目的,最重要的,是把书中的练习题认真做出来并争取补写完整编译执行,书中的例子用键盘敲到计算机里并争取补写完整编译执行,编译通过的代码应作为重要的个人资料保存并随着思维的深入不断修改和完善并为将来更进一步的学习打好基础。

3:汇编语言是有必要学习的,国家举办的计算机程序员高等级考试很多地方都用到它了,我手头有一本自己打印制作的Randall Hyde的《The Art of Assembly Language》,近1600页(注意不是亚马逊美国上的阉割版,更不是中国的翻译版,而是网上下载版),看的人很累且书写的也比较啰嗦,还要把课后习题都做出来,里面用到的HLA也让人些许有陌生感,加上做题估计这本书飙升到3000页了。不过我觉得,不懂汇编就不能深刻理解高级语言啊,3000页也得拼命看啊。看完以后貌似还有一套Donald E. Knuth写的《The Art Of Computer Programming》需要看,用得是一种比较特殊的汇编,又是几千页!

4:真正学好以上的这些书本上的知识是需要一定的数学基础的。数学分为5大分支(翻译的不是很专业请谅解附上英文名):
1)基础数学(foundations):数学哲学思想(philosophy of mathematics),数学建模(Mathematical modeling),逻辑(logic),集合论(set theory),证明理论(proof theory)
2)离散数学和代数(Discrete mathematics / algebra): 组合数学(combinatorics),排序理论(Order theory),代数(algebra),数论(Number theory),域和多项式(Field theory and polynomials),交互环和几何(Commutative rings and algebras),代数几何学(Algebraic geometry),线性代数及矩阵理论(Linear and multilinear algebra; matrix theory),协同环及协调几何(Associative rings and associative algebras),非协同环及非协调几何(Non-associative rings and non-associative algebras),分类理论与同源代数(Category theory; homological algebra),K-理论(K-theory),群论(Group theory),拓扑群(Topological groups)
3)分析(Analysis):实函数(Real functions),测量与整合(Measure and integration),复变函数(Complex functions),潜力论(Potential theory),多复变量与解析空间(Several complex variables and analytic spaces),微积分(calculus)。
4)几何与拓扑(Geometry and topology):等等(下次补齐,太多了)
5)应用数学(Applied mathematics):概率论,随机过程,统计学,计算机科学,博弈论(Game theory)

妈呀,要学好编程单学习数学就得学10年啊,学精通得至少30年,我的体会是以上课程要用英文经典教程,配合习题集,力争独立完成每一道习题,当然还是英文版,呵呵貌似华罗庚就是这么学的。负担太重了,一本Stewart的微积分加上习题集3000页,一本离散数学及其应用加习题集1900页,妈啊,路漫漫啊。

5:说数学对编程无用的人,估计更是菜鸟啊,或者混淆视听。简单来说:程序设计是计算机科学的一个分支,而计算机科学是应用数学的一个分支,应用数学是数学科学的一个大分支,可见这几者的关系,其他不多说了。我大学高等数学刚及格,那个后悔啊,真可谓年少不努力,老大徒伤悲啊。

6:学好编程,单单打好数学基础就要至少10年,为什么有些30岁的小伙子,25岁的小年轻,甚至18岁的孩子们就敢说自己精通编程了,我的苍天啊,是不是我太笨了还是你们学习得太快了啊,我觉得除非你是布劳恩再世,一般人还是老老实实学习吧。

7:不要根我说这个语言,那个语言,我觉得都是一回事啊,目前个人觉得需要掌握的语言就是C++和汇编啊,其他的可以触类旁通啊。

8:程序设计的数据结构、算法、思想、原理、某模式、某系统、某体系、某工程、某模式啊,其实统统都不重要,要想成为大牛、大大牛、大师、大大师,你需要的就是:狂数学数学再数学,狂做题做题再做题,狂计算计算再计算,挖掘数学本质再挖掘再挖掘,狂抽象抽象再抽象,狂纯英文纯英文再纯英文,其他真的都是浮云啊。只可惜绝大多数人一见英文数学书就头疼,故悲剧往往是绝大多数人,人类近几百年来庞大的数学积累使得我们需要站在巨人的巨人的巨人的肩膀上才能有所建树。
举例1:如果你把离散数学及其应用第五版的图论、关系、集合论学好了题目真正做好了、领会了、旁通了,你看MIT的那本算法导论第三版也就小菜了,而且MIT的那本书没有完整的习题解答,看起来很不划算,参考参考还可以。

9:关于时间和学历的关系。要想成为编程高手,不是上什么博士后,博士,硕士,本科,大专,高中,初中,小学就能搞定的,那些都没用,你需要的是时间和不浪费时间,在你有限的寿命范围内(一般情况0到120年),去学上面所说的,可惜绝大多数人,包括我在内,都是悲剧啊,都没做到啊。

10:关于成才环境。要想成功:最好一个人关在小黑屋里面,除了获取知识的必要沟通外,建议与世隔绝,如果你想边上网,聊天和游戏,边成为设计高手,真得不太可能.嘈杂的环境,多线程的思维,反复的移动和迁徙,都是阻碍成功的不利因素。

11:任何行业都是活到老学到老,你会越来越吃香;反之,如果你仅是一名搬运工,只掌握最基本的扛东西的能力,随着年龄的增长,你的技能却没有响应提高,但你的体能和精力却在走下坡路,你可能会出局,做coder的同理。

12:最后一句:一个人的寿命太短了,时间干掉的是所有人,学得好也没什么了不起,学得差也不用担心,迟早得去阎王爷那里报到,呵呵。
加载更多回复(14)

15,445

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧