只是放松一下...... [英] Just letting off steam...

查看:69
本文介绍了只是放松一下......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天在一个真实的应用程序中遇到了这段C#代码...


------------------- -------------------

if(boolVal == true)

{

返回true;

}

其他

返回false;

----- ---------------------------------


我对此印象深刻代码已经设法挤进了几行的绝对无能为力。


#为什么前面的空白行返回true ;                        boolVal,非常没有信息。


#作者为什么写(boolVal == true)而不只是

"(boolVal)"?


#当然,为什么作者不能用<替换整个事物? br />
" return boolVal;" ;?


到目前为止,我还没有足够的勇气学习

程序的其余部分。


-

Clive Tooth
www.clivetooth.dk

解决方案

" The Last Danish Pastry" < CL **** @ gmail.com> écritdansle message de news:
42 ********** ***@individual.net ...


|我今天在一个真实的应用程序中遇到了这段C#代码...

< snipped娱乐原因/> Aaaaaarrrrghgh!


|到目前为止,我还没有足够的勇气学习

|该计划的其余部分。


我建议申请临时切除术,以确保你的好大脑不会受到影响: - )) />

Joanna


-

Joanna Carter [TeamB]

顾问软件工程师




作者对
的无能为力给我留下了深刻的印象。代码已经设法挤进了几行。


有点酷:)你不得不想知道他在想什么时候他/她用b $ b写了它

#为什么空白行之前return true;?
可能是因为格式化。你放置{,点击返回这个make

下一行格式正确,但是如果你更改了行就丢了它,

更简单的方法来取回它,点击返回,你会再次得到它,一行

以下

#为什么围绕if-part而不是else-part?
也许在空白行中有一些东西,他只是把它剪掉了

#变量名称boolVal非常没有信息。
比b相信我好多了。

#作者为什么写(boolVal == true)而不仅仅是
(boolVal)"?
#当然,为什么作者不能用返回
boolVal替换整个事物? / blockquote>


当天对于这些复杂的问题太早了:)



-

Ignacio Machin,

ignacio.machin at dot.state.fl.us

佛罗里达州交通局




最后的丹麦糕点写道:

我今天在一个真实的应用程序中遇到了这段C#代码......

--- -----------------------------------
if(boolVal == true)
{

返回true;
}
其他
返回false;
----------------- ---------------------

代码管理员所管理的纯粹无能为力让我印象深刻挤进几行。




我曾经遇到过一个网站te人们可以匿名发布

他们在维护工作中遇到的真实代码的例子,

让他人感到愉快和惊讶。那个片段很合适

in。虽然现在找不到。


-

Larry Lard

回复团体请


I came across this piece of C# code today in a real application...

--------------------------------------
if (boolVal == true)
{

return true;
}
else
return false;
--------------------------------------

I was impressed by the amount of sheer ineptitude that the author of
the code had managed to squeeze into just a few lines.

# Why the blank line before "return true;"?

# Why are there braces around the if-part but not the else-part?

# The variable name, boolVal, is wonderfully uninformative.

# Why did the author write "(boolVal == true)" rather than just
"(boolVal)"?

# And, of course, why didn''t the author replace the whole thing by
"return boolVal;"?

So far I have not been able to summon up enough courage to study the
rest of the program.

--
Clive Tooth
www.clivetooth.dk

解决方案

"The Last Danish Pastry" <cl****@gmail.com> a écrit dans le message de news:
42*************@individual.net...

|I came across this piece of C# code today in a real application...

<snipped cause of amusement/> Aaaaaarrrrgghh !

| So far I have not been able to summon up enough courage to study the
| rest of the program.

I suggest applying for a temporary lobotomy to ensure that your good brain
cells don''t suffer :-))

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer


Hi,

I was impressed by the amount of sheer ineptitude that the author of the
code had managed to squeeze into just a few lines.
It was kinda cool :) , you have to wonder what he was thinking when he
wrote it
# Why the blank line before "return true;"? Probably it was due to formatting. you place the { , hit return this make
the next line properly formatted, but if you change of line you lose it, the
easier way to get it back, hit return and you will get it again, one line
below
# Why are there braces around the if-part but not the else-part? Maybe there was something in the blank line and he simply cut it out
# The variable name, boolVal, is wonderfully uninformative. well better than b believe me.
# Why did the author write "(boolVal == true)" rather than just
"(boolVal)"?
# And, of course, why didn''t the author replace the whole thing by "return
boolVal;"?



too early in the day for these complex questions :)


--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation



The Last Danish Pastry wrote:

I came across this piece of C# code today in a real application...

--------------------------------------
if (boolVal == true)
{

return true;
}
else
return false;
--------------------------------------

I was impressed by the amount of sheer ineptitude that the author of
the code had managed to squeeze into just a few lines.



I once encountered a website where people could anonymously post
examples of real code they had met in the course of maintenance work,
for the amusement and amazement of others. That snippet would fit right
in. Can''t find it now though.

--
Larry Lard
Replies to group please


这篇关于只是放松一下......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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