Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value of simplicity #4

Closed
mansoor2016 opened this issue Dec 6, 2020 · 4 comments
Closed

Value of simplicity #4

mansoor2016 opened this issue Dec 6, 2020 · 4 comments

Comments

@mansoor2016
Copy link

I agree that the indirect handle approach has a subjective beauty to it.

There is also something to be said for code that can be understood with a cursory glance, and do not require explanations.

@DraTeots
Copy link

DraTeots commented Dec 7, 2020

If you have 4 lines of code that require a TED talk and a GitHub repository to explain them... It points to some generic flaw, smell or whatever you call that feeling of something which not that elegant.

P.S. And yes, the talk and the repo are not only an explanation but also a hymn to the "beauty" of those lines but you know what I meant.

@mkirchner
Copy link
Owner

mkirchner commented Dec 11, 2020

@mansoor2016 and @DraTeots, I agree that there is a difference between code that is just elegant and code that is suitable for production!

There is also something to be said for code that can be understood with a cursory glance, and do not require explanations.

For me, that's a function of my fluency and experience in a language. I am sure I would have grokked Linus' approach immediately if I were a better C programmer.

If you have 4 lines of code that require a TED talk and a GitHub repository to explain them... It points to some generic flaw, smell or whatever you call that feeling of something which not that elegant.

To be fair, the TED talk is not explaining the code, it uses the code to explain what Linus Torvalds considers good code. But yes, if your and your peers' C experience does not match the experience of the Linux kernel developer, you probably should not be using this in production! ;-)

@DraTeots
Copy link

DraTeots commented Dec 12, 2020

"But yes, if your and your peers' C experience does not match the experience of the Linux kernel developer, you probably should not be using this in production! ;-)" - you are so proud of them while one probably shouldn't be. It is like living in abusive environment and be proud of it (and many do, I know), proud of oneself about survival and endurance. While sane person would probably be happy not to live in such environment, try to avoid it and try to improve / build better environment for themselves if they live there for so many years.

@mkirchner
Copy link
Owner

@DraTeots, my apologies, this was a tounge-in-cheek comment. My point is that you need to adjust your code complexity to your environment and that that is a perfectly fine thing to do. No pride involved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants