情绪高涨是什么意思| mg什么意思| 洋葱和什么相克| 低密度脂蛋白是什么意思| 远香近臭是什么意思| 综合能力测试考什么| 欲壑难填是什么意思| 买李世民是什么生肖| 奶油霜是什么| 拉屎有血是什么原因| 什么粥最养胃健脾| 疔是什么意思| 疱疹病毒是什么引起的| 大便白色是什么原因| 转氨酶升高有什么症状| 丙磺舒是什么药| 一什么耳朵| 夏天适合喝什么养生茶| 芙字五行属什么| 庚什么意思| 玻璃水是干什么用的| 怀孕从什么时候开始算起| 喝茶什么意思| 唯粉是什么意思| 孢子是什么东西| 做梦梦见生孩子是什么意思| 小孩掉头发是什么原因| pure什么意思| 什么手什么足| 学生近视配什么镜片好| 手麻脚麻是什么原因引起的| 宰相的宰最早指什么| 腰扭伤挂什么科| 杨树林是什么品牌| 一个木一个号念什么| 生物学是什么| 世界7大奇迹是什么| 云的五行属性是什么| 四十不惑是什么意思| shark是什么牌子| 腹胀便溏是什么意思| 海关清关什么意思| 刘德华属什么生肖| 耳朵上长痣代表什么| 什么人不能吃南瓜| 孕酮低会有什么影响| 9月18日是什么日子| 肌酐低是什么意思| 子宫内膜异位症有什么症状| 总蛋白偏高有什么危害| 械字号产品是什么意思| 倪妮和倪萍什么关系| pvs是什么意思| 皮内瘤变到底是什么意思| 部分空蝶鞍是什么意思| 黑丝是什么| 尔昌尔炽什么意思| 调节是什么意思| nbc是什么意思| 脚底长痣有什么说法| 药店为什么不让卖高锰酸钾| 什么时候立秋| 蓝色加红色是什么颜色| 诺五行属什么| 车什么马什么| c1和c2有什么区别| 锹形虫吃什么| 花牛是什么| 藿香正气水什么牌子的好| 梗是什么意思| 第二聚体高什么意思| 为什么脚会脱皮| 女生肚脐眼下面疼是什么原因| 智齿是什么| 强的松又叫什么名字| 甘油是什么东西| 清清什么| 倍增是什么意思| 子不教父之过是什么意思| 农历七月初七是什么节日| 服装属于五行什么行业| 羊球是什么| 干呕是什么病的前兆| 小孩子打呼噜是什么原因| 炖猪排骨放什么调料| 槟榔长什么样| 眼睛干涩用什么眼药水好| 嗓子哑是什么原因引起的| 大圣归来2什么时候上映| 老是放屁什么原因| 磷脂是什么| 榴莲有什么功效| 翘首以盼是什么意思| 容易早醒是什么原因| 深海鱼油有什么功效| 碱吃多了有什么危害| 海白菜是什么菜| 肌肉僵硬是什么原因引起的| 身体上有小红点是什么病| 喉咙发炎吃什么食物| 怕冷畏寒是什么原因| 常吃阿司匹林有什么副作用| 盛夏是什么意思| 笄礼是什么意思| 直接胆红素偏低是什么原因| 什么症状吃保心丸| adidas是什么牌子| 孝敬是什么意思| 血红蛋白低是什么原因| 脑供血不足是什么原因| 九出十三归是什么意思| 过誉是什么意思| 子宫在什么位置| 老婆子是什么意思| 默契是什么意思| 价值连城是什么意思| 肋间神经痛什么症状| 福州有什么好吃的| 双子座和什么座最配对| 优衣库属于什么档次| 真菌孢子阳性什么意思| 榄仁叶是什么树的叶子| 什么是挂科| 大便黄色是什么原因| 地果是什么| 姐姐的老公叫什么| 成何体统是什么意思| 纨绔子弟什么意思| 济州岛有什么好玩的| 脾虚湿盛吃什么药| 不老实是什么意思| 什么的月光| g18k金是什么意思| 脚浮肿是什么原因| 鸡肾炒什么配菜好吃| 重要是什么意思| md是什么职位| 什么叫生僻字| 粽子用什么叶子包| 女人卵巢保养吃什么好| 什么是回南天| 平均分是什么意思| 化痰吃什么药| 什么是热性水果| 头疼吃什么药| 资产负债率高说明什么| 腱鞘炎吃什么药好| 马蜂泡酒有什么功效| 总感觉自己有病是什么心理病| 燕然未勒归无计的上一句是什么| 吃什么能瘦肚子| 颇负盛名的颇是什么意思| 喝什么茶可以降血糖| 尿频是什么原因导致的| 润滑油可以用什么代替| 尿道炎症状吃什么药| 36什么意思| rb是什么| 98年出生属什么| 人的心脏在什么位置| 考试紧张吃什么药可缓解| 草酸是干什么用的| joy什么意思| 扁平化管理是什么意思| hpv是什么原因引起的| 梦见不干净的东西代表什么| 喝什么美白| 前列腺吃什么食物调理| 金玉满堂是什么菜| 法国铁塔叫什么名字| 男性尿道痒吃什么药| 点痣后要注意什么| 纳豆什么味道| 本加一笔是什么字| 手指头红是什么原因| 缺铁性贫血吃什么食物好| 12月3号是什么星座| 立加羽读什么| 农业户口和非农业户口有什么区别| 八婆是什么意思| 08年属什么生肖| 外快是什么意思| 鸿运当头什么意思| 梦见背死人是什么意思| 雪菜是什么菜| 润滑油可以用什么代替| c2是什么| 阴道撕裂用什么药| 0和1是什么意思| 多囊卵巢有什么症状表现| mrr是什么意思| 路征和景甜什么关系| 什么是房颤| 蒙古族的那达慕大会是在什么时候| 怀孕吃火龙果对胎儿有什么好| 镇关西是什么意思| nuxe是什么牌子| 检出限是什么意思| 为什么会感染幽门螺旋杆菌| 艮宫代表什么| 七月初七是什么节日| 2000属什么生肖| 吸烟有害健康为什么国家还生产烟| 感觉心慌是什么原因| 寒包火感冒吃什么药| 无纺布是什么材料做的| 为什么会孕吐| 3月4日是什么星座| pgi是什么意思| 结婚前一天晚上的宴会叫什么| 忧心忡忡是什么意思| 人出汗多是什么原因| 二甲医院是什么意思| 一花一世界一叶一菩提什么意思| 高压低压是什么意思| dolphin是什么意思| 来姨妈不能吃什么水果| 终极是什么| 肋骨疼是什么原因| 菖蒲是什么| 梦见山体滑坡是什么意思| 去加一笔是什么字| 扒是什么意思| 天麻治什么病| 王八是什么| acl是什么意思| 健身吃什么长肌肉最快| 为什么放生泥鳅果报大| 变蛋是什么| 载体是什么| 呼吸胸口疼是什么原因| 宫颈纳囊什么意思| 用什么锅炒菜对人体健康更有益| 怀孕补铁吃什么| 贪是什么意思| 查幽门螺旋杆菌挂什么科| 拂尘是什么意思| 性有什么好处和坏处| 百叶是什么| 经常头痛吃什么药效果好| 金丝雀是什么意思| 婴儿为什么戴银不戴金| 埋头苦干是什么生肖| 双肾尿酸盐结晶是什么意思| 风麻疹是什么引起的| 浮躁的意思是什么| 12月1日是什么意思| 头大脸大适合什么发型| 血糖忽高忽低是什么原因| 苦海无涯回头是岸是什么意思| 嘿咻是什么意思| gop是什么| 福五行属什么| 什么他妈的叫他妈的惊喜| 钮祜禄氏是什么旗| 夜盲症是什么| 什么的嘴巴| 罗贯中和施耐庵是什么关系| 问候是什么意思| 病毒感染会有什么症状| 洗牙有什么好处和坏处| 尿频尿急尿不尽吃什么药效果最好| 医保定点医院是什么意思| 芨芨草长什么样图片| 百度
百度 1960年  4月,访问缅甸、印度、尼泊尔。

A "Hello, World!" program is usually a simple computer program that emits (or displays) to the screen (often the console) a message similar to "Hello, World!". A small piece of code in most general-purpose programming languages, this program is used to illustrate a language's basic syntax. Such a program is often the first written by a student of a new programming language,[1] but it can also be used as a sanity check to ensure that the computer software intended to compile or run source code is correctly installed, and that its operator understands how to use it.

History

edit
?
"Hello, World!" program handwritten in the C language and signed by Brian Kernighan (1978)

While several small test programs have existed since the development of programmable computers, the tradition of using the phrase "Hello, World!" as a test message was influenced by an example program in the 1978 book The C Programming Language,[2] with likely earlier use in BCPL. The example program from the book prints "hello, world", and was inherited from a 1974 Bell Laboratories internal memorandum by Brian Kernighan, Programming in C: A Tutorial:[3]

main( ) {
        printf("hello, world");
}

In the above example, the main( ) function defines where the program should start executing. The function body consists of a single statement, a call to the printf() function, which stands for "print formatted"; it outputs to the console whatever is passed to it as the parameter, in this case the string "hello, world".

The C-language version was preceded by Kernighan's own 1972 A Tutorial Introduction to the Language B,[4] where the first known version of the program is found in an example used to illustrate external variables:

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

The program above prints hello, world! on the terminal, including a newline character. The phrase is divided into multiple variables because in B a character constant is limited to four ASCII characters. The previous example in the tutorial printed hi! on the terminal, and the phrase hello, world! was introduced as a slightly longer greeting that required several character constants for its expression.

The Jargon File reports that "hello, world" instead originated in 1967 with the language BCPL.[5] Outside computing, use of the exact phrase began over a decade prior; it was the catchphrase of New York radio disc jockey William B. Williams beginning in the 1950s.[6]

Variations

edit
?
A "Hello, World!" program running on Sony's PlayStation Portable as a proof of concept

"Hello, World!" programs vary in complexity between different languages. In some languages, particularly scripting languages, the "Hello, World!" program can be written as one statement, while in others (more so many low-level languages) many more statements can be required. For example, in Python, to print the string Hello, World! followed by a newline, one only needs to write print("Hello, World!"). In contrast, the equivalent code in C++[7] requires the import of the C++ standard library, the declaration of an entry point (main function), and a call to print a line of text to the standard output stream.

?
Computer numerical control (CNC) machining test in poly(methyl methacrylate) (Perspex).

The phrase "Hello, World!" has seen various deviations in casing and punctuation, such as "hello world" which lacks the capitalization of the leading H and W, and the presence of the comma or exclamation mark. Some devices limit the format to specific variations, such as all-capitalized versions on systems that support only capital letters, while some esoteric programming languages may have to print a slightly modified string. Other human languages have been used as the output; for example, a tutorial for the Go language emitted both English and Chinese or Japanese characters, demonstrating the language's built-in Unicode support.[8] Another notable example is the Rust language, whose management system automatically inserts a "Hello, World" program when creating new projects.

?
A "Hello, World!" message being displayed through long-exposure light painting with a moving strip of light-emitting diodes (LEDs)

Some languages change the function of the "Hello, World!" program while maintaining the spirit of demonstrating a simple example. Functional programming languages, such as Lisp, ML, and Haskell, tend to substitute a factorial program for "Hello, World!", as functional programming emphasizes recursive techniques, whereas the original examples emphasize I/O, which violates the spirit of pure functional programming by producing side effects. Languages otherwise able to print "Hello, World!" (assembly language, C, VHDL) may also be used in embedded systems, where text output is either difficult (requiring added components or communication with another computer) or nonexistent. For devices such as microcontrollers, field-programmable gate arrays, and complex programmable logic devices (CPLDs), "Hello, World!" may thus be substituted with a blinking light-emitting diode (LED), which demonstrates timing and interaction between components.[9][10][11][12][13]

The Debian and Ubuntu Linux distributions provide the "Hello, World!" program through their software package manager systems, which can be invoked with the command hello. It serves as a sanity check and a simple example of installing a software package. For developers, it provides an example of creating a .deb package, either traditionally or using debhelper, and the version of hello used, GNU Hello, serves as an example of writing a GNU program.[14]

Variations of the "Hello, World!" program that produce a graphical output (as opposed to text output) have also been shown. Sun demonstrated a "Hello, World!" program in Java based on scalable vector graphics,[15] and the XL programming language features a spinning Earth "Hello, World!" using 3D computer graphics.[16] Mark Guzdial and Elliot Soloway have suggested that the "hello, world" test message may be outdated now that graphics and sound can be manipulated as easily as text.[17]

In computer graphics, rendering a triangle?– called "Hello Triangle"?– is sometimes used as an introductory example for graphics libraries.[18][19]

Time to Hello World

edit

"Time to hello world" (TTHW) is the time it takes to author a "Hello, World!" program in a given programming language. This is one measure of a programming language's ease of use. Since the program is meant as an introduction for people unfamiliar with the language, a more complex "Hello, World!" program may indicate that the programming language is less approachable.[20] For instance, the first publicly known "Hello, World!" program in Malbolge (which actually output "HEllO WORld") took two years to be announced, and it was produced not by a human but by a code generator written in Common Lisp (see §?Variations, above).

The concept has been extended beyond programming languages to APIs, as a measure of how simple it is for a new developer to get a basic example working; a shorter time indicates an easier API for developers to adopt.[21][22]

Wikipedia articles containing "Hello, World!" programs

edit

See also

edit

References

edit
  1. ^ Langbridge, James A. (3 December 2013). Professional Embedded ARM Development. John Wiley & Sons. ISBN?9781118887820.
  2. ^ Kernighan, Brian W.; Ritchie, Dennis M. (1978). The C Programming Language (1st?ed.). Englewood Cliffs, New Jersey: Prentice Hall. p.?6. ISBN?0-13-110163-3.
  3. ^ Kernighan, Brian (1974). "Programming in C: A Tutorial" (PDF). Bell Labs. Archived (PDF) from the original on 22 March 2022. Retrieved 9 January 2019.
  4. ^ Johnson, S. C.; Kernighan, B. W. The Programming Language B. Bell Labs. Archived from the original on 11 June 2015. Retrieved 8 August 2024.
  5. ^ "BCPL". Jargon File. Archived from the original on 3 April 2018. Retrieved 21 April 2013.
  6. ^ "William B. Williams, Radio Personality, Dies". The New York Times. 4 August 1986.
  7. ^ "C++ Programming/Examples/Hello world". Wikibooks. Archived from the original on 28 March 2022. Retrieved 16 March 2022.
  8. ^ A Tutorial for the Go Programming Language. Archived 26 July 2010 at the Wayback Machine The Go Programming Language. Retrieved 26 July 2011.
  9. ^ Silva, Mike (11 September 2013). "Introduction to Microcontrollers - Hello World". EmbeddedRelated.com. Archived from the original on 22 May 2015. Retrieved 19 May 2015.
  10. ^ George, Ligo (8 May 2013). "Blinking LED using Atmega32 Microcontroller and Atmel Studio". electroSome. Archived from the original on 5 November 2014. Retrieved 19 May 2015.
  11. ^ PT, Ranjeeth. "2. AVR Microcontrollers in Linux HOWTO". The Linux Documentation Project. Archived from the original on 2 May 2015. Retrieved 19 May 2015.
  12. ^ Andersson, Sven-?ke (2 April 2012). "3.2 The first Altera FPGA design". Raidió Teilifís éireann. Archived from the original on 21 May 2015. Retrieved 19 May 2015.
  13. ^ Fabio, Adam (6 April 2014). "CPLD Tutorial: Learn programmable logic the easy way". Hackaday. Archived from the original on 20 May 2015. Retrieved 19 May 2015.
  14. ^ "Hello". GNU Project. Free Software Foundation. Archived from the original on 29 May 2014. Retrieved 7 July 2017.
  15. ^ Jolif, Christophe (January 2003). "Bringing SVG Power to Java Applications". Sun Developer Network.
  16. ^ de Dinechin, Christophe (24 July 2010). "Hello world!". Grenouille Bouillie.
  17. ^ "Teaching the Nintendo Generation to Program" (PDF). bfoit.org. Archived from the original (PDF) on 5 May 2016. Retrieved 27 December 2015.
  18. ^ Vries, Joey de (2020). Learn OpenGL - Graphics Programming. Kendall & Welling. p.?26. ISBN?978-90-90-33256-7.
  19. ^ Beuken, Brian (January 2018). "Coding games on the Raspberry Pi in C/C++ Part 01". The MagPi. No.?65. p.?57. next time we will expand our code to start working with graphics and the famous 'hello triangle' code that absolutely no one uses except game coders
  20. ^ O'Dwyer, Arthur (September 2017). Mastering the C++17 STL: Make full use of the standard library components in C++17. Packt Publishing Ltd. p.?251. ISBN?978-1-78728-823-2. Retrieved 4 December 2019.
  21. ^ Wiegers, Harold (28 June 2018). "The importance of "Time to First Hello, World!" an efficient API program". Archived from the original on 19 February 2020. Retrieved 19 February 2020.
  22. ^ Jin, Brenda; Sahni, Saurabh; Shevat, Amir (29 August 2018). Designing Web APIs: Building APIs That Developers Love. O'Reilly Media. ISBN?9781492026877. Retrieved 19 February 2020.
edit
数字5代表什么意思 李子什么颜色 什么是黑户 吃什么能补蛋白 肚子大挂什么科
鸡和什么菜一起烧好吃 大便次数多是什么原因 血压表什么牌子的好最准确最耐用 pdn是什么意思 晚上睡觉腿酸难受是什么原因
燕京大学现在叫什么 怙恃是什么意思 低钾有什么症状和危害 恢复伤口吃什么好得快 湿疹怎么治用什么药膏
孕激素六项检查什么时候做 检查血液挂什么科 ab型血生的孩子是什么血型 etf是什么意思 时光静好是什么意思
为什么蚊子要吸血hcv7jop9ns7r.cn 素土是什么cj623037.com msa是什么bfb118.com 基本医疗保险包括什么hcv9jop5ns6r.cn 唯利是图是什么生肖hcv7jop7ns0r.cn
痛风是什么意思hcv7jop5ns4r.cn 蓝色衬衫配什么裤子hcv9jop6ns6r.cn 螨虫什么样子hcv9jop6ns2r.cn 怀孕头三个月吃什么好hcv8jop4ns8r.cn zn是什么元素hcv7jop4ns7r.cn
什么是过敏体质jingluanji.com 包粽子的叶子叫什么hcv9jop8ns0r.cn 152是什么意思hcv7jop4ns6r.cn 忻字五行属什么hcv8jop5ns3r.cn mmol是什么单位bjcbxg.com
健脾胃吃什么药hcv8jop5ns2r.cn 台湾什么时候收回hcv9jop1ns2r.cn 手脚心热是什么原因hcv9jop3ns2r.cn 叶酸是什么东西hcv9jop3ns4r.cn 吃什么容易滑胎流产hcv7jop4ns5r.cn
百度