5 ms·
This reminds me of something Rich Hickey said about becoming a better developer: https://gist.github.com/prakhar1989/1b0a2c9849b2e1e912fb https://gist.github.c
by mawaldne 7y ago
This reminds me of something Rich Hickey said about becoming a better developer:
https://gist.github.com/prakhar1989/1b0a2c9849b2e1e912fb https://gist.github.com/prakhar1989/1b0a2c9849b2e1e912fb
“A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness.”
- zinclozenge 7y agoYea this is 100% nonsense, and is borderline gatekeeping. Well roundedness allows me to identify a particular language/tech stack that is most suitable for a task and then I can just drill down on it and get productive very quickly.
- Skunkleton 7y agoAgreed. And to address the grandparent comment. Its entirely possible that he is approaching his coding with a professional mindset and wasting time on things like maintainability, scalability, or similar just out of habit.
- FakeComments 7y agoIt’s a waste of time to use classes, if all you’re doing is hacking together 500 lines into a stable enough heap to generate the graphs for a paper. Not all academic code is that bad, but the heft is definitely towards that end of the pool. I got really familiar with the distinction, because I spent a while translating PhD project/demo code into actual products for $JOB. It’s definitely mostly in making things secure, stable, maintainable, and debuggable that you lose most of the time.
- web007 7y agoThis a thousand times over. Academic code will take every shortcut and simplification possible. Hardcoded values, globals, no modularity, no error checking, shared-everything architecture assumptions, single-letter variables with mixed naming convention, anything to get the job done. Once the paper is written, the data analyzed, the project is done. There is no such thing as "maintainability" because the code isn't used past publication.
- shstalwart 7y agoIn mathematical code, single letter variables are often the clearest. "Descriptive" names only obfuscate the meaning further, because the meaning is in the math.
- OtterCoder 7y agoI've translated several mathematical papers into code, and I must strongly disagree. The very first thing I do is translate glyphs into names relevant to the domain I'm applying the math to. It makes the rest of the process immensely easier.
- shstalwart 7y agoI guess we'll have to agree to disagree then. I too have coded up a lot algorithms from academic papers. In my mind, yk = C * xk + D * uk is a lot clearer than position_at_time_k = output_matrix * state_at_time_k + feedthrough_matrix * input_at_time_k. The first is an idiom. The second is not.
- FakeComments 7y agoThat may make sense internal to a library, where you’ve established idioms. But as a counterpoint, I only know what you meant by the first expression because I read the second expression. I actually agree with you in large part, that short variable names can have more meaning within an established set of idioms because they allow you to parse whole statements at once. But there’s a trade-off involved, because mathematics can take symbology further than that’s useful. For example: E[i=0;5](i**2) sum([i**2 for i in range(0,5)]) So it often comes down to a matter of taste.
- jononor 7y agoWhy not something like this? position = C * state + D * input Reasoning: k is the only subscript, so it can be dropped. Meaning of C and D are implicitly defined through their function wrt to state and input, so its OK not to name them. It also keeps the structure visible similar to that of the math.
- h1d 7y agoAt this point I think it's the ecosystem that you pick and not exactly the language feature.