Comment on The C programming language is like debating a philosopher and Python is like debating someone who ate an edible

<- View Parent
squaresinger@lemmy.world ⁨2⁩ ⁨days⁩ ago

This is another thing where hobby and professional development diverge.

For professional development, freedom just means unmaintainable code. For projects that run for a longer time you want everything to be as standardized as possible. People 10 years from now will need to understand your code, even if they live in a different country, went to a different university and haven’t seen any code from your organization before they join the project.

Cool and clever tricks will likely cause more trouble in the future than they will ever be worth right now. You write code once, but you will keep reading and re-working it over and over again.

I have been using it since before I was a teenager and I still don’t know how many of its features work because I’ve never had a use for them. Things like templates and stuff.

This is exactly the issue here. When you stumble upon code that uses an obscure feature like that, it’s a “wtf moment” and it will likely result in something being used wrong and something causing a bug. We don’t want that.

That’s why close to every professional project uses a linter, which blocks you from using problematic patterns and illegible code. If you use C with a linter, it will force you to format your code in a certain way as well.

If you just DIY your own small projects and discard them before they become old, code style doesn’t matter. But if you ever looked at the code of one of your old projects and it took you a while to understand what you did there, then that’s the result of bad code style.

source
Sort:hotnewtop