|
|
|
|
|
by jrmg
8 days ago
|
|
> I write functions with maybe a half dozen lines, then I piece them together. Sometimes my programs work, sometimes they don't, and I fix them. I think you might be under a misapprehension about how non-rank-amateurs code. Almost all coding is trial-and-error if we're honest. No-one, no matter how well they plan, writes towering pristine monoliths of code. The code might sometimes look like that after they're done, but that's only because so much time has been spent testing and 'polishing'. Most - maybe all - professional programmers I've worked with spend longer in the debugger or inserting and reading logs than they do in writing code. Sometimes it's possible to plan an architecture beforehand and implement it as-designed, but even that is usually a fool’s errand - the plan needs to change as the architecture meets reality and unforeseen complications arise. |
|
To the scientific programmer brain, that is just irrelevant, because the function will only ever be used with expected data. The type definition would be superfluous. Even if unexpected data were supplied, the pipeline would likely break anyhow with some other error.