Enterprise icon indicating copy to clipboard operation
Enterprise copied to clipboard

README.md confusing comments

Open drewcoo opened this issue 5 years ago ā€¢ 2 comments

Frist bug!

I'm having trouble with this: // adds one to counter counter++

Is that a prefix or postfix addition? I can't tell the order of operations on that line from the comment and it really should tell me.

drewcoo avatar Aug 27 '18 16:08 drewcoo

If you're asking about the ++, remember Enterprise is non deterministic language. You'll find if it adds and returns or returns and adds at runtime, without many guarantees. So our advice is to always do it before you'll use the variable.

In Enterpriseā„¢ Web3.0ā„¢, the implementation is mutate counter++;;;, and that's very sensible, so we may change the specs here.

Now, if you're asking about the comment, just do // the next line adds one to counter, or maybe we should have new comment types, like "next line comment", "this line comment", "previous line comment" and "this comment is for the next nth line[s]".

joaomilho avatar Aug 28 '18 00:08 joaomilho

Interesting. I didn't realize the language was non-deterministic. Are there outdated tests that fail to guarantee this contract? Perhaps I will fork this repository into a private location, add some of those tests, and never give you a pull request because open sores is all about the bizarre and not the catheterall.

drewcoo avatar Aug 28 '18 01:08 drewcoo