荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: tang (独孤九剑〖玄铁重剑〗), 信区: Program
标  题:  C and C++ Languag##--Objects and Scopes
发信站: BBS 荔园晨风站 (Tue Mar 30 20:38:47 1999), 转信

这是关于C++中对象和作用域的一个精彩比喻!

             Objects and Scopes
What's the most important thing in the Universe? Is it
matter? It seems like everything is built from
matter-galaxies, stars, planets, houses, cars and even us,
programmers. But what's matter without energy? The Universe
would be dead without it. Energy is the source of change,
movement, life. But what is matter and energy without space
and time? We need space into which to put matter, and we
need time to see matter change.

Programming is like creating universes. We need matter: data
structures, objects, variables. We need energy--the
executable code--the lifeforce of the program. Objects would
be dead without code that operates on them. Objects need
space to be put into and to relate to each other. Lines of
code need time to be executed. The space-time of the program
is described by scopes. An object lives and dies by its
scope. Lines of executable code operate within scopes.
Scopes provide the structure to program's space and time.
And ultimately programming is about structure.

--
        there are these few times I feel lonely for you
     but I know this shade of blue will soon pass through
            I must be strong without you by my side
               I can see forever you are my light

※ 来源:.BBS 荔园晨风站 bbs.szu.edu.cn.[FROM: 192.168.0.4]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店