3 ms·
I think flexibility becomes a double edged sword over time: when you need to read, understand and modify some code with overloaded operators it can take longer
by marmaduke 7y ago
I think flexibility becomes a double edged sword over time: when you need to read, understand and modify some code with overloaded operators it can take longer to figure out what's happening.
- srean 7y ago> I think flexibility becomes a double edged sword over time Agreed in general. For the specific case of number crunching though, sooner or later you would like to call out to a Fortran library. That and with DNNs being so popular now, flexibility over how 'tensors' are laid out in memory by an upstream library or how it has to be laid out to call another library is quite crucial. > when you need to read, understand and modify some code with overloaded operators it can take longer to figure out what's happening. If overloading has been a resounding success anywhere that would be in scientific computing. Unless someone goes overboard it really helps rather than hinders understanding by matching traditional mathematical notation.
- marmaduke 7y agoI had non arithmetic syntax in mind when making this comment, such as indexing. Those can be simple as in get the i'th element or get elements corresponding to a mask etc. This makes it easy to write, less easy to know what's actually happening later.