C不适合胆小的灵魂! [英] C isn't for timid souls !

查看:93
本文介绍了C不适合胆小的灵魂!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是关于如何用C编程的一些建议:

(来自
http://www.uni-muenster.de/ZIV/Mitar.../PL1andC.html/

首先,我想向有时需要用C语言编程的程序员提供一系列提示:

*控制语句中没有计算!
*没有增量+并且没有减量 - 运算符!
*表达式中没有赋值!
*没有逗号运算符!
*没有问号运算符!
*不要使用char对于数字!
*不要指望数学规则!
*不要查找优先规则,使用括号!




或也许胆怯不是问题。

解决方案

sp****@gmail.com 写道:

这里关于如何在C中编程的一些建议:
(来自
http://www.uni-muenster.de/ZIV/Mitar.../PL1andC.html/

首先,我想向有时需要用C语言编程的程序员提供一系列提示:

*控制语句中没有计算!


喜欢说


if(选项和标志){...}

*无增量+ +并且没有减少 - 运营商!


为什么?

*没有表达式的作业!


嗯...

*没有逗号操作员!


我可以看到避免使用逗号的地方,但有些地方

这里有用,例如

for(x = TOP,y = BOTTOM; y< x; y ++,x--){...}

*没有问号运算符!


Lame。

*不要用char作为数字!


字符是INTEGERS !!!

*不要指望数学规则!


不,只需了解数据类型推广规则。

*不要查找优先规则,请使用括号!



然后你不会知道轮班,逻辑和二元的规则

运营商等......

或者胆怯不是问题所在。




愚蠢?


你从哪里得到名单?


基本上你''是的,因为你不理解C,其他人

应该避免它是最基本的产品,因为你可能会被

混淆。


避免使用?例如运算符...就像说使用

goto总是很愚蠢。


Tom


<到******** @ gmail.com>在留言中写道

news:11 ********************** @ u72g2000cwu.googlegr oups.com ...

sp****@gmail.com 写道:

首先,我想向程序员提供一系列提示,偶尔
需要用C语言编程:((..提交..))



你从哪里得到名单?


链接文件的第一行说这篇论文是在

呈现的GUIDE& SHARE欧洲联席会议(1994年10月10日至13日,维也纳,

奥地利)。列表本身出现在摘要部分。

基本上你说的是因为你不理解C其他人
应该避免它是最基本的产品,因为你可能会得到很困惑
它。




唔不,实际上他(或该位的作者)说如果你只是

偶尔需要使用C然后你应该避免这些功能。我希望

因为限制自己因此会减少你通常编程和C之间的差异。从文章看来,常见的最小值是PL / I.
基本上它(文章)在C上是一个碎片,一般来说,与PL / I相比,特别是




- 比尔



给******* *@gmail.com 写道:

sp****@gmail.com 写道:

这里有关于如何用C编程的一些建议:
<来自
http://www.uni-muenster.de/ZIV/Mitar.../PL1andC.html/

首先,我想向偶尔需要用C编程的程序员提供一系列提示:

*控制属性无计算ements!
喜欢说

if(options& flags){...}
*没有增量++而且没有减量 - 运算符!
为什么?
*没有表达式的任务!
嗯...... *没有逗号操作员!
我可以看到避免使用逗号的地方,但有些地方有用,例如

(x = TOP ,y *没有问号操作员!
Lame。
*不要用char代替数字!
字符是INTEGERS !!!
*不要指望数学规则!
不,只是理解数据类型推广规则。
*不要查找优先级规则,使用括号!


然后你就不会知道转移规则,逻辑和二元操作符等......

或者也许胆怯不是问题。



愚蠢?

你从哪里得到名单?




Errrm,我提供了一个链接。它不会出现在你的新闻阅读器上吗?

基本上你说的是因为你不理解C其他人
应该避免它是最基本的产品,因为你可能会感到困惑通过
它。




不是我说的是谁。我有一半感到困惑,被它逗乐了



很想看到其他人对它的反应。


Spiros Bousbouras


Here''s some advice about how to programme in C:
(From
http://www.uni-muenster.de/ZIV/Mitar.../PL1andC.html/)

First I want to present a list of hints to programmers who occasionally need to program in C:

* No computations in control statements!
* No increment ++ and no decrement -- operators!
* No assignments in expressions!
* No comma operator!
* No question-mark operator!
* Don''t use char for numbers!
* Don''t expect rules of mathematics!
* Don''t lookup precedence rules, use parentheses!



Or perhaps timidness is not the problem.

解决方案

sp****@gmail.com wrote:

Here''s some advice about how to programme in C:
(From
http://www.uni-muenster.de/ZIV/Mitar.../PL1andC.html/)

First I want to present a list of hints to programmers who occasionally need to program in C:

* No computations in control statements!
Like say

if (options & flags) { ... }
* No increment ++ and no decrement -- operators!
Why?
* No assignments in expressions!
Um ...
* No comma operator!
I can see places where it''s good to avoid comma but there are places
where it is useful, e.g.

for (x = TOP, y = BOTTOM; y < x; y++, x--) { ... }
* No question-mark operator!
Lame.
* Don''t use char for numbers!
characters ARE INTEGERS!!!
* Don''t expect rules of mathematics!
No, just understand data type promotion rules.
* Don''t lookup precedence rules, use parentheses!


Then you wouldn''t know about the rules for shifts, logical and binary
operators, etc...
Or perhaps timidness is not the problem.



Stupid?

Where did you get the list?

Basically you''re saying because you don''t understand C that others
should avoid it''s most basic offerings because you may get confused by
it.

Avoiding the "?" operator for instance... is just like saying "using
goto is always stupid".

Tom


<to********@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...

sp****@gmail.com wrote:

First I want to present a list of hints to programmers who occasionally need to program in C: ((..ommitted..))



Where did you get the list?

The first line of the document at the link says "This paper was presented at
the G.U.I.D.E.&SHARE Europe Joint Conference (10-13 October 1994, Vienna,
Austria)." The list itself appears in the summary section.
Basically you''re saying because you don''t understand C that others
should avoid it''s most basic offerings because you may get confused
by it.



Well no, actually he (or the author of the bit) is saying that if YOU only
occasionally need to use C then YOU should avoid these features. I expect
because limiting yourself thus will reduce the differences between whatever you
usually program and C. From the article it appears the common minimum is PL/I.
Basically it (the article) is a frag on C, in general, and specifically as
compared with PL/I.

- Bill



to********@gmail.com wrote:

sp****@gmail.com wrote:

Here''s some advice about how to programme in C:
(From
http://www.uni-muenster.de/ZIV/Mitar.../PL1andC.html/)

First I want to present a list of hints to programmers who occasionally need to program in C:

* No computations in control statements!
Like say

if (options & flags) { ... }
* No increment ++ and no decrement -- operators!
Why?
* No assignments in expressions!
Um ...
* No comma operator!
I can see places where it''s good to avoid comma but there are places
where it is useful, e.g.

for (x = TOP, y = BOTTOM; y < x; y++, x--) { ... }
* No question-mark operator!
Lame.
* Don''t use char for numbers!
characters ARE INTEGERS!!!
* Don''t expect rules of mathematics!
No, just understand data type promotion rules.
* Don''t lookup precedence rules, use parentheses!


Then you wouldn''t know about the rules for shifts, logical and binary
operators, etc...

Or perhaps timidness is not the problem.



Stupid?

Where did you get the list?



Errrm , I provided a link. Does it not appear on your newsreader ?
Basically you''re saying because you don''t understand C that others
should avoid it''s most basic offerings because you may get confused by
it.



It''s not me who''s saying it. I was half bewildered half amused by it
and
was curious to see other peoples'' reactions to it.

Spiros Bousbouras


这篇关于C不适合胆小的灵魂!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆