Hacker News new | past | comments | ask | show | jobs | submit login

Zig tutorials and learning materials and on-boarding experience needs a lot of work. Compare with something like Kotlin, so well designed is its introductory material that one could start doing useful things with Kotlin within a few hours.

Also I find Zig's choice to use abbreviated keywords rather cryptic, for example using 'fn' instead of 'function' only hurts readability I think.




Andrew Kelley said they'll only start writing the actual documentation once they hit 1.0 so they don't need to update it all the time. I personally find parts of the language unintuitive enough that I'll just wait.

I don't get the problem with `fn`, though. Pretty much every language uses abbreviations like that and I've never heard anyone complain about it: enum, char, int, uint, def, ...you get used to it quickly, you need to build a mental model for them either way.


There are a lot of people in this thread saying that I said stuff I didn't say. It's maddening.


I'm sorry if I misinterpreted or misremembered something you said, but this was my impression from an answer regarding the state of the stdlib docs, that there'll be more effort put into them after 1.0.

If that's not the case (or maybe plans changed?) I stand corrected. It's definitely not my intention to spread BS.


May be 'fn' was a wrong example to highlight, but my general impression was that there was a preponderance of such abbreviations in Zig, as someone who has spent some time in Java shops, where abbreviations are largely avoided in naming things.


as in `freshIdentifierAvoidAbbreviationLargelyWhenNamingThings()` ?


Zig isn't 1.0 so I assume more learning materials will come along once the language is actually finished.

I am not super familiar with zig, but I would say I am not a fan of using the entire word "function"

I believe "fn" is used in rust and I think its readable.

Maybe something like Go's "func" is better, but I really feel this is all arbitrary.


To my eye 'public function main' is a lot better than 'pub fn main'. It is also lot more clearer when you have to read out code phrases out loud.


Is there any language other than javascript that has the key word as the full "function"?

Again its personal preference, but I'm curious if there is a language you use often that makes you like that specifically?

Java is a bit like that, but has the C++ data types as its function key word basically. I'm trying to think if I am forgetting one.


Some examples would be Ada, Lua, Pascal (and derivatives like Delphi), XQuery.


Isn't 'fn' pretty widely used as function? I've seen 'fn' the most among fun|func|fn.


Perl has 'sub'.

Larry Wall, its designer, explicitely choose short words for common keywords.


"Larry Wall: Why Perl Is Like a Human Language"

https://www.youtube.com/watch?v=ju1IMxGSuNE


fn is consistent with Rust, I think it's fine.


Forgot to mention, Carbon uses fn.


Vlang uses fn too.


The ziglings tutorial is pretty good!

And if you go digging, I think you can still find solutions for last year’s advent of code.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: