Skip to content

Include Hello World Example - #24202

Closed
Kilo-Loco wants to merge 1 commit into
ziglang:masterfrom
Kilo-Loco:feat-readme-hello
Closed

Kilo-Loco wants to merge 1 commit into
ziglang:masterfrom
Kilo-Loco:feat-readme-hello

Conversation

@Kilo-Loco

@Kilo-Loco Kilo-Loco commented Jun 17, 2025 •

Copy link
Copy Markdown

Yea I know, a README PR....

Anyways, I think this is a really good addition to the README so people can actually see what the code looks like.

I did try to backup my argument by looking at other languages hosted on GitHub but all the ones I use don't show a code snippet of the language neither.

I literally went on YouTube to find a hello world example just to get up and running since this is my first day using Zig. (I'm biased to use video to learn because I have poor reading comprehension)

I do feel like this is a good example that includes an import statement, a function that includes access control, the fn keyword, returns an error, dot syntax, the try keyword, string interpolation, and printing. (This snippet was copied directly from the documentation)

I understand the urge to shoot down a PR to the README, but I would prefer to talk about this if the Zig team doesn't see a benefit from the DX perspective.

@ghost

ghost commented Jun 18, 2025

Copy link
Copy Markdown

I think the website (the link for that is right above your changes) already does a pretty good job at this. It shows you actual code of the language right on the front page without having to click anything.

@nektro

nektro commented Jun 18, 2025

Copy link
Copy Markdown
Contributor

as for how you're currently intended to find "hello world" is it is at the top of https://ziglang.org/documentation/master/
which is linked from both https://ziglang.org/download/ and https://ziglang.org/learn/
running zig init after downloading will also generate a hello world program for you
there is also an example program on the homepage https://ziglang.org as mentioned by wooster

if you don't mind sharing i'd be happy to hear more about what your first day was like and how you heard about Zig so we can more accurately assess where links to resources may be missing or should be more prominently placed

@andrewrk

Copy link
Copy Markdown
Member

No thanks.

@andrewrk andrewrk closed this Jun 18, 2025
@Kilo-Loco

Copy link
Copy Markdown
Author

as for how you're currently intended to find "hello world" is it is at the top of https://ziglang.org/documentation/master/ which is linked from both https://ziglang.org/download/ and https://ziglang.org/learn/ running zig init after downloading will also generate a hello world program for you there is also an example program on the homepage https://ziglang.org as mentioned by wooster

if you don't mind sharing i'd be happy to hear more about what your first day was like and how you heard about Zig so we can more accurately assess where links to resources may be missing or should be more prominently placed

Overall, I think there's way to many clicks before getting a simple hello world going. Landing on the home page where the first bit of code is a test is a first for me. Also, I think having a code snippet with any zig code in the README has more benefits than most of the sections which are verbose and have all the same information, if not more, in the docs. Meanwhile the zig logo is taking up significant real estate on the README.

The issue is closed and I expected as much, but I did want to give it a shot because it was something I ran into and think it provides a better DX.

In terms of the first day, I had a really good time but the abundant amount of start points was confusing for me. I tried Getting Started, but got confused when I tried direct download but it didn't work as expected. Then I started looking into downloading using chocolatey, then did something where I ended up on the build docs. I just gave up and looked for a YouTube video and that got me started.

I'm probably not the target audience for Zig since I haven't done systems programming before and intend to use Zig as a way to learn those concepts since I'm self taught and got straight into mobile development to start my career. I heard about Zig from The Primeagen. If you're interested in talking with a complete beginner to the language, I'm available to chat on most social media sites as @Kilo_Loco and in the "Zig Programming Language" discord with the same handle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants