Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
Note: You can take 10% off all Slashdot Deals with coupon code "slashdot10off." ×

Submission + - Book review: Effective Python (59 specific ways to write better Python)

MassDosage writes: If you are familiar with the “Effective” style of books then you probably already know how this book is structured. If not here’s a quick primer: the book consists of a number of small sections each of which focus on a specific problem, issue or idea and these are discussed in a “here’s the best way to do X” manner. These sections are grouped into related chapters but can be read in pretty much any order and generally don’t depend on each other (and when they do this will be called out in the text). The idea is that you can read the book from cover to cover if you want but you can also just dip in and out and read only the sections that are of interest to you. This also means that you can use the book as a reference in future when you inevitably forget the details or want to double check something.

Effective Python stays true to this ethos and delivers 59 (not 60, nope, not 55) but 59 specific ways to write better Python. These are logically grouped into chapters covering broader conceptual topics like “Pythonic thinking”, general technical features like “Concurrency and parallelism” as well as nitty gritty language details like “Meta classes and attributes”. The range of topics is excellent and cover relevant aspects of the language that I’d imagine pretty much any developer will encounter at some point while developing Python programs. Even though there is no required order to reading the various sections if you want to read the book from cover to cover it’s organised in such a way that you can do this. It starts off with getting your head around coding in Python before moving on to specifics of the language and then ending with advice on collaboration and setting up and running Python programs in production environments.

I really enjoyed the author’s approach to each of the topics covered. He explains each item in a very thorough and considered manner with plenty of detail but manages to do this while still being clear and concise. Where relevant he describes multiple ways of achieving a goal while contrasting the pros and cons of various alternative solutions, ending off with what he considers the preferred approach. The reader can then make up their own mind based on the various options which applies best in a given situation instead of just being given one solution. The author clearly understand the internals of the Python language and the philosophy behind some of the design decisions that have resulted in certain features. This means that instead of just offering a solution he also gives you the context and reasoning behind things which I found made it a lot easier to understand. The discussions and reasoning feel balanced and informed by the experience of a developer who has been doing this “in the trenches” for years as opposed to someone in an ivory tower issuing dictats which sound good in theory but don’t actually work in the real world. The vast majority of the topics are illustrated through code samples which are built on and modified at each stage along the way to a final solution. This gives the reader something practical they can take away and use and experiment with and clearly shows how something is done. The code samples are easily comprehensible with just enough code to demonstrate a point but not so much that you get distracted by unnecessary additions.

While most of the topics are Python specific plenty of the best practices and advice apply equally well to other programming languages. For example in one section the author recommends resisting some of the brevity offered by the Python where this can lead to unreadable code that is hard to understand but the same could be said of writing code in many other languages (I’m looking at you, Perl). This also applies to a section related to choosing the best data structure for the problem at hand — if you end up nesting Maps within Maps in your code then you’re probably doing something wrong regardless of the language. Still, the main focus here is Python and the author does not shy away from going deep into technical details so you’ll definitely need some knowledge of the language and ideally some experience using it in order to get the most out of it.

Effective Python is not a book for complete newbies to Python and I think it’s suited more to intermediate users of the language wanting to take their skills to the next level or advanced programmers who might need some fresh takes on the way they do things. The subjects and opinions in this book could either convince you to do something differently or reassure you of the reasons why you’re already doing things a certain way (external affirmation that you’re right is also useful at times!) I’m no Python expert but I found the book drew me in and kept my attention and I certainly learnt a lot which will come in handy the next time I put on my Pythonista hat and do some Python coding. Highly recommended.

Full disclosure: I was given a copy of this book free of charge by the publisher for review purposes. They placed no restrictions on what I could say and left me to be as critical as I wanted so the above review is my own honest opinion.

Submission + - Arro taxi-app arrives in NYC as 'best hope' against Uber->

An anonymous reader writes: New York City cabs have begun testing a new app-based taxi system in an attempt to win back customers lost to Uber and Lyft. The new hailing app, named Arro, is currently in beta testing in around 7,000 of the city’s taxis. The system operates in a similar fashion to Uber but claims it will soon outplace the global giant, stripping surge pricing in favor of meter fares and teaming up with Creative Mobile Technologies (CMT) which already manages video displays and payment systems in around 10,000 NYC cabs.
Link to Original Source

Comment Re:From TFA: bit-exact or not? (Score 1) 172

There used to be a web page called "Your Eyes Suck at Blue". You might find it on the Wayback machine.

You can tell the luminance of each individual channel more precisely than you can perceive differences in mixed color. This is due to the difference between rod and cone cells. Your perception of the color gamut is, sorry, imprecise. I'm sure that you really can't discriminate 256 bits of blue in the presence of other, varying, colors.

Comment Re:From TFA: bit-exact or not? (Score 5, Insightful) 172

Rather than abuse every commenter who has not joined your specialty on Slashdot, please take the source and write about what you find.

Given that CPU and memory get less expensive over time, it is no surprise that algorithms work practically today that would not have when various standards groups started meeting. Ultimately, someone like you can state what the trade-offs are in clear English, and indeed whether they work at all, which is more productive than trading naah-naahs.

Comment Re:It'll devolve. (Score 4, Insightful) 85

Way 3: Make it an "event series"; a single series run with maybe a dozen episodes that serves as an extended sequel to the original with precisely how many episodes would depend on precisely how many parody scenes the writers can come up with before they start to repeat too much. I think they could probably get to a dozen or so quite easily if they draw on more series than just Trek: the BSG remake is ripe for parody, but you could also draw on Babylon 5, Doctor Who, Stargate, and several other series that hardcore SciFi fans would recognise the scene immediately yet still be obvious enough to be funny to those who haven't seen the show.

Submission + - Ask Slashdot: By age 5, What will Windows 10 know about my child?->

ddruck writes: The new Win10 commercials that feature toddlers and promise new and wonderful ways of interacting and using this OS has another side and this is: At what informational cost for the user?

So readers, what are some thoughts as to the what kind (& extent) of information harvesting does this OS enable/require for a toddler today as they "grow" (& embrace) this environment- as the commercials suggest we do? Thanks.

Link to Original Source

Submission + - More than half of psychological results can't be reproduced->

Bruce66423 writes: A new study trying to replicated results reported in allegedly high quality journals failed to do so in over 50% of cases. Those of us from a hard science background always had our doubts about this sort of stuff — it's interesting to see it demonstrated — or rather, as the man says: "Psychology has nothing to be proud of when it comes to replication,” Charles Gallistel, president of the Association for Psychological Science.
Link to Original Source

Happiness is a hard disk.

Working...