Writing idiomatic python pdf1/4/2023 ![]() Idioms in a programming language are a sort of lingua franca to let future readers know exactly what we’re trying to accomplish. So what do we do? Resign ourselves to maintaining code we can’t understand? Rant on Twitter and The Daily WTF about the awful code we have to work on? What must we do to stop the pain? Write. Badly written Python code is just as unmaintainable as badly written C++, Perl, Java and all the rest of the languages known for their, ahem, readability. Alas, maintainability is not an emergent property of using an expressive language. When Python became popular, many thought that, because of its terseness, it would naturally lead to more maintainable software. ![]() Everyone (besides you, of course, dear reader) struggles to write code that’s easy to maintain. Maybe it’s because I’ve spent my professional career writing software at huge companies, but I have yet to inherit code that didn’t eventually cause me to curse the original author at some point. ![]() While I’m not usually one for aphorisms, this one strikes a chord with me. Jeff Knupp Visit me at Preface There’s a famous old quote about writing maintainable software: Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. No part of this book may be reproduced in any form or by any electronic or mechanical means without permission in writing from the author. Covers Python 2.7 and 3.3.Copyright 2013 by Jeff Knupp All rights reserved. Learning Python – 5th EditionĬomprehensive doorstop (1600 pages) great for programmers new to Python and (Object Orientation). A concise but comprehensive start that will appeal to independent study types. Dive Into Python 3ĭives straight into code then the explanations follow. Get pythonic from the start: concise guide to idiomatic code best after another text, but suits some brave learners. Very popular: available in several languages on the website. Program Arcade Games: With Python and Pygameīalances games and programming exercises to keep the learner going. Works well, but Shaw doesn’t cover Python 3. ![]() ![]() The “hard way” is typing it all in until you absorb the syntax and spot mistakes. Learn Python the Hard Way (Third Edition) Author: Zed Shaw Publisher: Addison Wesley Price: £24.99 (free online) ISBN: 978-0321884916 ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |