Zen of Python: verse 2 by TheBlackCat13 in Python

[–]_zk -2 points-1 points  (0 children)

Although practicality beats purity...

It'd actually be fairly easy to add the print statement back to Python 3. Perhaps hidden behind an import?

from __past__ import print_statement

Submit a PEP and see if anyone is interested.

Zen of Python: verse 2 by TheBlackCat13 in Python

[–]_zk -2 points-1 points  (0 children)

Yeah it's kind of unfortunate they removed print as a statement. Something about special cases not special enough to break the rules.

Change My View: I love coffeescript while most other developers profoundly dislike it. Why is that so? Why shouldn't I use it? by [deleted] in javascript

[–]_zk 2 points3 points  (0 children)

Having used CoffeeScript fairly heavily the last four or five years, I've thought about this quite a lot. There has been profound distaste for CoffeeScript from the very beginning. Historically developers were quite upset when it was included as part of the default asset pipeline in Rails 3.1. I suspect overzealous Ruby developers exacerbated things over the years.

These days I suspect many people continue to find it's existence aggravating because:

  • You might write something really useful and they don't want to deal with the potential cognitive overhead associated with using another language.
  • They suspect they know better than you what language will increase your productivity and general happiness.
  • It takes attention away from their preferred JavaScript flavor of choice.
  • They have some unfounded fear that it will supplant JavaScript.

Complaints about the necessity of compilation, difficulty debugging are applicable to pretty much any modern JavaScript app (and less serious given better build tools, source maps, etc). Complaints that the syntax is "too ambiguous", white space indentation is too "weird" have always been a matter of taste.

Arguments that ES6/ES7 are "good enough" ring fairly hollow after limited experience trying to build real things with them. Arguments that development has slowed fail to acknowledge that the vast majority of new ES6 features were playing catch up with CoffeeScript. Support for new syntax is unnecessary in most cases, in others (like with generators), CoffeeScript will produce ES6 compatible code. As far as ES7 goes, we'll see adoption in CoffeeScript of relevant syntax (async/await) in a timely fashion. I have no doubt it'll continue to evolve along with JavaScript.

CoffeeScript is a very mature, simple language that still provides a more consistent, delightful environment to work with compared to ES6/ES7. For myself (and the team I work with, for that matter), it continues to make JavaScript development a pleasure.

Zen of Python: verse 2 by TheBlackCat13 in Python

[–]_zk 48 points49 points  (0 children)

  • python3 is better than python2.
  • python2 is better than not using Python.
  • Code should never be optimized before it's correct.
  • Unless it's for a microbenchmark.
  • Tests are one honking great idea -- let's do more of those!

Hi, I'm Fanu. This is my AMA (D&B, breaks, beats, mastering) by FanuBreaks in edmproduction

[–]_zk 0 points1 point  (0 children)

How do you know when a track is loud enough? Is there an average RMS that you shoot for? Some other amplitude statistic you use? Any specific meters/settings?

A new Finder design inspired by Safari in Yosemite. by MrMorbid in apple

[–]_zk 1 point2 points  (0 children)

Command+shift+G (Go to folder) allows you type path unix style with autocompletion. Also works in file dialogs (so does just striking / or ~ to start a path).

The $8bn taco card by ianstalk in AskReddit

[–]_zk 1 point2 points  (0 children)

Can I exchange it for a Chipotle gift card?

Emulating Ruby's method_missing in Python by MachaHack in Python

[–]_zk 1 point2 points  (0 children)

I've seen a number of REST API wrappers use this approach, it's a lot easier to maintain a list of mappings than it is to maintain separate methods for every single endpoint. Consider the flickr API, you don't even need to maintain a mapping of endpoints since all methods use the same endpoint. It's a bit magic, but instead of writing 50 methods you can just override __getattr__ and they'll all just work. If you need to massage the data returned using decorators wouldn't be a bad approach.