6 ms·
Python Is Not Java
- alecco 18y agoAncient flamebait.
- vegai 18y agoSo is python java now?
- jacquesm 18y agoThank you captain obvious...
- jacquesm 18y agoFor those that like to join the downmod mob, I read the article and to expand a bit on my one line statement, anybody that will try to shoehorn language constructs from one language into another without first properly learning that language is going to be making these exact mistakes. It's patently obvious. Languages are different for a reason, and if you wish to do meaningful work in a language you would do well to familiarize yourself with the core constructs of a language before embarking on a major project, especially if you have a lot of expertise in some other language, because you may have to unlearn a few things.
- malkia 18y agoNow it's even
- samueladam 18y agoSince I've started using python, the language has had a big impact not only on my code style but also the way I handle problems and find solutions. The language really teaches you the Zen of python. $ python >>> import this
- perezd 18y agoGeorge Bush doesn't care about Python people.
- roberto 18y ago2004 is not 2009.
- RWilson 18y agoIdeally we should use the right tool for the job, but sometimes time constraints pressure us to try to use the tool we know best for any job, and the next thing you know we're using a wrench to twist a nail into the wall. We might get it in there, but it's ugly, crooked, and likely to fall apart with little weight, and all because we didn't have, or didn't want to take, the time to learn to use a hammer. To be fair, one equally shouldn't try to program in Java with python on the brain, it's going to turn out just as hideous and slow, and the developer will probably be more furious at the number of recompilations caused because approach the problem with the right mindset.
- Zak 18y agoI've been noticing the time machine effect the article mentions using Clojure. A couple weeks ago, I needed a GUI to update whenever an agent's value changed, and it turned out that watchers had been added to the language only a few days before. I think the effect is what PG was talking about when he discussed the difference between languages designed for the designer to use and languages designed for other people.
- pchivers 18y agoXML is not the answer. It is not even the question. I have a question for the Python hackers in the audience: what file format(s) do you use for configuration files? I've been using INI style files up until now, but I've been thinking of switching to XML for more complicated formats. For example, what about something like the following example. What format would you use to store this type of configuration data for a Python application? <?xml version="1.0" encoding="utf-8" ?> <directoriesToBackUp> <directoryInfo> <directoryName>/media/programming</directoryName> <excludedDirs> <dir>/media/programming/log_files</dir> <dir>/media/programming/temp_files</dir> </excludedDirs> </directoryInfo> <directoryInfo> <directoryName>/media/documents</directoryName> <excludedDirs> <dir>/media/documents/archive</dir> </excludedDirs> </directoryInfo> </directoriesToBackUp>
- dnaquin 18y agoconfig.py: backup = [{ 'name': '/media/programming', 'exclude': ['log_files', 'temp_files'], }, { 'name': '/media/documents', 'exclude': ['archive'], }] of the top of my head. *editted for formatting
- pchivers 18y agoYeah, I've done that as well. Are there any security considerations to think about if using that approach?
- dnaquin 18y agowell. it's mutable. your code can change it. don't do it (often). then you're just programming with lots of global state.
- deleted 18y ago[deleted]
- dnaquin 18y agojeff:disqus devin$ wc settings.py settings.xml 1 15 142 settings.py 16 19 461 settings.xml 17 34 603 total 30% of the words. and, in my opinion, just as readable if not more.
- critic 18y agoPINJ? That's a good name for a language. Googlable too, unlike Arc :-)
- dpifke 18y agoThis essay is referenced in the book Dreaming in Code by Scott Rosenberg. (As a relative newbie to Python who has in the past coded in a bunch of other languages - including Java - I had actually been meaning to look it up.)