6 ms·
I always get frustrated when I see Python code written by Java programmers. It's full of unnecessary classes and complicated abstractions, and doesn't make use
by kennu 5y ago
I always get frustrated when I see Python code written by Java programmers. It's full of unnecessary classes and complicated abstractions, and doesn't make use of Pythonic features that might keep the overall design much more simple. Good programmers know the philosophy of how each language is supposed to be used.
- Spivak 5y agoWhich in basically every language means “imitate the standard library” or “imitate the framework you’re running.” Your code is gonna be full of standard library and framework code, your code might as well blend in and be roughly intuitive to people who already know them.
- kennu 5y agoKind of yes, but I wouldn't say so about all of the Python's standard libraries. Some of the old 2.x ones were pretty weird. Same thing with e.g. PHP, standard library was quite a mess of different styles and philosophies.
- emodendroket 5y agoOh, I'd say that matches most PHP projects pretty well.
- throwaway2077 5y agoI feel your pain, brother. with the encroachment of frameworks and TS into the frontend, things that could be done with 50 lines of straightforward code become 10 files with a build step.
- krater23 5y agoI know exactly what you mean, but I hate this on programs in Java and C++ too.
- the_arun 5y agoI wonder - is programming language agnostic? Suppose if I learn a particular language - L1, my programming style & thinking is biased by the convenience of the language L1. Now, if I start programming in language L2, obviously for next few months (or years) - I continue to think in L1 & program in L2. It takes time to unlearn L1 & learn L2. Because we are humans. Do we have a bug in our expectations?
- kennu 5y agoIn my opinion it's like human languages. You can never apply the idioms and structures in quite the same way. But you can still be fluent in several languages without unlearning previous languages first.
- lmm 5y agoMost people and employers (other than the handful of places using e.g. APL) aren't willing to spend months learning a new way of doing things before they can do anything (and I dare say that's a reasonable position in most respects). So people demand - and the market provides - languages where you can at least write the basic lowest-common-denominator stuff the same way as in Algol '52. The amount of time it takes to learn to write idiomatic L2 might be the same as the amount of time it takes to learn to write idiomatic APL, but people would rather write L1-in-L2 than not be able to write anything.
- shagie 5y agoHow do we tell truths that might hurt? - Edsger W.Dijkstra, 18 June 1975 https://www.cs.virginia.edu/~evans/cs655/readings/ewd498.html https://www.cs.virginia.edu/~evans/cs655/readings/ewd498.htm... > It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. > The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. --- Long ago, I learned C in college. My AI class was taught in LISP and I had one of the emacs hackers in the lab look over my assignment before I handed it in - "You've written some beautiful C in LISP." It took me many years to get back to a LISP (Clojure in this case) before I wrapped my head around functional programming and the idea of passing functions around to operate on data rather than data around that has been operated on (I recently blew the mind of one of my coworkers who's only written Java when I had a Map<String, Function>). It takes a bit to go from "how do I do X in {language}?" and think of that as a series of steps in Java or Python or whatever to thinking "how do I solve the problem of Y in {language}?" without being constrained by the language. I've personally found that writing the same program in multiple languages is the best way to learn how to move out of "how do I do X in {language}?" Write the Leibniz formula for π or e in Java, in Python, in Clojure (or Lisp), and in Forth. Don't try to write it the same way - use the expressiveness (or lack of) of the language to solve the problem. Does it have rational numbers? How are sequences defined and built? How does it handle recursion if you use that? --- Epigrams on Programming - Alan Perlis, September 1982 http://pu.inf.uni-tuebingen.de/users/klaeren/epigrams.html http://pu.inf.uni-tuebingen.de/users/klaeren/epigrams.html > #19 A language that doesn't affect the way you think about programming, is not worth knowing.
- emodendroket 5y agoOn the other hand, one is often called upon to work with many technologies to accomplish small tasks, making it impractical to become an expert in each one.
- LAC-Tech 5y agoIn a similar vain I feel like frontend got completely taken over by backend programmers. Modern react apps feel so much like enterprise C# or java it's uncanny - complicated tooling, long build times, overengineered libraries. They've made themselves completely at home and managed to all but obscure the actual underlying tech.
- vagrantJin 5y agoyou know, I've have had the exact same idea floating around my head for a while - why is everyone talking about react when JS isnt even a thing at majority of CS programmes. It's great that JS is everywhere but frontend has become a grey, amorphous blob that no one really knows. And modern JS web frameworks really do feel like a OOP framework - as if some companies had an excess of backend C#/Java/PHP devs and decided they should infact do frontend. When they got there, there were no types, no classes, everything is an object and the realization that frontend tooling is simple but crazy difficult to get good at. But to be fair, there is some pushback to the complexity - libs like Alpinejs and Svelte are a joy to work with because they try to keep it as simple and magicless as possible. So there is hope. At least until I see someone build a landing page with npx create-reac-app
- midrus 5y agoWait until you see JavaScript written by Java programmers. It had "Java" in the name.... right??? right!!??
- BoxOfRain 5y agoI've recently moved to Python from a Java and Kotlin background. Is there any resource in particular you'd recommend for quickly getting over "Javaisms" for people in this situation? I'm keen to write Python as idiomatically as possible but it's often hard to escape your background.
- greggyb 5y agoThese are a few videos which present Pythonic style. They do not form a proper curriculum, but they are example-heavy and give a good insight to a very Pythonic mind. 1. Beyond PEP 8 https://www.youtube.com/watch?v=wf-BqAjZb8M https://www.youtube.com/watch?v=wf-BqAjZb8M 2. Transforming Code into Beautiful, Idiomatic Python https://www.youtube.com/watch?v=OSGv2VnC0go https://www.youtube.com/watch?v=OSGv2VnC0go
- lloydatkinson 5y agoAs a .NET dev I feel 100% the same in regards to JS and TS. I'm proficient with all three but I have seen so so so many C# devs writing javascript/typescript with classes "bEcaUsE iT haS cLasSes tOO".