6 ms·
That function sure is ugly, but in general they have done a great job in making their own APIs more easy on the eyes. And even that monstrosity doesn't look th
by aparadja 9y ago
That function sure is ugly, but in general they have done a great job in making their own APIs more easy on the eyes.
And even that monstrosity doesn't look that bad in actual use:
let filter = BNNSFilterCreateConvolutionLayer(&inDesc, &outDesc, &layerParams, &filterParams)
The worst offenders for readability are these C-ish functions that deal with unsafe pointers. But at least in Swift, I appreciate the safety brought by the type checking. It's quite nice that unsafe code is clearly marked.
- pjmlp 9y ago> The worst offenders for readability are these C-ish functions that deal with unsafe pointers. That is exactly the point, to make it pretty clear that the code needs to be scrutinized very carefully for its safety.