惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
Google Online Security Blog
Google Online Security Blog
Engineering at Meta
Engineering at Meta
U
Unit 42
Security Latest
Security Latest
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
D
Docker
T
Tailwind CSS Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
云风的 BLOG
云风的 BLOG
Hugging Face - Blog
Hugging Face - Blog
M
MIT News - Artificial intelligence
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
MongoDB | Blog
MongoDB | Blog
H
Help Net Security
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
S
Security Affairs
T
The Exploit Database - CXSecurity.com
S
SegmentFault 最新的问题
N
News and Events Feed by Topic
The GitHub Blog
The GitHub Blog
Apple Machine Learning Research
Apple Machine Learning Research
S
Securelist
IT之家
IT之家
P
Palo Alto Networks Blog
D
DataBreaches.Net
Help Net Security
Help Net Security
N
Netflix TechBlog - Medium
B
Blog RSS Feed
AWS News Blog
AWS News Blog
Scott Helme
Scott Helme
爱范儿
爱范儿
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
I
Intezer
J
Java Code Geeks
大猫的无限游戏
大猫的无限游戏
Microsoft Security Blog
Microsoft Security Blog
人人都是产品经理
人人都是产品经理
G
GRAHAM CLULEY
N
News | PayPal Newsroom
博客园 - 三生石上(FineUI控件)
A
Arctic Wolf
F
Fortinet All Blogs
The Register - Security
The Register - Security
Recent Commits to openclaw:main
Recent Commits to openclaw:main
博客园 - 【当耐特】

RisingIce

2024年终总结 | RisingIce 使用大模型总结B站视频 | RisingIce 使用Vercel搭建Umami统计 | RisingIce 部署Twikoo评论系统 | RisingIce Vercel域名被墙的问题 | RisingIce 修改anzhiyu主题的TianliGPT插件为其他大模型API | RisingIce Ubuntu挂载群晖共享文件夹与Comfyui模型迁移 | RisingIce 记一次conda环境激活却不起作用的问题及解决方法 | RisingIce 《程序员的README》- 随笔 | RisingIce
Hello Word的由来 | RisingIce
RisingIce · 2023-12-10 · via RisingIce

一、前言 ​

还记得大一刚学编程的时候,学的第一门语言是C语言,print出的第一行代码是Hello World。现在想起来记忆已经有些模糊,只记得当时配置好环境之后,跟着老师一个字母一个字母的输入进去,点击运行之后,cmd窗口弹出,第一行就是Hello World,当时忙于惊叹于计算机编程之神奇带给我的冲击,并没有细想为什么是Hello World,老师也没有过多解释。今天周末闲来无事,就去翻找了一下Wiki以及其他资料,在此做一个总结报告记录一下。

二、Hello World 的由来 ​

Hello World 最早可追溯至1973Brian Kernighan 撰写的一份内部的技术文件《A Tutorial Introduction to the Language B》中的一个示例程序:

bash

main( ) {
    extern a, b, c;
    putchar(a); putchar(b); putchar(c); putchar('!*n');
}
 
a 'hell';
b 'o, w';
c 'orld';

但让其广为流传的是1978年由Brian Kernighan 和C 语言之父 - Dennis M. Ritchie 合著的C程序设计语言,它是第一部介绍C语言编程方法的书籍,书中用"hello,world"为示例开始讲解程序设计:

在示例中,main( )函数定义了程序开始执行的位置。其主体由一条语句组成,即对printf函数的调用,意思是“打印格式化”(print formatted)。这个函数将使程序输出以参数传递给它的任何内容,在本例中是字符串hello, world。

▲布莱恩·柯尼汉在1978年用C语言手写的hello,world程序以及他个人的亲笔签名,图片来源于wiki

随着这部经典著作的大卖,"hello, world"也流行起来,逐渐成为具有特定象征意义的文化符号。

e40d54c637b88d0a5417fe82ad21a3a5.jpege40d54c637b88d0a5417fe82ad21a3a5.jpeg

▲年轻时的布莱恩·柯尼汉,图片来源网络

但是非常遗憾的是,当 Forbes India 杂志在2011年采访他的时候,他自己对这段传奇故事中一些记忆已经有点儿模糊了。当他被问及关于“hello,world”的准确来历时,他是回答时说:

我只记得,我好像看过一幅漫画,讲述一枚鸡蛋和一只小鸡的故事,在那副漫画中,小鸡说了一句 ‘Hello World’

三、目前一些流行语言的Hello World ​

Java

java

class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, world!");
    }
}

Python

Python

print("Hello, World!")

C#

c#

using System;

class Program {
    static void Main(string[] args) {
        Console.WriteLine("Hello, World!");
    }
}

C++

c++

#include <iostream>

int main() {
    std::cout << "Hello, World!" << std::endl;
    return 0;
}

Ruby


Go

go

package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}

Kotlin

kotlin

fun main() {
    println("Hello, World!")
}

Rust

rust

fn main() {
    println!("Hello, World!");
}

PHP

php

<?php
echo "Hello, World!";
?>

TypeScript

typescript

console.log("Hello, World!");

Scala

scala

object HelloWorld {
  def main(args: Array[String]): Unit = {
    println("Hello, World!")
  }
}

Erlang

erlang

io:format("Hello, World!~n").