# My first zig library - looking for critics

**URL:** <https://ziggit.dev/t/my-first-zig-library-looking-for-critics/5067>\
**Category:** Showcase\
**Created:** [July 9, 2024, 8:56pm UTC](https://ziggit.dev/t/my-first-zig-library-looking-for-critics/5067 "2024-07-09T20:56:05Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![andrewrk](https://ziggit.dev/user_avatar/ziggit.dev/andrewrk/32/7011_2.png) [@andrewrk](https://ziggit.dev/u/andrewrk)\
**Post date:** [July 9, 2024, 9:35pm UTC](https://ziggit.dev/t/my-first-zig-library-looking-for-critics/5067/4 "2024-07-09T21:35:19Z")

</div>

2 things stand out to me:

You can rename cowsay.zig to Cowsay.zig and put the struct fields directly in the file, because _all Zig source files are structs_.

It is against conventions in Zig to allocate memory inside a module without accepting an `Allocator` parameter. It’s also generally unnecessary to perform heap allocation inside print functionality. A more ziggy implementation would figure out how to avoid heap allocation altogether in this functionality.

---

_[View the full topic](https://ziggit.dev/t/my-first-zig-library-looking-for-critics/5067)._
