3 ms·
Perl and python have opposite philosophies with regards to standards. Python prefers a standard "pythonic" way, while perl had its "there is more than one way t
by dmarchand90 3y ago
Perl and python have opposite philosophies with regards to standards. Python prefers a standard "pythonic" way, while perl had its "there is more than one way to do it".
It would seem that having a standard is more popular.
- dylan604 3y agoYeah, there's the ongoing Perl joke about writing a script that works today, but not understanding how it works tomorrow. Too much one-liner type stuff that did not allow for maintainability
- SoftTalker 3y agoThat’s any code I haven’t looked at for a while, to be honest. I can’t count how many times I’ve looked at code I wrote or bug tickets I fixed and have absolutely no memory of doing it. It’s almost like the act of committing flushes the local storage in my brain.
- dylan604 3y agoPerl is different as people really tried to do this on purpose with maximizing the concept of one liners. Maybe it's a PTSD kind of an effect? "Any" code or good code doesn't try to be developed in a way that is difficult to parse by the next person. Perl developers definitely didn't adhere to the policy of writing code like the person maintaining it is a serial killer that picks people that write unmaintainable code and they know where you live.
- bigger_cheese 3y agoI run into this problem as well I'll often come across something I wrote a few years ago and struggle to remember why I wrote it that way. I've learned to add comments to my code - from what I see commenting code is frowned upon by a certain subset of developers but I've taught myself that whenever I am doing something subtle or unintuitive to add a short comment explaining what the code is doing, for every potentially unnecessary comment I've added I've also saved myself time when I've had to come back to something months or years later and been able to refer back to the comment.
- arcanemachiner 3y ago> from what I see commenting code is frowned upon by a certain subset of developers I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a... belief.
- bigger_cheese 3y agoThe main argument seems to be comments should left with the commit message and not "inline" i.e mixed with the code. Personally I make heavy use of inline style comments.
- citizenpaul 3y agoI've worked in tech my whole life and never heard a dev make these comments are bad claims. I only work in the boring world though. Is this a startup or FAANG or silicon valley thing?
- dmarchand90 3y agoIn clean code there is a chapter about eliminating useless comments. I think this has some merits. Think of the following made up example: sum = sum_two_numbers(number1, number2) Probably doesn't need a comment. The other argument is that comments need to be maintained and are subject to decay. E.g. the code they are commenting on changes. The book goes into other examples but i think the idea isn't to eliminate comments but to be thoughtful and judicious in which you use
- deleted 3y ago[deleted]
- lelanthran 3y ago> Perl and python have opposite philosophies with regards to standards. Python prefers a standard "pythonic" way, while perl had its "there is more than one way to do it". It wasn't just "having a standard" that mattered; in Perl it was actively encouraged to find a different way of doing something. "There is more than one way to do it" was often taken by the Perl programmer as a challenge to find all the other ways, and then use them all in different parts of the same program.