第7章高水準プログラミング言語
C++ and Objective CC++とObjective C
By the mid-1980s, businesses started focusing on user experience (UX), the overall experience of a person using a computer application, especially in terms of how easy or pleasing it is to use, and the user interface (UI), the point at which human users interact with a computer, website, or application. Windows-based UIs were adopted as new paradigms, which drove the creation of standards, perspectives, and sets of ideas that should be used to describe the structure and methodologies of an HLL. This resulted in the adoption of the OOP paradigm and the creation of OOP languages. The shift to OOP allowed software to focus on data and objects.
英語のヒント
1980年代半ばまでに、企業はユーザー体験(UX)とユーザーインターフェース(UI)を重視し始めた。UXは、コンピューターのアプリケーションを使う人の全体的な体験であり、特に、使いやすさや使っていて心地よいかという点を指す。UIは、人間の利用者がコンピューター、ウェブサイト、アプリケーションとやり取りする接点である。ウィンドウに基づくUIが新しいパラダイムとして採用され、HLLの構造や方法論を説明するために使う、標準、見方、考え方の集合を生み出す推進力となった。その結果、OOPのパラダイムが採用され、OOP言語が作られた。OOPへの移行によって、ソフトウェアはデータやオブジェクトを中心に考えられるようになった。
The C++ programming language extended the middle-level language features of C with OOP features that facilitated the expression of real-world requirements in programs, including in particular the support of graphical user interfaces (GUIs). Microsoft adopted C++ as the programming language for its Windows systems.
英語のヒント
C++プログラミング言語は、Cの中水準言語としての機能に、OOPの機能を加えて拡張した。これにより、現実世界の要求をプログラムで表しやすくなり、特にGUIへの対応が容易になった。Microsoftは、Windowsシステム用のプログラミング言語としてC++を採用した。
The syntax of the code in C++ for basic computation is exactly the same as the C code shown previously. There are major syntactical additions in C++ to support OOP. It became the preferred language during the mid-1980s and early 1990s and for the programming of GUIs. The code in Figure 7.4 illustrates the basics of Windows GUI programming using C++ and the Win32 API to create a simple “Hello World!” application with a graphical user interface (GUI).
英語のヒント
C++で基本的な計算を行うコードの構文は、前に示したCのコードとまったく同じである。C++には、OOPを支える大きな構文上の追加がある。1980年代半ばから1990年代初めにかけ、またGUIのプログラミングで、好まれる言語になった。図7.4のコードは、C++とWin32 APIを使い、GUIを備えた簡単な「Hello World!」アプリケーションを作る、Windows GUIプログラミングの基本を示す。

attribution: Copyright Rice University, OpenStax, under CC BY 4.0 license · CC BY 4.0 · Source出典
Figure 7.4 This GUI shows the “Hello World!” application using C++ and the Win32 API. (attribution: Copyright Rice University, OpenStax, under CC BY 4.0 license)
図7.4 このGUIは、C++とWin32 APIを使った「Hello World!」アプリケーションを示す。(出典:著作権 Rice University、OpenStax。CC BY 4.0ライセンス)
Objective-C is another hybrid language from the 1980s that makes use of imperative procedural, and object-oriented features. Apple adopted it to power their operating systems development efforts and became popular for a while as Apple’s only accepted language for programming apps for iPhones, later replaced by Swift.
英語のヒント
Objective-Cも、1980年代に生まれた混成言語で、命令型、手続き型、オブジェクト指向の機能を使う。Appleは、OS開発を支えるために採用した。iPhone用アプリを作る際にAppleが認める唯一の言語として、一時期広く使われ、後にSwiftに取って代わられた。
JavaJava
Consumer electrical devices, such as microwaves and interactive TVs, called for the invention of another OOP language: Java. Java evolved into a platform-independent, general-purpose language for computational devices, usable for everything from PCs and MACs to Androids and Samsung refrigerators. To this day, it remains one of the most widely used languages for teaching OOP and is one of the most popular HLLs in the world.
英語のヒント
電子レンジや対話型テレビなどの家電製品は、もう一つのOOP言語、Javaの発明を求めた。Javaは、PCやMacからAndroid端末、Samsungの冷蔵庫まで、あらゆる計算装置で使える、プラットフォームに依存しない汎用言語へ発展した。今日に至るまで、OOP教育で最も広く使われる言語の一つであり、世界で最も人気のあるHLLの一つである。
As shown in Figure 7.5, the syntax of the code in Java for typical computations is similar to that of the C code shown earlier. This is the case for most modern HLLs introduced since 1990.
英語のヒント
図7.5のように、一般的な計算を行うJavaのコードの構文は、前に示したCのコードの構文に似ている。1990年以降に登場した現代のHLLの大半について、同じことがいえる。

attribution: Copyright Rice University, OpenStax, under CC BY 4.0 license · CC BY 4.0 · Source出典
Figure 7.5 These are some of the elements available from the Java GUI API. (attribution: Copyright Rice University, OpenStax, under CC BY 4.0 license)
図7.5 JavaのGUI APIで利用できる要素の一部である。(出典:著作権 Rice University、OpenStax。CC BY 4.0ライセンス)
LINK TO LEARNING学習リンク
Refer to the ECMAScript standard (https://openstax.org/r/76JavaScript) if you would like to dig deeper into a syntax comparison that includes JavaScript.
英語のヒント
JavaScriptを含めた構文の比較をさらに詳しく調べたければ、ECMAScript標準(https://openstax.org/r/76JavaScript)を参照しよう。
Scripting Languagesスクリプト言語
A scripting language is characterized by placing a list of code statements into a file, referred to as a script. Script statements are typically interpreted line by line rather than being compiled as complete units to produce executable programs. There are advantages and disadvantages to interpreting and compiling methods, which we will cover in Implementation Approaches.
英語のヒント
スクリプト言語は、コードの文の一覧を、スクリプトと呼ぶファイルに置くことを特徴とする。スクリプトの文は、通常、全体を一つの単位としてコンパイルし、実行可能プログラムを作るのではなく、一行ずつ解釈される。解釈とコンパイルの方法には、それぞれ利点と欠点があり、「実装の方法」で扱う。
The most popular scripting languages employ C-like syntax, but they are purposed for different applications. For example, the JavaScript and PHP scripting languages are purposed for programming web applications.
英語のヒント
最も広く使われるスクリプト言語は、Cに似た構文を使うが、それぞれ異なる用途を持つ。たとえば、JavaScriptとPHPは、ウェブアプリケーションのプログラミングを目的とする。
CONCEPTS IN PRACTICE概念を実践する
HLLs and Web ApplicationsHLLとウェブアプリケーション
Most HLLs that are used to develop web applications are scripting languages. These include JavaScript, PHP, ASP.NET, and Python. JavaScript is nearly universal for front-end (browser, client-side) applications. Web servers such as the Apache web server and Microsoft’s Internet Information Services (IIS) server support a Common Gateway Interface (CGI) that allows the invocation of server-side programs including scripts.
英語のヒント
ウェブアプリケーションの開発に使うHLLの大半は、スクリプト言語であり、JavaScript、PHP、ASP.NET、Pythonなどがある。JavaScriptは、フロントエンド、つまりブラウザー側・クライアント側のアプリケーションで、ほぼ普遍的に使われている。Apacheウェブサーバーや、MicrosoftのInternet Information Services(IIS)サーバーなどは、スクリプトを含むサーバー側のプログラムを呼び出せる、Common Gateway Interface(CGI)に対応している。
Some of these scripting languages are now bolstered by web frameworks that are designed to support the development of applications in the particular languages. For example, the most popular framework for web applications today in JavaScript is React. The most popular one for Python is Django. A guide to web frameworks (https://openstax.org/r/76WebFrameworks) may be found at the Statista website.
英語のヒント
これらのスクリプト言語の一部は今、それぞれの言語でのアプリケーション開発を支えるよう設計された、ウェブフレームワークによって強化されている。たとえば、今日のJavaScriptのウェブアプリケーションで最も人気のあるフレームワークはReactである。PythonではDjangoが最も人気がある。ウェブフレームワークの案内(https://openstax.org/r/76WebFrameworks)は、Statistaのサイトで見つかる。