frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Hosting a website on a disposable vape

https://bogdanthegeek.github.io/blog/projects/vapeserver/
905•BogdanTheGeek•13h ago•391 comments

Learn x86-64 assembly by writing a GUI from scratch

https://gaultier.github.io/blog/x11_x64.html
52•ibobev•3d ago•6 comments

William Gibson Reads Neuromancer (2004)

http://bearcave.com/bookrev/neuromancer/neuromancer_audio.html
206•exvi•9h ago•54 comments

React is winning by default and slowing innovation

https://www.lorenstew.art/blog/react-won-by-default/
419•dbushell•13h ago•437 comments

macOS Tahoe

https://www.apple.com/os/macos/
397•Wingy•13h ago•507 comments

Wanted to spy on my dog, ended up spying on TP-Link

https://kennedn.com/blog/posts/tapo/
395•kennedn•14h ago•128 comments

"Your" vs. "My" in user interfaces

https://adamsilver.io/blog/your-vs-my-in-user-interfaces/
30•Twixes•3h ago•7 comments

I feel Apple has lost its alignment with me and other long-time customers

https://morrick.me/archives/10137
244•mgrayson•6h ago•212 comments

Addendum to GPT-5 system card: GPT-5-Codex

https://openai.com/index/gpt-5-system-card-addendum-gpt-5-codex/
209•wertyk•12h ago•125 comments

Public static void main(String[] args) is dead

https://mccue.dev/pages/9-16-25-psvm
137•charles_irl•2h ago•120 comments

Show HN: Pyproc – Call Python from Go Without CGO or Microservices

https://github.com/YuminosukeSato/pyproc
12•acc_10000•2h ago•0 comments

PayPal to support Ethereum and Bitcoin

https://newsroom.paypal-corp.com/2025-09-15-PayPal-Ushers-in-a-New-Era-of-Peer-to-Peer-Payments,-...
411•DocFeind•16h ago•313 comments

GPT-5-Codex

https://openai.com/index/introducing-upgrades-to-codex/
272•meetpateltech•13h ago•86 comments

Linux phones are more important now than ever

https://feddit.org/post/18353777
355•wicket•6h ago•191 comments

How big a solar battery do I need to store all my home's electricity?

https://shkspr.mobi/blog/2025/09/how-big-a-solar-battery-do-i-need-to-store-all-my-homes-electric...
303•FromTheArchives•18h ago•398 comments

Why do we keep gravitating toward complexity?

https://kyrylo.org/software/2025/08/21/why-do-software-developers-love-complexity.html
72•PaulHoule•7h ago•95 comments

Launch HN: Trigger.dev (YC W23) – Open-source platform to build reliable AI apps

133•eallam•15h ago•55 comments

People Who Hunt Down Old TVs

https://www.bbc.com/future/article/20250911-the-people-who-hunt-down-old-tvs
60•tmendez•3d ago•30 comments

The Artistry of Avril Harrison – Scanline Artifacts

https://scanlineartifacts.co.uk/2024/09/30/the-artistry-of-avril-harrison/
14•rbanffy•2d ago•1 comments

Experimental browser MMO with bots, boss fights and power-ups

https://www.blobeer.com/
5•daniellax•3d ago•2 comments

I wish my web server were in the corner of my room (2022)

https://interconnected.org/home/2022/10/10/servers
63•jonassaid•3d ago•35 comments

Massive Attack turns concert into facial recognition surveillance experiment

https://www.gadgetreview.com/massive-attack-turns-concert-into-facial-recognition-surveillance-ex...
225•loteck•9h ago•99 comments

From unit tests to whole universe tests (with will wilson of antithesis) [video]

https://www.youtube.com/watch?v=_xJ4maWhSNU
23•zdw•2d ago•10 comments

CubeSats are fascinating learning tools for space

https://www.jeffgeerling.com/blog/2025/cubesats-are-fascinating-learning-tools-space
182•warrenm•16h ago•75 comments

How People Use ChatGPT [pdf]

https://cdn.openai.com/pdf/a253471f-8260-40c6-a2cc-aa93fe9f142e/economic-research-chatgpt-usage-p...
96•nycdatasci•11h ago•56 comments

Debian Upgrade Marathon: 3.1 Sarge

https://wrongthink.link/posts/debian-upgrade-marathon-sarge/
32•zdw•3d ago•4 comments

Removing newlines in FASTA file increases ZSTD compression ratio by 10x

https://log.bede.im/2025/09/12/zstandard-long-range-genomes.html
248•bede•3d ago•99 comments

How to self-host a web font from Google Fonts

https://blog.velocifyer.com/Posts/3,0,0,2025-8-13,+how+to+self+host+a+font+from+google+fonts.html
134•Velocifyer•16h ago•107 comments

When Your Father Is a Magician, What Do You Believe?

https://thereader.mitpress.mit.edu/when-your-father-is-a-magician-what-do-you-believe/
59•pseudolus•4d ago•12 comments

Boring work needs tension

https://iaziz786.com/blog/boring-work-needs-tension/
113•iaziz786•15h ago•60 comments
Open in hackernews

Public static void main(String[] args) is dead

https://mccue.dev/pages/9-16-25-psvm
136•charles_irl•2h ago

Comments

abhiyerra•1h ago
I learned to read line as the following in Java 1.2 so the Scanner class is new to me. :p

  BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
  String input = in.readLine();
riffraff•1h ago
Yep, same for me, it's been a long time since I did java and while the publicstaticvoidmain mantra felt familiar I was a bit confused by the Scanner thing and couldn't say why.
samlinnfer•1h ago
JEP 445: Unnamed Classes and Instance Main Methods

Released in Java 21

https://openjdk.org/jeps/445

rerdavies•1h ago
:-) So not even remotely dead.
adgjlsfhk1•1h ago
It's amazing that ~30 years on, Java is finally becoming a not horrible programming language.
bigstrat2003•1h ago
Java was never a horrible programming language. The hate is wildly overblown.
TZubiri•1h ago
Only bad experience I remember from Java was the int/Integer primitive/object issue and boxing.

Also of course the misuse and overuse of classes when designing systems, but the complexity at design time is also the counterpart of the ease of use of well designed APIs. I remember using an IDE to write some code and it skipped the whole documentation and run/compile error phase, I could just cast mismatching types as needed.

Probably C# and Swift/Objective C would only be above Java as top languages, being actually funded by paying customers instead of used by companies that depend on volunteer developed open source software and end-users that equate paying for software with evilness.

voidfunc•1h ago
Being forced to use anonymous classes to simulate lambdas prior to 8 was the biggest source of annoying boiler plate IMO and was genuinely a bad experience in sufficiently complex or large code bases.

Everything beyond 8 has been nice to have but 8 was the big one.

kelnos•45m ago
Agree, for the most part, but I think records and pattern matching are essential. I started using Scala (2.x) in 2014 or so, and case classes and pattern matching completely blew my mind. if/else trees and switch statements felt so archaic, limited, and verbose after that. I used to joke that Java would eventually adopt enough of Scala to be a pleasant language to work in, and I don't think I was that far off.

(I'll ignore Kotlin... I don't get why people like it.)

tetha•1h ago
> Only bad experience I remember from Java was the int/Integer primitive/object issue and boxing.

Heh, I once had to work in a code base that used an `Integer premiumDefenseLevel`. It contained the level of premium defense a player had purchased, or null if the player didn't have any levels of premium defense purchased in the recent times.

This was in fact annoying to remove, because a 0 after a 1 was treated differently than a null some time for advertisement reasons: Someone who had bought premium defense in the past is more likely to re-buy than someone who didn't, so they are pestered with ads. But it eventually turned into a neat little domain object.

nananana9•1h ago
> the int/Integer primitive/object issue and boxing.

That's a deal-breaker. If you can't tie together a few values in a record/struct without being forced to box them/heap allocate them, the language will never be used anywhere where you even remotely care about performance.

This is not a difficult problem to solve - C# did it in a very elegant way with structs, and as a direct result, probably for half of all videogames written today, the gameplay portion is written in C#.

huhlig•1h ago
Uhh. Most big data platforms are jdk based. Java handles scalable long running applications incredibly well for a fraction of the cognitive load.
adgjlsfhk1•1h ago
imo it's worse than that. of they'd just hid the boxing in the runtime, Java would be a kind of slow language that didn't feel awful. by exposing the unboxed primitives to the user, they created a horrible duality of incompatible types.
brabel•54m ago
You Guys haven’t used Java since the 90’s right? Boxed types convert to primitive values automatically, you never need an explicit cast! What horrible duality are you talking about?
brabel•56m ago
What are you criticizing exactly? You can have primitive integers in Java records or classes just fine. If you have many you can use an int[] like in C, no one forces you to use generic containers.
pjmlp•1h ago
In fact, it was welcomed in open arms even being originally interpreted, because writing portable C or C++ code in 1996 was still a mess, even across UNIX flavours.

On my university no one got Sun's marketing money in 1998, yet the distributed systems, compilers design, and graphics programming, all adopted Java as the language for new teaching materials, as it sorted out several problem with the assignments.

userbinator•1h ago
The culture of insane overengineering around it is the problem, not the language itself.
echohack5•1h ago
In 2012 managing the JVM was a nightmare. Java is fine now.
troupo•42m ago
It's not a terrible language, but it's not too good either.

For a very long time it completely stagnated and all the features we see added now should've been there 10 years ago, at least, and a bunch of other improvements on top. All because "our goal isn't to adopt the strategy of less successful products, but to forge our own" which now turned into busily adopting all the features that the "less successful products" have had for years: https://news.ycombinator.com/item?id=28985688

vincnetas•1h ago
Most likely you have not seen horrible languages or your bar for being not horrible is quite high.
mrkeen•1h ago
Or they've seen enough good languages to push Java down.
adgjlsfhk1•1h ago
this one. Java is far from the worst out there. I've used MuMPS and know of the horrors of TCL, but Java is once of those languages where everything takes 5x more more code than it should, and the result always feels ugly.

part of my dislike is probably that I'm a math person, and the lack of operator overloading really makes any math not using the built-in types dreadful to read.

voidfunc•1h ago
Meanwhile some languages like Python still suck 30 years later.
willvarfar•1h ago
I'm someone who wrote a lot of 'raw' Java and C++ without frameworks, which meant there was a lot less boilerplate and indirection etc. And for me, the big usability boon came about 10 years ago, around the same time for both Java and C++, when they started supporting lambda functions. I started passing code into algorithms and, although it sounds quite complicated, it simplified my programs substantially. Before that syntactic sugar gave the affordance I hadn't been organising my programs that way.

For the longest time Java had been very keen to be explicit, to the point of needing a log of cruft where it just felt like the compiler was checking you spelt every letter of the incantation correctly because both the compiler and you knew unambiguously what simple thing you were trying to achieve. But this tone changed in Java around the time the new entrants like Kotlin started taking over as what you develop in in a way that scala and clojure never managed. And suddenly all the get-out-of-your-way of lambdas saving you typing out classes and anonymous classes arrived and Java became a much nicer experience imo.

Nursie•1h ago
Now if we could just wean some more of the ecosystem away from the framework fetishism... there's no reason java programs have to be so huge, unwieldy and slow to start.

No reason apart from the framework epidemic that's supposed to make things easier for developers, but in the end hamstrings them and weighs everything down.

(to the downvoters - I am a java developer and this is very real to me at the moment!)

guidedlight•1h ago
Even so. It has amazing backwards compatibility and package management.
adgjlsfhk1•1h ago
I really hope you mean this as it has (amazing backwards compatibility) and (package management), because describing the package management in Java as anything more than "I guess it's better than C" feels overly generous
yohannesk•1h ago
Why not abstract away the public static void main(String[] args) method with a top-level statement paradigm, similar to C#'s entry point simplification, to reduce boilerplate and enhance code conciseness?
mhh__•1h ago
Why should the entry point be a random special case? You're already admitting at this point that OOP is flawed so you might as well just have the balls to design a proper alternative (rather than a kludge)
textlapse•1h ago
A special static class that cannot be instantiated is not OOP already.

C# does this well by letting you OOPfy your other code but doesn’t require you to use OOP for this monstrosity.

jayd16•1h ago
It always was and is a random special case.
fhd2•4m ago
This pattern isn't OOP, there is no objects here. And Java generally isn't a good example of an OO language to me. It's more like Class Oriented Programming. That is mighty flawed but was for some reason quite fashionable.

I wouldn't consider OO the way Ruby and other actually well designed languages do it flawed.

BinaryRage•1h ago
See Brian's article "Paving the on-ramp": https://openjdk.org/projects/amber/design-notes/on-ramp
furyofantares•1h ago
We got there just after we got the ability to legitimately create useful small programs without understanding any of the thousands of lines of code.
Panzerschrek•1h ago
So, Java now supports free functions (not associated with some class). Or not really yet?
vincnetas•1h ago
I think all functions are associated with some class. But these classes sometimes are hidden from you and you don't need to know about them. Does that help you? What for would you use true free functions?
throwaway47461•1h ago
> What for would you use true free functions?

The same things people use free functions for in any other programming language.

rerdavies•1h ago
Cluttering up global namespaces? ;-P
BinaryRage•1h ago
No, these are just default imports. Module import declarations are in for JDK 25 to make this kind of thing even easier: https://openjdk.org/jeps/511
TZubiri•1h ago
Presumably these exist in a Main.java file and the java class is implied. Similarly the string params are also implied, and the non param main() function is just an alias or a wrapper for main(String).

It's just syntactic sugar.

ninjin•1h ago
If so, are we observing a move towards Universal Suffrage in the Kingdom of the Nouns? [1]

[1]: https://steve-yegge.blogspot.com/2006/03/execution-in-kingdo...

naruhodo•1h ago
Nope. It's just sugar. [1]

It's somewhat implicit in the JVM spec, but functions are always bound to classes as methods. [2] The only kinds of heap objects you can have a reference to are class instances and arrays. [3]

The lack of free functions is really only a minor inconvenience for language implementers. Clojure, for instance, just compiles new classes to hold functions as methods.

From a programmer's perspective, you can write lambdas, but again, it's just syntactic sugar over an inner class.

[1] https://www.happycoders.eu/java/main-method/ [2] https://docs.oracle.com/javase/specs/jvms/se23/html/jvms-4.h... [3] https://docs.oracle.com/javase/specs/jvms/se23/html/jvms-2.h...

happymellon•1h ago
They are associated with a class, but the class is basically the file. There are limitations by doing it this way but it is out of preview and officially supported as of Java 25.

https://openjdk.org/jeps/512

another_twist•1h ago
This is not a prank right ? Is it really gone ?
bonzini•1h ago
It is, and it will be back soon just like Python's "if __name__ == '__main__'"...
garbagepatch•1h ago
It makes sense to still have a main function. It doesn't make sense to have a class only to wrap that main function.
nromiun•1h ago
What? When did that go away? What is the alternative?
throwmeaway222•1h ago
Might come back to Java
TZubiri•1h ago
Ugly? Sure. But isn't this the identity of Java? Taken away for almost no gain, there's literally no real issue stemming from requiring a verbose incantation to write a main routine, this is something you learn like day 1 on learning java, and it's something you write once in a blue moon, like 0.001% of the code you are going to write.

It reminds me of the attempt at removing Richard Stallman from the FSF, yeah, you could do that and fix a problem, but then what you are left with isn't really the same thing as it was before, it's now actually the same soulless thing as the rest of the competing things.

Saving grace is that obviously, you can still recite the incantation, it's not like public static void main(String[] args) is gone, just that you can skip it.

yallpendantools•1h ago
> this is something you learn like day 1 on learning java, and it's something you write once in a blue moon, like 0.001% of the code you are going to write.

I think this is the exact audience for this change: for newbies in day 1 of 10 years in their programming journey. Less boilerplate to just swallow, less time spent debugging an otherwise-fine lab exercise if not for the wrong instantiation of Scanner, more time actually focusing on the basics they should be focusing on.

Granted, I still think Java is a horrible first language to learn from or teach with but this is a step in the right direction. Might revisit this opinion in a few years, who knows.

Oh also, we use Java in production so we also have a bunch of ad-hoc "scripts" written in Java for mostly one-off interactions. Nonetheless, these scripts can get unwieldy fast. You'd think I'm exaggerating the benefit here but I, for one, welcome one less level of indentation in these scripts.

cynicalsecurity•1h ago
Why did it suck exactly?
hdjrudni•1h ago
That's what I wanted to know too, but all we get is this one line:

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

OK... so it's confusing for juniors. A lot of stuff is. I probably didn't know what it all meant when I started either, but so what? You copy and paste it and move on. Eventually it makes sense. Not a big deal.

_moof•1h ago
I don't understand how anyone ever didn't know what this meant. You have a class. It has a static method. The runtime starts your program by calling the method, passing it an array of command-line arguments. What's mysterious about this?
maxlybbert•1h ago
The first book I read on Java managed to explain "public static void main(String[] args)" by the end of the first chapter. It wasn't a long chapter, either.

I don't like Java, and the excessive boilerplate is a big part of that opinion. But it was never nearly as arcane as some people here are making it.

hmry•1h ago
The fact that you have to explain what classes are, and what static methods are, a huge load of information, for a hello world program. And what's worse, it will leave students rightly confused about what the point of the class is, if it only has static members... Making it more likely they don't retain any of the information. Or alternatively, just say "type it exactly like this, don't think about what the magic words mean" which is a great way to ruin programming for people
GaggiX•1h ago
Why there is a class in the first place
antonvs•1h ago
When you first learn programming, you don't know what a class is, or a method, let alone a static method.

But if you teach people using Java, you have to teach them to write this:

    public class Main {
      public static void main(String[] args) {
        System.out.println("Hello world");
      }
    }
...instead of just:

    print "Hello world"
The latter is easy for a student to understand. With the former, you just have to tell them to use it without understanding it, and that they'll understand it later.
olalonde•1h ago
Excessive boilerplate code.
riffraff•1h ago
The goal is go make java easier to learn for people new to programming.

When they start with the old style there is an overload of concepts where the teacher just have to say "ignore all this", which is not ideal. With new style they grasp fewer concepts at first.

I'm not truly convinced this is such a big deal, but I lived through my university switching from Pascal to Java in the first programming class, and I can confirm people did get much more confused during the first few classes (to be fair they got way less confused later not having to deal with pointers tho).

crystal_revenge•1h ago
One thing I'll miss about this was the way this arcane writing increasingly made sense over time as you became a better programmer.

I learned Java only after Python and I remember being not quite familiar with types so even the 'void' and 'String[]' where a bit mysterious. After learning basic types that part made sense. Then you start learning about Classes and objects, and you understood that main is a static method of this class Main that must be required somehow. As you dive deeper you start learning when this class is called. In a weird way what started as complete, unknowable boiler plate slowly evolved into something sensible as you began to understand the language better. I have no doubt that seasoned Java devs see a lot more in that invocation that I do.

Good riddance though!

panza•1h ago
Yeah, I agree with this sentiment. The boilerplate was oddly helpful when I was starting out.
boxed•20m ago
That's just Stockholm Syndrome. Think about it: what more crazy garbage could you add that is useless for the beginner but "will make sense later"?

The answer is: infinitely much. You could have to write each character in strings as separate characters for example. It would be absolute utter madness but it "would make sense later".

Joel_Mckay•1h ago
In general, Java made OO design trivial to implement, but due to a clear specification standard requirement a lot more planning/time is needed.

Thus, many sub-optimal project coordination approaches ended up fighting the design patterns. Java is a good student language, but there are so many better options now... with fewer footguns, and without Oracles farts. =3

vkazanov•47m ago
None of the Java and OOP problems were created ar Oracle.

As much as I love hating Oracle, they pushed the language forward much more than Sun ever did.

Joel_Mckay•21m ago
Interesting opinion, but that is only applicable for enterprise clients. The public gets a NERF'd legacy option full of known problems, limitations, and legal submarines.

The only reason Java is still somewhat relevant is ironically Android/Kotlin, and SAP/heinous-dual-stack-blobs product lines.

Best regards, =3

ludovicianul•16m ago
While Android/Kotlin keeps Java in the spotlight, Java also powers financial services, high--frequency trading systems, payment gateways, logistics platforms, and even modern microservice deployments. These are not all “legacy”,they’re mission-critical platforms handling billions of transactions daily.
znpy•46m ago
Java is essentially open source enough that you can ignore oracle. All the development of java happen in openjdk, of which oracle is a contributor (along with red hat and many others). Oracle’s java is just an openjdk distribution, with some additional proprietary bits.

Pulling the oracle card when java is mentioned is a useless stunt.

Joel_Mckay•19m ago
The OpenJDK has come along way, but is still less than ideal.

Do you actually use that option at enterprise scale? =3

fiddlerwoaroof•7m ago
Everywhere I’ve worked has used Eclipse Temurin or another open source release: the Oracle JVM isn’t used all that often because of license issues.
mfru•35m ago
So tell us what the better options are in your opinion?
Joel_Mckay•8m ago
A lot of folks prefer Scala or Kotlin even on a janky JVM.

Depends on the use-case, but I also like Elixir/Erlang, Julia, and Go.

Not all are very popular, yet each offer something uniquely beautiful. =3

rob74•34m ago
Yup... if you're familiar with the old class-based approach, the new style raises more questions than it answers. Did they really turn "everything-is-an-object"-Java into a procedural language? What do you do if you do need command line arguments? Etc.

(I somehow mostly avoided learning Java, and my last passing contact with it was 20+ years ago, so these are honest questions).

js2•22m ago
The class is still there, implicitly.

The main function can be written with `String[] args` if you need it.

This is a decent summary of the changes:

https://www.happycoders.eu/java/main-method/

Further details:

https://openjdk.org/jeps/512

bilekas•19m ago
If it's anything like dotnets change the void params are still a valid input.
raverbashing•23m ago
Except a static class method is just a hand-wavy way of denying reality: that a program has a single entry point that has nothing to do with classes

As much as C++ has a lot of problems, them and other languages (python/ruby/etc) never denied that the procedural world existed, while Java wants to blindfold you and push you through a corridor until you get out of it and into the "perfect (not) OOP world"

mayoff•12m ago
But in Java, a program doesn't have a single static entry point. You can have as many different classes as you want, each with its own static void main, and choose which to use as the entry point when you start up your JVM.
Peteragain•1h ago
What we seem to have forgotten is just how c like java was compared to other programming languages being advocated at the time. Objects made sense (remember Ada?) but c++ was a mess. Java was a breath of fresh air with lots of c legacy.
vkazanov•1h ago
Oh, I do remember the narrative: OOP is amazing but Cpp is not pure OOP let's make the OOPiest language possible.

I also remember casts all over the place in Java because polymorphism wasn't OOP enough.

And then lambdas and functions were not OOP enough to be first class values and that's why we needed numerous "verb-classes" everywhere.

And of course printf() is not OOP enough...

winrid•1h ago
Did it slow down compile times at all to support two different file structures?
_b0t•1h ago
Not understanding why having a well-defined function declaration "sucked", but alright, I guess!

I mean even this part:

``` var name = IO.readln("What is your name? "); IO.println("Hello, " + name); ```

is _worse_. `IO.readln` doesn't tell you whether that's file I/O or stdin/out. The more explicit the better, if you ask me.

DeathArrow•1h ago
C# has top level statements since 4 years ago. Not only you don't need a class, but you don't even need a Main() method.
DeathArrow•1h ago
What I would like to see deprecated is over using objects and design patterns and SOLID and Uncle Bob principles, so we see less FizzBuzz Enterprise Edition and Java feels less as the Kingdom of Nouns.
The_Fox•1h ago
I distinctly recall early in my first university programming courses the instructor saying something to the effect of "Just wait until you learn 'public static void main'". I think we had only used BlueJ until that point in the course.
giveita•1h ago
Looks like C# to me
kazinator•1h ago
If it is just syntactic sugar that has to create a class under the hood, it's just lipstick on a pig's turd.

If you can't have other top-level functions in Java, then it's a special case, which is ugly.

drewnoakes•35m ago
C# has had top level statements since version 9.0 (Nov 2020), and it's still just a compiler trick that produces a static method behind the scenes. Top level functions work too, but in a similar way.

Decompiled example: https://lab.razor.fyi/#41rAyMUVUJSfXpSYq5dcLDSRsbQ4My9dIbiyu...

> lipstick on a pig's turd

There are several valuable compiler transformations that happen under the hood in languages like this. Closures as types, iterator/generator functions, async state machines. This is just another example.

boxed•18m ago
> If you can't have other top-level functions in Java, then it's a special case, which is ugly.

I assumed this meant that you could have free functions, but you're saying you can ONLY have `main` as a free function? Ok, then I agree this is also garbage.

veltas•4m ago
I feel the same way about C/C++ having default return of 0 in main() only.
keithasaurus•1h ago
could java please also learn that stand-alone functions are cleaner than static methods? even if it's just syntax sugar...
rottc0dd•1h ago
From my previous comment in hn:

As a java guy and think python is weird, I don't think this sucks.

But, I also agree that can serve as terrible intro to programming if you start programming right away without understanding the basics of abstractions. But, often when we have tools either designed for a purpose in mind or a dominant paridigm or reaction to existing set of tooling, this can result in understandable yet extreme abstractions.

Java is designed with OOP in mind and it kind of makes sense to have the user to think in terms of lego blocks of interfaces. Every method or class needs to have clear understanding of its users.

public - software handle is for all users

protected - software handle for current and extending classes

default - software is exposed to current package

private - software is restricted to be used in current class alone and nowhere else

So, the beginning of java programming starts with interface exposed to the user or other programmers. Is it weird and extreme. Yes. At least, it is consistent.

veltas•28m ago
I agree, this is the whole point of "Hello world", which is to show the boilerplate required to start a program capable of outputting text, as well as the actual code that outputs that text. It's also the chance to get the build tools setup, people forget that some of the 'boilerplate' is the actions required to build, which often are much more involved for newer tools and frameworks.

You can just say initially e.g. when I learned C++ that "#include <iostream>" can be "mostly ignored for now, but just know iostream stands for Input / Output stream, and this line is necessary to e.g. output with std::cout"; and there are no scars left from this.

procaryote•5m ago
Some scars... as cout << was always a bad idea, and taught people early on in their C++ development that being overly clever with operator overloading was expected
beginnings•1h ago
but I need my public static void main arg arg arg
charcircuit•1h ago
It hasn't been for over 20 years with Java 5.

public static void main(String... args)

Frieren•1h ago
My experience may be different from the rest of people at HN. But I am used to work in large projects that last decades. How main is written is totally irrelevant for my day to day work or my career.

How does it affect you this change day to day?

ertian•52m ago
Many of us took programming 101 in Java and so typed this dozens of times without having a clue what it meant.
mrkeen•41m ago
Now we can type out the same semantics, and remain clueless about what it means, but with a new obfuscated syntax which stops us from asking about the semantics.
derefr•37m ago
Still for the better, because each token you don’t have to type when first learning programming is a token you can’t mistype.

(Though the ultimate conclusion of this line of thinking is that programming 101 courses should be taught in as concise and syntax-light a language as possible, giving the learner as few opportunities to screw up the input as possible. I’m a fan of teaching programming in Ruby, personally. Not theory of programming, mind you; just programming as an iterative human process.)

Frieren•20m ago
> programming 101 courses should be taught in as concise and syntax-light a language as possible

100% this. To make Java be the all-language makes it a mess without a defined goal. It is better to start learning with a language better suited for it. And then the learner can specialize and expand to other languages. This also helps to create awareness that different languages have different use cases.

tankenmate•33m ago
I learnt C at Uni (after having taught myself BASIC, Z80 machine code (not assembly), and x86 assembly), when we were taught C it was explained to us what all that sort of thing meant. But having said that most of the class failed to understand.
brap•52m ago
I think it’s been at least 5 years since I saw a main in the codebase.

Now that I think of it I rarely even write a truly new class from scratch, usually you just implement/extend some framework-specific thing.

kllrnohj•48m ago
Or if you're an Android developer then main doesn't exist at all and never has

But yeah I don't understand why the author is so excited about this. How "ugly" a trivial "Hello, World!" does not really matter much and isn't a good indication of anything about the language's ability to handle more than "Hello, World!"

bawolff•24m ago
I think it does say something about what a language thinks is important.

Java (historically) is famous for going a bit too hard core into overly abstract & verboseobject oriented design patterns - create a factory to get another factory to get a different factory and whatnot. The hello world is where java shows that style of code is what historical java felt was the ideal.

antris•19m ago
>How "ugly" a trivial "Hello, World!" does not really matter much and isn't a good indication of anything about the language's ability to handle more than "Hello, World!"

Sure, but for beginner programmers who don't have the discipline down yet, it's unnecessarily hard. I bought a Java programming book as a kid and got stuck because of a typo that produced an error message I couldn't understand. This was the time before StackOverflow and Reddit. In retrospect, this delayed my programming journey by at least a year.

Longer Hello Worlds make frustration and getting stuck like this more likely.

procaryote•11m ago
Java sometimes has a culture of "the proper way to do this is to take all these little pieces and put them together in a specific way" which probably makes sense for an object oriented purist but is a bit of a drag day to day.

The scanner class is one such thing, but you also have things like wrapping a Reader in a BufferedReader to add buffering, and building a Pattern object to build a Matcher object which has a few different methods you can call to actually do anything useful

It is very OO, but it's also a bit annoying, and more modern java libs tend to give you a more comfortable API. Sadly modern java also tends to come with springboot and people who can't do anything, unless they use springboot

flowerthoughts•45m ago
The unnamed class approach to global variables sounds nice. You can do hot-reload, but still have unencumbered syntax.

OTOH, since Java files are named after their public class, it would have made more sense to just say the `public class X { }` wrapper is optional and only needed for attributes and inheritance. I don't quite understand why they need an anonymous class.

> The Java compiler will compile that file to the launchable class file HelloWorld.class. In this case the compiler chooses HelloWorld for the class name as an implementation detail, but that name still cannot be used directly in Java source code.

https://openjdk.org/jeps/445

derefr•41m ago
What’s with Java devs and not including `import` lines in example code? Even here, when intending to demonstrate how dumb Java’s boilerplate is. But I notice it everywhere.
andrewflnr•38m ago
Among other things, I think a lot of Java IDEs automatically manage imports anyway.
derefr•31m ago
I mean, the IDE can totally write out the import statements for you as you type and choose resolutions for identifiers; but if you paste in a random code snippet that references ambiguous identifiers from a third-party lib, no IDE can magically generate the import statements required to discriminate the correct resolutions. You have to go through and resolve the symbols yourself (or advance through them as error sites to get the class to compile.)

Or, to put that another way: import statements aren’t pure boilerplate that should be thrown away; they encode real information (ambiguous symbol resolutions); and so, by eliding them from code examples, you’re discarding that information and forcing the learner to re-derive it.

Which is especially bad when your code examples are referencing ambiguous undocumented static inner classes nested deep inside your library’s package namespace, where all the potential resolutions differ only by the particular package they exist in (since they’re all e.g. essentially batteries-included extensions of the base library implementing the same interface.) And where all this structure is as ugly as it is precisely because you didn’t expect the end-user of the library to need to understand it / interact with it. Yet your own [usually “advanced” or “feature demonstrating”] code examples force exactly that.

TrianguloY•30m ago
Because usually you have an ide that manages imports for you automatically. So unless you are using a library that has multiple imports, usually you know the import to include, and in almost all cases it is automatically included.

Btw: in the compact example! The IO class is implicitly imported, so that example truly works without any import at all!

blobbers•35m ago
It looks more like C++ or C now. Never really became a java programmer. Hopefully never will have to.
fhd2•22m ago
Back in 2005 or so, Java felt like "C++, but we know better" to me. I had no choice but to use it, but boy did they omit some stuff that was actually useful. The boilerplate back then (driven by both the limitations of the language and a surge in architecture astronauts) was absolutely insane. Don't even get me started on anything labelled "Java Enterprise" in the 2000s, bloat, slowness and bugs everywhere. IBM, Oracle and friends were running quite the circus. Creating working, performant software in that environment was a brutal challenge. I think Java, the language, is only partly to blame, but it was limited enough to spawn pretty complex code generators and frameworks.

Took the industy a decade or two to arrive at typed languages that were an actually good subset of C++ features. Java, in my opinion, wasn't one.

macspoofing•33m ago
We're solving real problems now.
sylens•31m ago
Learning Java in high school, I loved how the very first lesson (focused on Hello World) had you type this out, only for the teacher to say “This will make sense later on but for now just type it in”.
raverbashing•28m ago
Funny how shaming and competition worked wonders for Java, instead of that bureaucratic mess that was first versions
zuInnp•22m ago
I don't get the hate ... yes, it is a lot of boilerplate, but at the same time it is very explicit and doesn't hide complexity.
boxed•19m ago
It ADDS complexity that doesn't actually exist. There's no "class" in the C entrypoint of a program. That's just nonsense.