Hacker News new | ask | show | jobs
by vintagedave 1 day ago
If you like that idea, you'd love Oxygene! It's part of the type system.

As far as docs go, would you like to critique ours? https://elements.docs.remobjects.com/Oxygene/Types/Units/ Both I and the person who wrote those docs care about human-written, informative documentation.

1 comments

Holy cow... that is fscking amazing! I'm sorry, but I was distracted by the amazing power of that type mechanism. I can't imagine what kind of very cleaver, or better yet, very elegant mechanism is underlying that type system.

As for the Documentation itself.... you've all done an amazing job.... just browsing through https://elements.docs.remobjects.com/Concepts/Nullability/ it dawned on me that the same documentation represents the concept across multiple programming languages in a very clear and easy way.

I was trying to figure out what happens when a null gets encountered at run time, and couldn't find it in the documentation.... then it dawned on me that the whole point of this might be to prevent that from even happening, ever.... is that right?

You've definitely Nerd Sniped me with Oxygene. 8)

---

Ok, now back to the original objection I had to the Lazarus/Free Pascal documentation.... unfortunately it's present in Oxygene as well. Take a look at the ButtonClick() methon on the page for TButton, https://elements.docs.remobjects.com/API/DelphiRTL/Classes/T...

The parameter aEvent: is listed, but there's no telling what it actually means or does, or how to use it. I know that if I used this daily it would likely be sufficient, but for me coming fresh into it, it's a brick wall. I just want to put a button on the screen.

Maybe it's just me? but this is the type of thing that seems everyone counts as sufficient. I get that there are an insane amount of parameters and fields to document, but there must be at least a hint of how to use things, and what exactly they mean.

Another example would the the "TabStop" property in TCheckBox, there's no telling what that actually does. I have a guess, but there's no description of what it does, how to use it, etc.

----

PS: One minor note (very minor) is this typo in the text on the Units page you referenced:

  The relationships work both ways, i.e. Speed multiplied by a Time wdl ahain yield a Distance.
PPS: I'm sorry if I'm too demanding, but I was trying to be specific about things, to give you details.
Not demanding at all. This is fantastic. I will pass it on to the person who wrote the docs, I think he'll be really happy with your feedback. "fscking amazing" is a real compliment.

And yes, that doc is lacking... That library is actually deprecated, which may be why. These days we support the Delphi object model / ABI, so we can link directly to Delphi packages the same way we speak the Obj-C or other ABIs. So that library is not necessary. Perhaps we should remove the doc altogether.

Edit: and to answer your question, if something is nullable, it can be null validly and so you could deref and get an AV, but you can also use the colon : operator for safe access, or `coalesce`.

https://elements.docs.remobjects.com/Oxygene/Expressions/Mem...

https://elements.docs.remobjects.com/API/SystemFunctions/Coa...

If it's `not nullable` it cannot be null, ever, enforced as part of the type system.

> "fscking amazing" is a real compliment.

love it, yeah.

typo: fixed. Also, point taken about the sometimes empty API docs. We gotta see what we can do there to improve this.