Are there any #ocaml developers out there who would enjoy reviewing my over-engineered hello world app? I'd love to get a code review from someone who has been living in this world for a while. github.com/pcrockett/hello-oca

Follow

@pcrock The whole project is well structured. Here are few things that I would do differently:
- In github.com/pcrockett/hello-oca I would make the arguments of the function explicit to make it more obvious that it takes an optional argument and a string argument: `let join ?(separator = "") str =`.
- The join function that you implemented is available as String.concat.
- Extra indentation after `let ... in` is weird to me (I know some people do that but it's not common). It doesn't really matter though and if you want to avoid debating such things with new project contributors, use ocamlformat.
- For best debuggability, don't catch exceptions without also capturing a stack trace and either printing it or storing it alongside the caught exception (github.com/pcrockett/hello-oca). Note that you need to call Printexc.record_backtrace to enable stack traces.

@mjambon Ohh, this is exactly the kind of feedback I'm looking for. Thank you so much!

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.