`public static void main(String[] args)` 已死
Public static void main(String[] args) is dead

原始链接: https://mccue.dev/pages/9-16-25-psvm

伊森·麦克尤宣布传统的Java“Hello, World”程序——包含`public static void main(String[] args)`以及使用`Scanner`和`System.out.println`进行输入/输出——将于2025年9月16日正式过时。他用充满活力的语言热烈庆祝它的消亡,敦促读者通过任何创造性的方式表达他们的解脱和对这段代码的鄙视,从悼词到尖叫。 麦克尤强调了旧方法的繁琐性,并将其与使用`IO.readln()`和`IO.println()`的更简单替代方案进行对比。他还分享了一个幽默的轶事,讲述了高中时一位学长无法解释代码的一个组成部分,最终导致他成为一名Minecraft YouTuber。 这篇文章是对长期存在的编程惯例的一种轻松、宣泄式的拒绝。

## Java 的 `public static void main(String[] args)` – 一个正在变化的标志 一篇最近的文章在 Hacker News 上引发了关于 Java 传统 `public static void main(String[] args)` 方法作用演变的讨论。随着 Java 21 的 JEP 445 引入匿名类和实例 main 方法,开发者们正在质疑这个标志性的样板代码是否正在变得过时。 许多评论者反思了对这个方法的理解如何随着他们的 Java 水平提高而发展,最初显得深奥难懂,但在他们掌握类和对象等核心概念后变得合理。虽然有些人欢迎这种变化,但另一些人认为该方法本身并非“糟糕”,并且作为 Java 的一个可识别的标识符发挥了作用。 讨论还涉及 Java 随着岁月的推移而整体改进,将其与 Python 等语言进行有利比较,并强调最近的添加,如 lambda 函数,作为显著的可用性提升。人们对框架过度使用导致臃肿表示担忧,以及 Java 可能向更函数式范式转变的可能性。最终,这种变化被视为语法糖,简化了入口点,但并未从根本上改变 Java 的结构。
相关文章

原文
public static void main(String[] args) is dead

by: Ethan McCue

As of September 16th, year of our lord 2025, this is no longer the first Java program you need to write.

1. There is a comments section below. Give your eulogy for that piece of shit sorcerous incantation there or wherever else.

new Scanner(System.in) and System.out.println too. Don't let your sense of dignity hold you back.

Just record yourself giving a guttural scream and post it. Sing a song, do a dance, cast aspersions.

Honestly just let it all out.

1: When I was a Freshman in High School I asked a Junior what it meant. He had no clue.

That Junior later went on to drop out of college and become a Minecraft Youtuber. I vividly remember him making videos where he and his girlfriend pretend to be toddlers in a Minecraft day-care. What a life.


<- Index

联系我们 contact @ memedata.com