Chapter 1 What is an object?

What is an Object?

“We do not realize what tremendous(惊人的) power the structure of an habitual(习惯性的) language has.” It is not an exaggeration to say that it enslaves us through the mechanism of semantic(语义的;语义学的) reactions and that the structure which a language exhibits, and impresses upon us unconsciously, is automatically projected upon the world around us." – Alfred

The genesis(发生;起源) of the computer revolution was in a machine. Our programming languages thus(因此;从而;这样;如此) tend to look like that machine. But computers are not so much machines as they are mind amplification tools(思想放大器)(“bicycles for the mind,” as Steve Jobs was fond of saying) and a different kind of expressive medium(表达媒介). As a result, tools are beginning to look less like machines and more like parts of our mind.

Programming languages are the fabric of thought for creating applications. Languages take inspiration(灵感) from other forms of expression such as writing, painting, sculpture(雕塑), animation(动画), and filmmaking(电影).

Object-oriented programming (OOP) is one experiment in using the computer as an expressive medium.

Many people feel uncomfortable wading into object-oriented programming without understanding the big picture, so the concepts inroduced here give you an overview of OOP. Other might not understand such an overview until they are exposed to the mechanism, becoming lost without seeing code. If you’re part of this latter group and are eager to get to the specifics of the language, feel free to jump past this chapter – skipping it now will not prevent you from writing programs or learning the language. However, come back here eventually to fill in your konwledge so you understand why objects are important and how to design with them.

This chapter assumes you have some programming experimence, although not necessarily in C. If you need more preparartion in programming before tackling this book, work through the Thinking in C multimedia seminar, freely downloadable from www.OnJava8.com

The Progress of Abstraction

All programming languages are abstractions. It can be argued that the comlexity of the problems you’re able to solve is directly related to the kind and quality of abstraction. By “kind” I mean, “What is it you are abstracing?” Assembly language is a minimal abstraction of the underlying machine. Many so-called “imperative(必要的)” languages ( such as FORTRAN, BASIC and C) were themselves abstractions of assembly language. Although they were big improvements, their primary abstraction still requires you to think in term of the structure of the computer rather than the structure of the problem you are trying to solve. The programmer must establish the association between the machine model(the “solution space”, the place where you’re implementing that solution, such as a computer). The effort required to perform this mapping, and the fact it is extrinsic(adj. 外在的;外来的;非固有的) to the programming language, produces programs that are difficult to write and expensive to maintin.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值