Why should developers use Mac OS x and OS X

Source: Internet
Author: User


From: http://blog.youxu.info/2010/02/28/why-mac-os-x-for-programmers/

February 28,201 0 at AM
· Filed under cool stuff
,
In MacOSX "rel =" category tag "href =" http://blog.youxu.info/category/macosx/ "> MacOSX
, Pearl "rel =" category tag "href =" http://blog.youxu.info/category/pearl/ "> Pearl
, Tech "rel =" category tag "href =" http://blog.youxu.info/category/tech/ "> tech

A week ago, I chatted with tinyfool about Apple's operating system and thought that Apple's operating system (Mac OS) was a good choice for developers. Tinyfool
The pen was very fast and I wrote it immediately.
Long article
My pen is very slow. Today, all the codes are good. The main starting point of his article is the advantages of MAC platform as the target development platform, and the main starting point of my article is Mac
The advantages of OS as a development tool.

Developer Tools

For developers, the maximum purpose of all development tools is to maximize the productivity of developers)
And creativity ). In our time, using GUI is a good way to increase productivity. Although the previous generation of UNIX
Developers do not need a GUI. A screen, a keyboard, and an editor are everywhere, but over the past 20 years,
The development environment has undergone great changes. For example, compared with the text-based environment used by programmers in the past
The rich files in the following formats are more intuitive and have a better reading experience. Even if you do not need to develop any GUI programs at work, modern developers will also use the GUI to view web images and documents.
Therefore, even the most traditional command line developers can actually access the GUI. For example, the best terminal program is X
Because of the appearance of these simulated terminals, some complex visualization functions can be implemented in these terminals, such as Unicode display (rxvt-Unicode.

For developers, it is a great dream to have a group of development tools that can maximize productivity. So where does this development tool come from?
In general, these tools come from three aspects: 1. provided through the system and a single application software; 2. use various applications together. by customizing and changing existing applications.
These three points are no longer familiar to Unix developers. They are nothing more than writing scripts and taking pipelines. Therefore, in the previous GUI era, this philosophy was very prevalent,
Developers know that they need to install the script parser, write some scripts, configure some environments, and so on to transform the factory UNIX system into a handy system.
Basically anyone who has been using Unix/Linux for many years has a variety of "private" scripts in the machine. Without these scripts, the efficiency will be greatly reduced.

Traditional loss in the GUI age

In the 1980s S, Gui
The age and the era of PC popularity have come. Since then, computers have become personal computers. For the first time in history, computers were not designed for developers but for common users. The requirement of common users is
The solution provided by the software industry is to provide users with application software one by one, instead of allowing users to program and write scripts one by one. The huge demand for software has instantly achieved
A huge software industry.
This indirect consequence is that, for ordinary users, the only means to turn a computer into a "Personal Computer" that can help them complete their tasks is to constantly install various applications in the stacked beddings.

We can use a simple example to illustrate this usage mode. We all know that installing windows
An empirical principle of the system is to divide the operating system and applications into two logical disks, one in disk C and the other in disk D.
Disk. The principle of this disk partitioning experience is not only known to Internet cafe owners, but also to the female students who only point mouse in my university. Why is this amazing phenomenon? In fact, this is caused by Windows
The typical usage mode of system users is determined. On Windows,
Applications and documents are the key, and the operating system is just something that can be reinstalled at any time. Therefore, the two are separated without affecting each other. In this mode, Windows
Reinstallation of system disks is very low-cost, as long as the documents are not lost, the application is not lost. How many geek is wasted
A good time for male people to reinstall the system, but also contributed to the wonderful marriage :). In short, in the GUI
To solve a problem, install an application. As for the communication between applications and the control of applications using non-keyboard and mouse methods, it is no longer an issue to be considered.
Non-mainstream and non-mainstream operating systems and application software won't let you do this. The operating system blocks all the other routes and clearly tells you to buy software for a certain function.

The Inspiration of Smalltalk



In fact, this is not the case in the GUI era. We all know that Gui was originally developed by the Alan Kay team of Xerox for scientific research. Bill Gates and
Steve Jobs copied some of them to Xerox, so the window and buttons were everywhere. They all see graphical interfaces and object-oriented shapes,
When you see the graphical interface, you can set up the buttons, icons, and other objects, and then click and drag these surface items. Because all gui interfaces start from the text interface
The program is actually the packaging of the original executable program. The emergence of C ++ is also very clever, packaging C into an object-oriented language, packaging for packaging, C ++
It is easy to adapt to the trend of making executable programs Gui
Mainstream development languages of the times. On the surface, as long as you run these executable programs, you will be able to see the graphic interface and click them with the mouse. However, the underlying layer of these things is a compiled
Execute the program. The runtime environments and object containers in the original Smalltalk are all gone. All GUI programs are still directly running on the CPU of the computer.
Instead of a virtual object-oriented container. This object-oriented container (also called "RunTime" or "runtime environment") is the god of smalltalk.
To put it simply, Smalltalk itself has an object-oriented runtime, so even when it comes to execution, all the objects in it can still be interconnected. C ++
Except for the object-oriented program before compilation, as long as the program is compiled, it will all become machine code, and it will no longer have any relationship with the object, in this case, dynamic check (inspect) does not exist during running)
And modify. In short, due to historical limitations, these GUI platforms are gradually evolved, so there is no platform like
Smalltalk
As mentioned above, the method of extending the system is to introduce new application software, and there is no interconnection requirement, so this discard operation
It doesn't matter if the object is not controlled by an external program.

However, developers are not common users. They still need to transform computers into their own tools. When the existing tools cannot solve the problem, or else they will re-invent the wheel, or they will be reused.
Some existing tools, or reconfigure them as needed. Therefore, unlike normal users, developers need the configurability of these guis and
Program interconnection. In other words, the first problem is related to the scripting of GUI applications, and the second problem is related to inter-process communication between GUI programs.
These two problems are simple to say, but they all involve the Fundamental Design Issues of the GUI system. History has made a little joke here, giving this only chance to Mac OS
X. For other operating systems, there is no good solution to these two problems.

Inter-process communication, Apple's Solution

There are two flowers in each table. Let's talk about inter-process communication in Gui programs. The so-called inter-process communication (IPC) means information sharing between two programs.
As we all know, * a powerful feature of Nix is that pipelines are the simplest, cheapest, and most commonly used * nix inter-process communication methods. In the GUI era, the most common IPC
Allows you to drag and drop the clipboard and mouse. Although these two operations are intuitive, they all involve human operations and the program cannot automatically complete inter-process communication.
To improve work efficiency, the computer must be able to complete these tasks without human interference. In order to automate these tasks, the operating system cannot simply draw windows and then everything is ready.
For example, if we want to automatically select a word in the reader and send it to the dictionary program for interpretation, the computer needs to know the word
The program can accept a string when running, but cannot accept images. If we abstract the dictionary program into an object that provides the "dictionary query" service, there is no doubt if we want
The program must first know what the dictionary program can accept and how to send the word to the dictionary. All such information must be managed by the operating system.(Not per
Every application needs to remember the dictionary. This program can accept strings and cannot accept images. In this way, every application needs to write down information about all other possible applications. This is a square-level relationship, required
It is obviously unrealistic for developers to take into account all other programs when developing a program)

. In other words, there must be a unified management runtime environment to manage the interaction between these programs.
Communication problems. As we have mentioned above, Smalltalk's God lies in a unified object-oriented runtime, so that all applications can be interconnected. However, the GUI on all platforms
The evolution process of the program does not follow this path, but only simulates the appearance. Some platforms do not completely even want to achieve interconnection (such as Microsoft's Ole, com ).

Is a good thing, always shine.
However, to make this good thing fully accepted by the new operating system, to make a system adopt a unified operating environment from the bottom layer to the upper layer, it is necessary to discard a lot of historical burdens. Get rid of this historical burden,
Any operating system is not easy. If we go back to that year, we will be imagining that if we have a person with no historical burdens, we can create a clean and tidy one from the ground up, regardless of the market or the existing platform.
How good is the GUI system. History is such a drama. I have really arranged a person to do this. This person is Steve Jobs.

In 1985, Steve Jobs was swept out by Apple and set up next to create a high-quality GUI computer system.
History gave Steve Jobs a chance to do everything from scratch. This time, teachers Joe and the developers of next realized that they simply copied smalltalk.
The form is not good, and even its God will take it, re-design the inter-process communication and GUI system. At the kernel level, they used the Mach microkernel designed for BSD.
This operating system kernel is designed to replace outdated UNIX kernels. One core design philosophy is to redesign inter-process communication;
Although the micro-kernel-based operating system is no longer a trend (for this reason Linus and Tanenbaum had a famous fight), but compared with the Unix
System kernel (Linux has not yet appeared, and the Unix kernel only has several BSD, Bell, and Sun), Mach
Is a high starting point. In this kernel, next engineers began to build an object-oriented basic system. This system is deployed in Smalltalk
Therefore, these engineers use Smalltalk as the blueprint and first design a C-based language, that is, Objective C.
The typical [object message: parameter] Syntax of smalltalk.(I personally don't like Objective C, smalltalk.
It is a pure object-oriented Dynamic Language. Next has a full chance to use the Smalltalk language. If Smalltalk is used, the current cocoa
The framework will be more beautiful and the code will be cleaner. I don't know if Objective C is a proprietary language.
All the innovations over the past 20 years are slowly becoming more like smalltalk, and Java and Ruby have been getting things from Smalltalk over the past few years)

.
With the kernel and language, next builds a pure object-oriented runtime environment and class library (similar to the idea of a unified class library in Java and. net, but more than a decade ahead ),
This class library was called nextstep at the time, so all class names are prefixed with NS, which is very ugly. It is a pity that the class libraries that were beyond the age were too busy.
Smalltalk surpassed the times for 20 years, so in the middle of 1990s, programmers remembered the good of smalltalk, and the emergence of Java Ruby
And other languages inspired by smalltalk. Although Mr. Qiao lags behind Smalltalk for 5 years, he is also ahead of the industry for 5-10 years.
In, Windows 95 went viral, but Mr Joe's nextstep was not dynamic. He had to repackage the class library and sell it as a web class library.
Webobjects. This is unintentional, and the business is good, because at that time, web development had been exhausted without a unified Runtime Environment (this is also the future Java
Reasons for popularity ). We say that gold always shines, but the premise is (1) wait a few more years until the industry returns to realize its benefits, (2)
Get support from a mainstream operating system and replace all the underlying layers with Jack Joe's stuff. Mr Joe knew the two conditions, so he accelerated the pace of cooperation with sun and wanted to put the system in Sun.
On the workstation. However, Sun has a strong underlying technology, and Java was widely used during that time. In fact, Mr. Joe is not a good winner on Sun's road. Besides, sun
Because of its strong kernel technology, nextstep must be replaced to overwrite the kernel. If it doesn't work with sun, next, the company will be able to support 5 more
Every year is a problem. In the second place, almost every company that is engaged in personal computers has switched to Microsoft. Other companies that are engaged in workstation have their own strong underlying technologies and cannot use Mr Joe's stuff, so it seems that Mr Joe and
He seems to have a poor outlook.
However, there is no way out of sight. Looking at the market of that year, only one company did not go against Microsoft, nor did it have a strong underlying technology. It also had some roots with Mr Joe. History is such a drama, this company just named Mr Joe
The apple that swept the floor.

In the middle of 1990s, Apple had a tough time, and the PC market was defeated by Wintel.
In the alliance and emerging markets, the results are also a mess, and investors are not confused. Sculley, who swept out Mr Joe
Then I bought Mr. Joe's company and asked Mr. Joe to resume his job to refresh apple. Therefore, the two conditions we mentioned above are suddenly met:
First, he is now the boss, so he can thoroughly reinvent the old apple system and use his new guy. Second, the original next
The company's engineers should not worry about unemployment. Now apple is responsible for paying wages, so they can let these people start to transform the Apple system, the main task is to replace Apple's old system with a new system that we bring.
And maintain the same style as the old system. This work was completed from the acquisition of next in 1995 to about 2001. In the past six years,
Mr Joe also helped apple make a profit again.

Mac OS X released in 2001 is the tenth generation of Apple's operating system. It is based entirely on instructor Joe's next
The class library developed, so naturally, has a unified object-oriented runtime. In this runtime and class library system, Mac OS X calls it cocoa. Mac
OS x was not very good when it first came out, but it relies on this well-designed underlying system. The iterative development cycle of Mac OS X is much shorter than that of other operating systems (only slower than Linux,
But Linux only has the kernel). In just eight years, Mac OS X has made seven major releases. Although we can see Mac OS from
Only the minor version numbers from 10.0 to 10.6 are in progress. In fact, every time it is a major release, it is roughly equivalent
Windows 98 or Windows 2000 to Windows XP.
Such a release does not change the main version number. On the one hand, it is from the market perspective. On the other hand, it does indicate that the underlying layer of OS X is already in a relatively stable state. There are many windows
Programmers highly recommend. net. Yes. net
It is indeed a very good framework, but imagine that Apple had a unified runtime in 1995, and all the programs have been developed on this unified framework for so many years, if
The cocoa community is more mature than the. NET community.

Application Scripting

A system with inter-process communication alone cannot be regarded as a completely mature GUI system, because inter-process communication is still relatively low-level, while Gui
Application Software is endless, and it is impossible for any problems to be solved through communication between processes at the underlying layer. Therefore, to make the GUI system evolve to an easy-to-use and easy-to-Customize level, open to the GUI
Script control of the program. Only when the GUI program can be controlled externally can the GUI system be used together.
In fact, once you have a unified runtime, it is not difficult to use scripts to control GUI programs as long as you design a unified script interface during application software development. For example, Microsoft's office
Series kit, you can use Vbscript to control. Unfortunately, no system can implement full system control.
To achieve full system control, not only must the system provide the underlying support, but more importantly, it should be able to persuade all developers, or let all developers develop a good habit of opening up the script interface.
Technically speaking, this is not a big problem, as long as developers implement specific interfaces according to the unified script communication protocol. However, if a platform develops a GUI
There are too many methods, and developers only choose what they like. Such standards cannot be unified. For example, on Linux, Kde and gnome
They all have their own scripting systems, but some developers use Kde, some use gnome, and some simply do not use both. This cannot be considered as a consistent interface.
A platform must have consistent script control interfaces unless (1 ). there is a GUI development method on this platform. Since ancient times, there has been one on Huashan Road. If you don't do it, you can only make standard interfaces;
(2). Most of the mainstream application software on this platform has implemented this script interface, so because of the pull of these programs, other guis
To integrate the existing application software circle on the platform to communicate with each other, you must implement this interface. At 2000
At the same time, only one company was able to meet both requirements, namely apple. Microsoft partially implemented these two items, basically using VBA to unify the control of the Office,
Office, Microsoft's OLE object model is almost useless, and the closely bound VBA is naturally unattended. However, according to some friends who work in the financial industry, VBA
It can greatly improve the productivity of M $ office.

Gui
Scripting is not a overnight task, especially when we say that we need to make a unified script interface to meet the needs of various programs. This is not something we can do in a year or two, it will take many years of technical accumulation and design trade-offs
After that, it will be able to converge to a relatively stable and mature system. However, Apple has had such experience more than a decade ago. Why is Apple so lucky?

In the late 1980s s, there was a software on apple that was far beyond the age, called HyperCard.
I once played this software on the last generation of Apple. The specific idea is that you can store a "card" on which multimedia sound, image text, and other objects can be placed, basically
The only difference between web pages is that these cards all exist on the machine. This HyperCard
The software can be used for courseware, slide presentation, and so on. It is an extremely powerful tool. To allow users to customize this card, this program provides a very powerful programming system called
Hypertalk. Because this programming language is used by ordinary people rather than programmers, you will feel that it is not programming, but writing English. This set of things, though essentially from
Smalltalk
Learning, but programming with English syntax is indeed a brand new idea. Apple has carried forward this language to ordinary people's programming, rewrite the language and documents in a way closer to natural language and imitate
Hypertalk has released a cross-system scripting language called applescript. This language is no different from natural language. For example,
The size of the retrieved window is no longer
window.getSize()

Instead
get size of window

The first word displayed in section 22nd is no longer
print(paragraph[22].getWordByIndex[0])

Instead
print the first word of paragraph 22

Even worse, you can also write in French and Japanese. In the late 1980s s and the early 1990s S, Apple was basically
The computer is in the corner, leaving the publishing industry, design industry, and other professional industries. Because of the relationship between application software and graphic processing capabilities, the computer is still guarding the Apple Computer. Users in both industries need automated Gui
Control, but programming is not very good, so the developers of these applications also take the initiative to add applescript. Before Mr. Joe joined the team in 1990s, Apple
All the finder scripts and quarkxpress and FileMaker in the publishing industry are fully scripted. After Mr. Joe becomes master of Apple
Apple released safari, iTunes, iphotos, and other software on Mac OS X, all of which were scripted.
All the historical opportunities that other companies can expect and cannot find are captured by Apple, and all of them are stuffed into Mac OS X. All third-party development tools, such as Firefox,
Adium is not actually developed by Apple, and there is no strong Apple source. But Firefox should read safari bookmarks.
Applescript, so Firefox also forces Scripting (this does not exist on other platforms ). So does adium. This chat software wants
The songs being played by iTunes are regarded as status information. Okay, applescript, so they are also scripted, and the corresponding product pidgin on Linux
There is no such scripting. Therefore, the apple platform has become a kind of inertia. If you don't want to be scripted, you won't be involved. Do you still want to be scripted?

Conclusion

As we all know, the main philosophy of the UNIX era is to provide developers with a group of small and exquisite gadgets that can be used together at will, that is, the so-called software tools,

Then let the developers start from this and build their own tools to build their own Swiss Army knife. The purpose of the operating system used by developers is either to provide such a group of development tools, or
Development tools provide a convenient platform to make such tools possible. If UNIX is an operating system that is easy to transform into an "own operating system" in the command line era,
Mac OS X is an operating system in the GUI era. Mac OS X
Therefore, even if only application software is used, developers should give priority to Mac OS X.

Appendix A: relatively correct Mac OS X usage habits

0. Be sure to install quicksilver or use "services". Otherwise, Apple will be used as a Windows server.
1. on Apple computers, because of tools such as services and quicksilver, copying and pasting between 90% of programs can be avoided.
2. copy and paste the remaining 10% programs. If you use a good editor, you can omit 90%.

Appendix B: Why is the Linux system not good enough?

First, the GUI subsystem on Linux is not a part of Linux, but X and the above KDE and gnome
And so on. Over the past few years, these systems have finally begun to centrally manage an object-oriented runtime environment. However, both systems use C ++
Therefore, it takes a lot of effort to get the runtime information and take a long detour. If the two systems start with smalltalk
And so on, at least now there should be a framework that can compete with cocoa.

Second, in the past few years, X has also recognized the shortcomings in script-based control. Therefore, a few years ago, the RedHat standard for desktop was proposed.
It is a pity that every program has opened the promise interface, so compared with Apple, there is still a long way to go.

 

The author has a wealth of knowledge ..... History teacher? -_-! Moreover, it is obvious that small talk has too many preferences .......

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.