Already by allowing operator overloading and Unicode variable names, Swift is able to provide fairly decent mathematical support. However,pow(x,y) // doesn't really hack it.Someone who does not have experience coding math-centric code will probably wonder what the fuss is about. Imagine having to do:add(x,y) // ... especially on a long and involved equation.And consider that in the realm of signals processing, raising a complex number to some power is as common as adding two integers.One solution I would like to see considered would be allowing Unicode operators. (A carefully chosen subset of Unicode). This would allow succinct set theoretic notation for a start.I don't think we should constrain ourselves to what is underneath our obsolete QWERTY keyboards. Digging out a Unicode character would only take a few seconds, and produce beautiful code. Given the hours I spend staring at ugly code, I would be very happy to invest.Have a look at https://www.youtube.com/watch?v=a9xAKttWgP4 -- APL have gone do
Topic:
Programming Languages
SubTopic:
Swift
Tags: