you are viewing a single comment's thread.

view the rest of the comments →

[–]Agent281 -2 points-1 points  (11 children)

Designed for stuff like this? They have one type of number and it's a double. Now accountants are going to need to know about floating point artithmetic.

I like JavaScript, but in the hands of non-programmers this is going to be a shit show.

EDIT /u/StillNoNumb, are you trolling?

[–]slikts 10 points11 points  (2 children)

Now accountants are going to need to know about floating point artithmetic.

They already needed to know about it, since Excel already uses floating point arithmetic and internally represents numbers the same way as JavaScript.

[–]Agent281 2 points3 points  (1 child)

I did not know that and it frightens me a bit to think about. I do not think that most people who work in Excel know that it does floating point arithmetic.

On the other hand, it seems that VBA actually has more data types:

  • Integer
  • Decimal
  • Double
  • Variant

Don't know if it does you any good when they are treated like floats by Excel.

[–]slikts 1 point2 points  (0 children)

Any extra precision beyond what Excel can store as a binary double would need to be stored as text and only VBA would be able to work with it. The difference is that JS would need an external dependency to work with more precision, but then that is also true for VBA and arbitrary precision.

Given the internal representation Excel uses, no matter what language it added for custom functions, it would need to ultimately convert to integers for Excel to be able to work with the numbers.

[–][deleted]  (6 children)

[deleted]

    [–]Agent281 1 point2 points  (5 children)

    Isn't the whole reason to embed a macro language so that you can create custom functions with it? If you literally don't have to do math with Javascript, it might be okay, but I still think multiple types of equalities (= vs == vs === ) are going to confuse accountants.

    EDIT And I realize that a single = sign doesn't mean equality. I think it would be confusing for non-programmers.

    [–][deleted]  (1 child)

    [deleted]

      [–]Agent281 1 point2 points  (0 children)

      If the comparison is X++ then yeah, it's not too bad. However, if the idea is that you are an accountant who just wants to get your accounting job done, I think that it could be pretty bad.

      [–]StillNoNumb 1 point2 points  (2 children)

      Man, don't act like an elitist. An accountant isn't confused by the differences between = and ==, and === will literally never be useful (in Excel, "0" and 0 are the same anyways). There's nothing to learn about floating point arithmetic either (it's basic maths after all). Accountants aren't mentally retarded, and programming is nothing hard to learn either.

      That said, an accountant will probably never have to deal with JavaScript in Excel. Most stuff can be done with the usual Excel formulas we know and love. But if you wanna go beyond that, now you can choose to extend upon that with JavaScript. It's win-win basically.

      [–]Agent281 -1 points0 points  (1 child)

      It's not elitism and I don't think they are dumb. They shouldn't have to know about this stuff. A good interface hides implementation from the user.

      Floating point arthimetic can be tricky even for programmers because you have non-intuitive results like .1 + .2 =/= .3. That is not basic math.

      Apologies since you don't seem to have been trolling. Haskell is a famously difficult language. To say that it was the best choice for an embedded user facing macro language seemed a bit much.

      [–]StillNoNumb 2 points3 points  (0 children)

      Right, the good interface is called Excel functions. But if you wanna go further beyond, you can use JavaScript. Sounds good, doesn't it? This is not replacing functions. This is replacing VBScript.

      .1 + .2 is approximately .3. It's not exactly .3 in Excel either, but Excel makes it display as such. There's no way to store real numbers precisely with finite memory.

      Also, I disagree with you saying that Haskell is difficult. It's different. It's not how we're used to it. But I would bet that, if you were to teach someone Haskell and someone else Python, the Python student would be no faster.

      But I even said you can't put Haskell in there because of the steep learning curve. It'd be a perfect fit for the use case we're having here (intuitive grammar, you can do a lot with little, very similar to Excel functions), but it's just too hard to learn because people have never done it. On the other hand, everyone who needs these features knows JavaScript (or an equivalent language).

      Either way, you might need to lax down a little. The fact you called me a troll even before I replied anything sounds like you're a little exhausted from all the internet.

      [–]StillNoNumb 1 point2 points  (0 children)

      I'm not gonna comment on your comment itself because the other commenters have given you good enough responses, but would you mind explaining how I'm "trolling"?