Merge pull request #5 from LCTT/master

update
This commit is contained in:
Xingyu.Wang 2019-01-27 20:30:50 +08:00 committed by GitHub
commit c1e592aef3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 241 additions and 315 deletions

View File

@ -1,143 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (zzzzzzmj)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (The History of Hello World)
[#]: via: (https://www.thesoftwareguild.com/blog/the-history-of-hello-world/)
[#]: author: (thussong https://www.thesoftwareguild.com/blog/author/thussong/)
The History of Hello World
======
Veteran software developers know the [Hello World][2] program as the first step in learning to code. The program, which outputs some variant of “Hello, World!” on a devices display, can be created in most languages, making it some of the most basic syntax involved in the coding process. In fact, a recent project at the Association for Computing Machinery (ACM) at Louisiana Tech [found][3] that there are at least 204 versions of the program.
Traditionally, Hello World programs are used to illustrate how the process of coding works, as well as to ensure that a language or system is operating correctly. They are usually the first programs that new coders learn, because even those with little or no experience can execute Hello World both easily and correctly.
Above all, Hello World is simple. Thats why it is so often used as a barometer of program success. If Hello World does not work effectively within the framework, then it is likely that other, more complex programs will also fail. As one expert at [Win-Vector][4] puts it, Hello World is actually a confrontational program. “The author is saying it isnt obvious your computer system will work, so I am not going to invest a lot of time in it until I see it can at least print one line of text,’” Win-Vector blogger John Mount says.
But this two-word phrase has big implications for the field of computer science. With Hello World as a foundation, novice programmers can easily understand computer science principles or elements. And professionals with years of coding experience can use it to learn how a given programming language works, especially in terms of structure and syntax. With applications at all skill levels and in almost every language, there is a long history behind such a short program.
### Uses
The main use for Hello World programs was outlined above: It is a way for rookie coders to become acquainted with a new language. However, the applications of these programs go beyond an introduction to the coding world. Hello World can, for example, be used as a sanity test to make sure that the components of a language (its compiler, development and run-time environment) have been correctly installed. Because the process involved in configuring a complete programming toolchain is lengthy and complex, a simple program like Hello World is often used as a first-run test on a new toolchain.
Hackers also use Hello World “as proof of concept that arbitrary code can be executed through an exploit where the system designers did not intend code to be executed,” according to programming consultants at Cunningham & Cunningham (C2). In fact, its the first step in using homemade content, or “home brew” on a device. When [experienced coders][5] are configuring an environment or learning a previously unknown one, they verify that Hello World behaves correctly.
It is also used as part of the debugging process, allowing programmers to check that they are editing the right aspect of a modifiable program at runtime and that it is being reloaded.
One more popular use for Hello World is as a basis for comparison. Coders can “compare the size of the executable that the language generates, and how much supporting infrastructure must exist behind the program for it to execute,” according to C2s wiki.
### Beginnings
Though the origins of Hello World remain somewhat unclear, its use as a test phrase is widely believed to have begun with Brian Kernighams 1972 book, A Tutorial Introduction to the Language B. In this text, the first known version of the program was used to illustrate external variables. Because the previous example in the tutorial printed “hi!” on the terminal, the more complex “hello, world!” required more character constants for expression and was the next step in the learning process.
From there, it was used in a Bell Laboratories memo in 1974, as well as The C Programming Language in 1978. This popular text is what made Hello World famous. The example from that book (the first, and most pure, example) printed “hello, world,” with no capital letters or exclamation point. At this time, Hello World was used almost solely to illustrate a few functions of a language— not to test whether the system was running.
Before Kernighams seminal texts on B and C, there was no standard first program. Even as late as 1972, it was not widely in use. The popular BASIC tutorial, “My Computer Likes Me, When I Speak in Basic,” starts with a simple program that writes a line of text. However, this message was “MY HUMAN UNDERSTANDS ME,” far from the two-word greeting programmers use today. But once Hello World was invented, it spread quickly, becoming well-known by the late 1970s. Its popularity continues to this day.
### One Statement, Many Languages
Heres what the code for Hello World looks like in some of the most popular programming languages currently in use.
#### Java
```
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
```
#### C#
```
using System;
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello, world!");
}
}
```
#### Python
```
print("Hello, world!")
```
#### Ruby
```
puts "Hello, world!"
```
#### Scala
```
object HelloWorld extends App {
println("Hello, world!")
}
```
#### ASP.NET
`Response.Write("Hello World!");`
#### Lisp
```
(princ "Hello, world!")
```
#### Haskell
```
main = putStrLn "Hello, world!"
```
#### Malbolge
```
('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>}=<M:9wv6WsU2T|nm-,jcL(I&%$#"
`CB]V?Tx<uVtT`Rpo3NlF.Jh++FdbCBA@?]!~|4XzyTT43Qsqq(Lnmkj"Fhg${z@>
```
#### Go
```
package main
import "fmt"
func main() {
fmt.Println("Hello, world!")
}
```
### Hello World Today: A Standard Practice in Varied Forms
In modern coding languages, Hello World is deployed at different levels of sophistication. For example, the Go language introduced a multilingual Hello World program, and XL features a spinning, 3D version complete with graphics. Some languages, like Ruby and Python, need only a single statement to print “hello world,” but a low-level assembly language could require several commands to do so. Modern languages also introduce variations in punctuation and casing. These include the presence or absence of the comma and exclamation point, as well as the capitalization of both words. For example, when systems only support capital letters, the phrase appears as “HELLO WORLD.” The first nontrivial Malbolge program printed “HEllO WORld.” Variations go beyond the literal as well. In functional languages like Lisp and Haskell, factorial programs are substituted for Hello World to emphasize recursive techniques. This is different from the original examples, which emphasized I/O and produced side effects.
With the increasing complexity of modern coding languages, Hello World is more important than ever. Both as a test and a teaching tool, it has become a standardized way of allowing programmers to configure their environment. No one can be sure why Hello World has stood the test of time in an industry known for rapid-fire innovation, but it is here to stay.
--------------------------------------------------------------------------------
via: https://www.thesoftwareguild.com/blog/the-history-of-hello-world/
作者:[thussong][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.thesoftwareguild.com/blog/author/thussong/
[b]: https://github.com/lujun9972
[1]: https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.thesoftwareguild.com%2Fblog%2Fthe-history-of-hello-world%2F&title=The%20History%20of%20Hello%20World
[2]: http://en.wikipedia.org/wiki/%22Hello,_World!%22_program
[3]: http://whatis.techtarget.com/definition/Hello-World
[4]: http://www.win-vector.com/blog/2008/02/hello-world-an-instance-rhetoric-in-computer-science/
[5]: http://c2.com/cgi/wiki?HelloWorld

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (MjSeven)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: subject: (How to bring good fortune to your Linux terminal)

View File

@ -7,235 +7,157 @@
[#]: via: (https://www.linux.com/blog/learn/2019/1/top-5-linux-server-distributions)
[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen)
Top 5 Linux Server Distributions
另一种 5 个顶级 Linux 服务器发行版
======
> Jack Wallen 为 Linux 服务器发行版提供了一些可靠的选择,绝对值回票价。
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/rockstor-main.jpg?itok=VNvfEIlf)
Ah, the age-old question: Which Linux distribution is best suited for servers? Typically, when this question is asked, the standard responses pop up:
啊,这个古老的问题:哪种 Linux 发行版最适合做服务器?通常,问这种问题时,所浮现出来的标准的答复就是:
* RHEL
* SUSE
* Ubuntu Server
* Ubuntu 服务器
* Debian
* CentOS
然而,假如你将眼界放得更宽(不将服务器只看做是 IDC 托管的那种互联网服务器时),可能答案会有点不同。我准备稍微来点不同的。我想做出一个满足入选标准的发行版列表,这些发行版不仅是优秀的候选者,而且易于使用,可以为你的业务中的许多功能提供服务。在某些情况下,我选择的是一些替代品,可以取代其它需要一些工作才能达成要求的操作系统。
However, in the name of opening your eyes to maybe something a bit different, Im going to approach this a bit differently. I want to consider a list of possible distributions that are not only outstanding candidates but also easy to use, and that can serve many functions within your business. In some cases, my choices are drop-in replacements for other operating systems, whereas others require a bit of work to get them up to speed.
Some of my choices are community editions of enterprise-grade servers, which could be considered gateways to purchasing a much more powerful platform. Youll even find one or two entries here to be duty-specific platforms. Most importantly, however, what youll find on this list isnt the usual fare.
我的一些选择是企业级服务器的社区版本,它们可以被视为购买更强大平台的入门级产品。你甚至可以在这里找到一两个作为特定任务平台的候选者。然而,最重要的是,你在此列表中找到的并非寻常的泛泛之辈。
### ClearOS
What is ClearOS? For home and small business usage, you might not find a better solution. Out of the box, ClearOS includes tools like intrusion detection, a strong firewall, bandwidth management tools, a mail server, a domain controller, and much more. What makes ClearOS stand out above some of the competition is its purpose is to server as a simple Home and SOHO server with a user-friendly, graphical web-based interface. From that interface, youll find an application marketplace (Figure 1), with hundreds of apps (some of which are free, whereas some have an associated cost), that makes it incredibly easy to extend the ClearOS featureset. In other words, you make ClearOS the platform your home and small business needs it to be. Best of all, unlike many other alternatives, you only pay for the software and support you need.
什么是 ClearOS对于家庭和小型企业用途你可能找不到比它更好的解决方案。ClearOS 开箱即用,包括了入侵检测、强大的防火墙、带宽管理工具、邮件服务器、域控制器等工具。其目的是将服务器作为一个简单的家庭和 SOHO 服务器,并具有用户友好的基于 Web 的图形化界面,这使得 ClearOS 在某些评比中脱颖而出。从其界面中,你可以找到一个应用程序市场(图 1其中包含数百个应用程序其中一些是免费的而另一些则具有相关费用这使得扩展 ClearOS 功能集非常容易。换句话说,你可以将 ClearOS 作为你的家庭和小型企业所需的平台。最重要的是,与许多其他替代方案不同,你只需支付所需的软件和支持。
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/clearos.jpg?itok=knQkn5ch)
There are three different editions of ClearOS:
* [ClearOS Community][1] - the free edition of ClearOS
*图 1ClearOS 应用程序市场*
* [ClearOS Home][2] - ideal for home offices
有三种版本的 ClearOS
* [ClearOS Business][3] - ideal for small businesses, due to the inclusion of paid support
* [ClearOS Community][1] - 免费版 ClearOS
* [ClearOS Home][2] - 适于家庭办公
* [ClearOS Business][3] - 适于小型企业,包括了付费支持。
为了使软件安装更加容易ClearOS 应用市场允许你通过以下方式进行选择软件:
   * 按功能(根据任务显示应用程序)
   * 按类别(显示相关应用程序组)
   * 快速选择文件(允许你按预先配置的模板选择,以帮助你快速启动和运行)
换句话说,如果你正在寻找 Linux 的家庭、SOHO 或 SMB 服务器ClearOS 是一个出色的选择(特别是如果你没有启动和运行标准的 Linux 服务器的能力时)。
To make the installation of software even easier, the ClearOS marketplace allows you to select via:
### Fedora 服务器
* By Function (which displays apps according to task)
你肯定听说过 Fedora Linux。它是市场上最好的前沿发行版之一。但是你知道这个出色的 Fedora 桌面发行版的开发者们也开发了服务器版吗Fedora 服务器平台是一个短生命周期的、社区支持的服务器操作系统。这使得经验丰富的、或对任何类型的 Linux或任何操作系统有经验的系统管理员可以使用开源社区中提供的最新技术。在这段描述中有三个关键词
* By Category (which displays groups of related apps)
* 经验丰富
* 系统
* 管理员
* Quick Select File (which allows you to select pre-configured templates to get you up and running fast)
In other words, if youre looking for a Linux Home, SOHO, or SMB server, ClearOS is an outstanding choice (especially if you dont have the Linux chops to get a standard server up and running).
### Fedora Server
Youve heard of Fedora Linux. Of course you have. Its one of the finest bleeding edge distributions on the market. But did you know the developers of that excellent Fedora Desktop distribution also has a Server edition? The Fedora Server platform is a short-lifecycle, community-supported server OS. This take on the server operating system enables seasoned system administrators, experienced with any flavor of Linux (or any OS at all), to make use of the very latest technologies available in the open source community. There are three key words in that description:
* Seasoned
* System
* Administrators
In other words, new users need not apply. Although Fedora Server is quite capable of handling any task you throw at it, its going to require someone with a bit more Linux kung fu to make it work and work well. One very nice inclusion with Fedora Server is that, out of the box, it includes one of the finest open source, web-based interface for servers on the market. With Cockpit (Figure 2) you get a quick glance at system resources, logs, storage, network, as well as the ability to manage accounts, services, applications, and updates.
换言之,新用户就不要考虑了。虽然 Fedora 服务器完全能够处理你抛出的任何任务,但它需要一些拥有更多的 Linux 功夫的人来使它工作并且运行良好。Fedora 服务器非常好的一点是,开箱即用,它包括了市场上用于服务器的开源的基于 Web 的最好的界面之一。通过 Cockpit图 2你可以快速浏览系统资源、日志、存储、网络以及拥有管理帐户、服务、应用程序和更新的能力。
![Fedora Server][5]
Figure 2: Cockpit running on Fedora Server.
*图 2运行在 Fedora 服务器上的 Cockpit*
[Used with permission][6]
If youre okay working with bleeding edge software, and want an outstanding admin dashboard, Fedora Server might be the platform for you.
如果你可以使用最前沿的软件并想要一个出色的管理仪表板Fedora 服务器可能就是你要的平台。
### NethServer
NethServer is about as no-brainer of a drop-in SMB Linux server as youll find. With the latest iteration of NethServer, your small business will enjoy:
正如你所发现的那样NethServer 是每个人都知道的简单 SMB Linux 服务器。通过 NethServer 的最新版本,你的小型企业将得到:
* Built-in Samba Active Directory Controller
* 内置 Samba 活动目录控制器
   * 与 Nextcloud 的无缝集成
   * 证书管理
   * HTTPS 透明代理
   * 防火墙
   * 邮件服务器和过滤器
   * Web 服务器和过滤器
   * 群件
   * IPS / IDS 或 VPN
* Seamless Nextcloud integration
* Certificate management
* Transparent HTTPS proxy
* Firewall
* Mail server and filter
* Web server and filter
* Groupware
* IPS/IDS or VPN
All of the included features can be easily configured with a user-friendly, web-based interface that includes single-click installation of modules to expand the NethServer feature set (Figure 3) What sets NethServer apart from ClearOS is that it was designed to make the admin job easier. In other words, this platform offers much more in the way of flexibility and power. Unlike ClearOS, which is geared more toward home office and SOHO deployments, NethServer is equally at home in small business environments.
所有包含的功能都可以通过用户友好的基于 Web 的界面轻松配置,包括单击安装模块以扩展 NethServer 功能集(图 3。NethServer 与 ClearOS 的区别在于它的设计目的是使管理工作更轻松。换句话说,这个平台提供了更多的灵活性和功能。与面向家庭办公室和 SOHO 部署的 ClearOS 不同NethServer 在小型商业环境中用起来就像在家庭里使用一样方便。
![NethServer][8]
Figure 3: Adding modules to NethServer.
[Used with permission][6]
*图 3给 NethServer 添加模块*
### Rockstor
Rockstor is a Linux and Btfrs powered advanced Network Attached Storage (NAS) and Cloud storage server that can be deployed for Home, SOHO, as well as small- and mid-sized businesses alike. With Rockstor, you get a full-blown NAS/Cloud solution with a user-friendly, web-based GUI tool that is just as easy for admins to set up as it is for users to use. Once you have Rockstor deployed, you can create pools, shares, snapshots, manage replication and users, share files (with the help of Samba, NFS, SFTP, and AFP), and even extend the featureset, thanks to add-ons (called Rock-ons). The list of Rock-ons includes:
Rockstor 是采用 Linux 和 Btfrs 的高级网络附加存储NAS和云存储服务器可部署用于家庭、SOHO 以及中小型企业。借助 Rockstor你可以获得一个完整的 NAS /云解决方案,其中包含一个用户友好的基于 Web 的 GUI 工具,管理员可以像普通用户一样轻松使用它来设置。一旦部署好了 Rockstor你就可以创建存储池、共享、快照、管理复制和用户、共享文件借助 Samba、NFS、SFTP 和 AFP甚至扩展它的功能集这要归功于附加组件称为 Rock-ons。Rock-ons 列表包括:
* CouchPotato (Downloader for usenet and bittorrent users)
* CouchPotatoUsenet 和 BitTorrent 用户的下载器)
* DelugeBitTorrent 用户的电影下载器)
* EmbyServerEmby 媒体服务器)
* Ghost专业博主的发布平台
* GitLab CEGit 仓库托管和协作)
* Gogs Go Git Service轻量级 Git 版本控制服务器和前端)
* HeadphonesNZB 和 Torrent 的音乐自动下载器)
* 用于 Squeezebox 设备的罗技 Squeezebox 服务器
* MariaDB关系型数据管理系统
* NZBGet高效的 usenet 下载器)
* OwnCloud-Official安全的文件共享和托管
* Plexpy基于 Python 的 Plex 用量跟踪器)
* Rocket.Chat开源聊天平台
* SaBnzbdUsenet 下载器)
* Sickbeard用于电视节目的互联网个人视频录像机
* Sickrage电视节目的自动视频库管理器
* SonarrUsenet 和 BitTorrent 用户的个人视频录像机)
* Symform备份设备
* Deluge (Movie downloader for bittorrent users)
* EmbyServer (Emby media server)
* Ghost (Publishing platform for professional bloggers)
* GitLab CE (Git repository hosting and collaboration)
* Gogs Go Git Service (Lightweight Git version control server and front end)
* Headphones (An automated music downloader for NZB and Torrent)
* Logitech Squeezebox Server for Squeezebox Devices
* MariaDB (Relational database management system)
* NZBGet (Efficient usenet downloader)
* OwnCloud-Official (Secure file sharing and hosting)
* Plexpy (Python-based Plex Usage tracker)
* Rocket.Chat (Open Source Chat Platform)
* SaBnzbd (Usenet downloader)
* Sickbeard (Internet PVR for TV shows)
* Sickrage (Automatic Video Library Manager for TV Shows)
* Sonarr (PVR for usenet and bittorrent users)
* Symform (Backup service)
Rockstor also includes an at-a-glance dashboard that gives admins quick access to all the information they need about their server (Figure 4).
Rockstor 还包括了一目了然的仪表板,使管理员可以快速访问他们所需的有关其服务器的所有信息(图 4
![Rockstor][10]
The Rockstor dashboard in action.
[Used with permission][6]
*图 4 Rockstor 面板*
### Zentyal
Zentyal is another Small Business Server that does a great job of handling multiple tasks. If youre looking for a Linux distribution that can handle the likes of:
* Directory and Domain server
* Mail server
* Gateway
* DHCP, DNS, and NTP server
* Certification Authority
Zentyal 是另一个小型企业服务器,可以很好地处理多个任务。如果你正在寻找可以处理以下内容的 Linux 发行版:
* 目录和域服务器
* 邮件服务器
* 网关
* DHCP、DNS 和 NTP 服务器
* 认证机构CA
* VPN
* 实时消息IM
* FTP 服务器
* 反病毒
* SSO 认证
* 文件共享
* RADIUS 认证
* 虚拟化管理
* 等等
* Instant Messaging
* FTP server
* Antivirus
* SSO authentication
* File sharing
* RADIUS
* Virtualization Management
* And more
Zentyal might be your new go-to. Zentyal has been around since 2004 and is based on Ubuntu Server, so it enjoys a rock-solid base and plenty of applications. And with the help of the Zentyal dashboard (Figure 5), admins can easily manage:
* System
* Network
* Logs
* Software updates and installation
* Users/groups
* Domains
* File sharing
* Mail
Zentyal 可能是你的新选择。从 2004 年 Zentyal 就存在了,它基于 Ubuntu Server因此它拥有坚实的基础和丰富的应用程序。在 Zentyal 仪表板的帮助下(图 5管理员可以轻松管理
* 系统
* 网络
* 日志
* 软件更新和安装
* 用户/组
* 域
* 文件共享
* 邮件
* DNS
* Firewall
* Certificates
* And much more
* 防火墙
* 证书
* 等等
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/zentyal.jpg?itok=Un9lpgh6)
*图 5Zentyal 仪表板*
Adding new components to the Zentyal server is as simple as opening the Dashboard, clicking on Software Management > Zentyal Components, selecting what you want to add, and clicking Install. The one issue you might find with Zentyal is that it doesnt offer nearly the amount of addons as youll find in the likes of Nethserver and ClearOS. But the services it does offer, Zentyal does incredibly well.
向 Zentyal 服务器添加新组件只需要打开仪表板,单击“软件管理” -> “Zentyal 组件”选择要添加的组件然后单击安装。Zentyal 可能会遇到的一个问题是,它提供不了与 Nethserver 和 ClearOS 一样多的插件。但它提供的服务,则做得非常好。
### Plenty More Where These Came From
### 更多来自于
This list of Linux servers is clearly not exhaustive. What it is, however, is a unique look at the top five server distributions youve probably not heard of. Of course, if youd rather opt to use a more traditional Linux server distribution, you can always stick with [CentOS][11], [Ubuntu Server][12], [SUSE][13], [Red Hat Enterprise Linux][14], or [Debian][15]… most of which are found on every list of best server distributions on the market. If, however, youre looking for something a bit different, give one of these five distos a try.
这个 Linux 服务器列表显然不是详尽无遗的。然而,这是一种对你可能没有听说过的五大服务器发行版的独特视角。当然,如果你更愿意使用更传统的 Linux 服务器发行版,你可以随时坚持使用 [CentOS][11]、[Ubuntu 服务器][12]、[SUSE][13]、[RHEL][14] 或 [Debian][15]……它们大多都出现在市场上最好的服务器发行版列表中。但是,如果你正在寻找一些不同的东西,那么试试这五个发行版中的一个。
Learn more about Linux through the free ["Introduction to Linux" ][16]course from The Linux Foundation and edX.
通过 Linux 基金会和 edX 的免费[“Linux 简介”][16]课程了解有关 Linux 的更多信息。
--------------------------------------------------------------------------------
@ -243,7 +165,7 @@ via: https://www.linux.com/blog/learn/2019/1/top-5-linux-server-distributions
作者:[Jack Wallen][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,147 @@
[#]: collector: "lujun9972"
[#]: translator: "zzzzzzmj"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: subject: "The History of Hello World"
[#]: via: "https://www.thesoftwareguild.com/blog/the-history-of-hello-world/"
[#]: author: "thussong https://www.thesoftwareguild.com/blog/author/thussong/"
# Hello World 的由来
资深软件开发人员都知道[Hello world](2)程序,一个能被输出多种"Hello, World!"的程序是学习编程的第一步。这个编程中只涉及到一些最基本语法的程序可以被大多数语言输出在显示器上。事实上路易斯安纳理工学院计算机协会ACM在最近统计[发现](3)这个项目至少有204个版本。
传统意义上Hello World程序是用于说明编码过程是如何工作的以及确保语言或系统能正常运行。它们经常是新手程序员学习的第一个程序因为即使是经验很少或者没有经验的人也能轻松正确的执行Hello World。
首先Hello World 简单这就是为什么它经常被用做程序执行成功的晴雨表。如果Hello World在框架中无法有效执行那么在其他更复杂的程序中也可能会失败。正如[Win-Vector](4)的一位专家所说,"Hello World实际上是一个对抗性程序"。该作者还说道,"你的计算机系统没有工作并不起眼,所有我们不会花很多时间在上面,不过我要看到它至少能打印一行文字"。
但是 这个两词短语在计算机科学领域有着重大的影响。以Hello World为基础新手程序员可以轻松的去理解计算机科学原理而拥有多年编码经验的程序员可以用它来学习编程语言的工作原理特别是在结构与语言方面。这样的一个小程序在任何难度和几乎所有的语言的应用程序中都有着悠久的历史。
### 用途
上文中一句话概括Hello World程序的主要用途这是新手程序员熟悉新语言的一种方式。然而这些程序不仅仅是对编码世界的介绍。例如Hello World 可以作为测试以确保语言的组件编译器开发和运行环境安装正确。因为配置完整的编程工具链的过程复杂而漫长所以像Hello World这样简单的程序通常用作新工具的首次运行测试。
根据Cunningham & Cunningham C2的编程顾问所说 黑客经常使用Hello World程序 来证明猜想因为任何代码都可以通过漏洞执行而系统设计人员并不允许执行代码。事实上它是在设备上使用自制内容或者“home brew”的第一步 当[有经验的编码人员](5)正在配置环境或在学习新事物时他们会Hello World 来验证动作是否正确。
它也是作为调试的一部分,允许程序员在程序运行时检查他么编辑修改了的地方是否正确,然后重新加载。
Hello World的一个更常用的用途是作为基础的比较。根据C2的wiki所讲程序员可以比较语言生成的可执行文件的大小以及程序背后必须存在多少支持基础结构才能执行。
### 开端
虽然Hello World 的起源还有些不太明了不过人们普遍认为它是作为测试用语最早出现在Brian Kernigham 在1972年发布的B语言教程简介中。在此文中该程序的第一个已知版本用于说明外部变量。因为教程中的前一个例子在终端上打印了“hi!”而需要更多字符常量来表达相对复杂的“hello,world!”,是学习过程的下一步。
在那以后它还被用于1974年的贝尔实验室备忘录以及1987年的C语言程序设计。这两篇著名的文章是让Hello World闻名于世的主要原因。在书中的一个例子第一个也是最著名的例子打印了没有大写字母和感叹号的“hello,world”此时的Hello World几乎只是用于说明语言的一些功能而不是测试系统是否正常运行。
在Kernigham的关于B语言和C语言的开创性文章之前没有真正意义上的第一个程序甚至直到1974年它也没被广泛使用。著名的BASIC教程“My Computer Likes MeWhen I Speak BASIC”从一个写一行文本的简单程序开始不过那句话是“MY HUMAN UNDERSTANDS ME”跟如今程序员侃侃而谈的双词问候语差的有点远。不过当Hello World被发明后它就迅速传播并在20世纪70年代后从所周知。直到今天它也依然受欢迎。
### 一个声明, 多种语言
以下是目前正在被使用的一些流行的编程语言中的Hello World 代码
#### Java
```
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
```
#### C#
```
using System;
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello, world!");
}
}
```
#### Python
```
print("Hello, world!")
```
#### Ruby
```
puts "Hello, world!"
```
#### Scala
```
object HelloWorld extends App {
println("Hello, world!")
}
```
#### ASP.NET
```
Response.Write("Hello World!");
```
#### Lisp
```
(princ "Hello, world!")
```
#### Haskell
```
main = putStrLn "Hello, world!"
```
#### Malbolge
```
('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>}=<M:9wv6WsU2T|nm-,jcL(I&%$#"
`CB]V?Tx<uVtT`Rpo3NlF.Jh++FdbCBA@?]!~|4XzyTT43Qsqq(Lnmkj"Fhg${z@>
```
#### Go
```
package main
import "fmt"
func main() {
fmt.Println("Hello, world!")
}
```
### 如今的 Hello world: 各种形式下的标准实践
在现在的编程语言中Hello world有着不同的复杂程度。例如Go语言中引入一个多语言的Hello World程序XL则会提供一个具有图形、可旋转的3D版本。一些编程语言像RubyPython仅仅需要一个声明去打印"Hello World",但是低级汇编语言则需要几个命令才能做到这样。现在的编程语言还引入对标点符号的支持,包括逗号或者感叹号是否存在,以及两个词的大写。举个例子,当系统只支持大写字母,会呈现像"HELLO WORLD"的短语。第一个不平凡的Malbolge程序打印出了"HEllO WORld"跨域了原本的字面意思。功能语言像Lisp、Haskell阶乘程序替代了Hello World从而注重递归技术。这与原来的示例不同后者更强调I/O以及产生的副作用。
随着现在的编程语言越来越复杂Hello World 比以往显得更加重要。同样作为测试和教学工具它已经成为程序员测试配置的编程环境的标准方法。没有人能确切说出为什么Hello World能在快速创新著称的行业中经受住时间的考验但是它又确实留下来了。
--------------------------------------------------------------------------------
via: https://www.thesoftwareguild.com/blog/the-history-of-hello-world/
作者:[thussong][a]
选题:[lujun9972][b]
译者:[zzzzzzmj](https://github.com/zzzzzzmj)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.thesoftwareguild.com/blog/author/thussong/
[b]: https://github.com/lujun9972
[1]: https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.thesoftwareguild.com%2Fblog%2Fthe-history-of-hello-world%2F&title=The%20History%20of%20Hello%20World
[2]: http://en.wikipedia.org/wiki/%22Hello,_World!%22_program
[3]: http://whatis.techtarget.com/definition/Hello-World
[4]: http://www.win-vector.com/blog/2008/02/hello-world-an-instance-rhetoric-in-computer-science/
[5]: http://c2.com/cgi/wiki?HelloWorld