ترجمه فارسی توضیحات (ترجمه ماشینی)
پایتون 3 برای مبتدیان مطلق
پایتون 3 برای مبتدیان مطلق، تیم هال و جی پی استیسی، Apress (ISBN: 978-1-4302-1632-2)
سلب مسئولیت: از من خواسته شد که این کتاب را از طریق گروه کاربر لینوکس همپشایر بررسی کنم. من هیچ دستورالعملی برای نتیجه بازبینی دریافت نکردم یا هیچ هزینه ای برای بررسی دریافت نکردم (اگرچه توانستم کتاب را نگه دارم).
من معتقدم دانستن چیزی در مورد منتقد یک کتاب مهم است تا بتوان از اظهارات بیان شده به طور کامل قدردانی کرد. من یک توسعه دهنده نرم افزار هستم، بنابراین بیشتر روز خود را صرف خواندن و نوشتن کد می کنم. این روزها بیشتر پرل و جاوا هستند، اگرچه بعضی روزها تماماً C++ است. من قبلاً هرگز پایتون ننوشتهام، اگرچه حدود دو اسکریپت را بررسی کردهام (و حتی یکی را اصلاح کردهام)، اما احتمالاً منصفانه است که بگویم قبل از خواندن این کتاب کمتر از یک ساعت به کدهای پایتون نگاه کردهام.
این کتاب در واقع اشاره میکند که نمونههای کد منبع برای دانلود از […] در دسترس هستند، اما در اولین صفحه داخلی که در آن همه اطلاعات حق چاپ وجود دارد (و معمولاً به طور خودکار از آن عبور میکنید) ذکر شده است. اگر مثال ها را می خواهید، آنها در […]
این کتاب برای یک کتاب مبتدی نسبتاً خوب باز می شود و به نظر می رسد به شدت برای کسی است که قبلاً برنامه نویسی نکرده است (من شنیده ام که افراد زیادی پایتون را به عنوان یک زبان خوب برای آموزش برنامه نویسی به خود توصیه می کنند و می توانند دلیل آن را بفهمند). من از ارجاع اولیه به مونتی پایتون نیز خوشحال شدم، زیرا نام پایتون از اینجا آمده است.
استفاده از مفسر تعاملی پایتون عالی است و نمونههای عالی از بخشهای ساده زبان را میسازد، در عین حال آنقدر کوتاه است که واقعاً میخواهید آنها را در رایانهتان تایپ کرده و امتحان کنید! به ویژه استفاده نویسنده از مفسر پایتون برای چاپ جزئیات یک نوع داده یا متغیر، و حتی نتیجه مقایسه ها (مثلاً وارد کردن “1==2” در مفسر پایتون، بدون نیاز به استفاده واقعی از چاپ، “False” را برمی گرداند. بیانیه یا هر روش دیگر اشکال زدایی که به نظر من برای یک برنامه نویس جدید و یک ذخیره کننده زمان واقعی فوق العاده است)
شرم آور است که نویسنده نتوانسته است به اندازه کافی بر تفاوت های بین Python 2.x و 3.x تاکید کند. در حالی که برخی از کدها بر روی هر دو نسخه کار می کنند، تغییرات بسیار بزرگی وجود دارد و باید در اوایل بیشتر مشخص می شد که بعید است کد Python 2.x در Python 3.x کار کند و بالعکس، همانطور که از کاربران انتظار دارم. همچنین به دنبال نمونه هایی در وب باشید و اگر نمونه ها به دلیل تغییرات بین نسخه های پایتون کار نکنند، فقط گیج کننده خواهد بود.
در فصل دوم، برخی از اصول طراحی نرم افزار در کنار اولین برنامه واقعی، که البته «سلام دنیا» است، معرفی شده است. نویسنده زمان زیادی را صرف صحبت کردن در مورد اصول مهندسی نرم افزار و طراحی می کند، که همه اطلاعات ارزشمندی است، اما من شک دارم که بسیاری از خوانندگان واقعا وقت خود را صرف خواندن این مطلب کنند و در عوض از آن صرف نظر کنند. تقریباً همه چیز را از رویکردهای طراحی (داخل به بیرون در مقابل از بالا به پایین) تا کنترل کد، نسخهسازی، نظرات، مستندات و غیره پوشش میدهد، بنابراین مطمئناً سعی میکند همه پایهها را پوشش دهد.
سپس کتاب به توضیح متغیرها و انواع داده ها، عملگرها و اولویت ها، اعداد صحیح در مقابل شناورها و تمام اصول اساسی یک زبان می پردازد. من در ابتدا فکر می کردم که توضیحات مربوط به مقادیر اکتال و هگزادسیمال شاید برای کتابی با هدف “مبتدیان مطلق” کمی پیشرفته باشد، اما نویسنده به نکته خوبی اشاره کرد که این موارد اغلب در مجوزهای فایل و رنگ های html استفاده می شوند و این آنها را بسیار مفید می کند. دانستن.
مثالهای کتاب کوتاه و شیرین شروع میشوند، اما در مقطعی نویسنده به این فکر افتاد که به طور مداوم یک بازی RPG مبتنی بر متن را که برای کتاب اختراع کرده بود، دوباره کار کند. تنها مشکلی که در این مورد وجود دارد این است که در نهایت به چندین صفحه کد خیره می شوید و تنها کاری که می خواهید انجام دهید این است که از روی آن بگذرید و سپس شروع به نادیده گرفتن توضیحات این کد طولانی کنید. فکر میکنم نویسنده با استفاده از این قطعه کد بزرگتر، سعی میکرد چند تکنیک بازسازی خوب را در سراسر کتاب آموزش دهد، با این حال من احساس میکنم که درک مثالهای کوتاهتر و جداگانه آسانتر بود.
در یک نقطه برنامه های نمونه شروع به استفاده از ‘# می کنند! /usr/bin/env python’ به عنوان خط اول کد اما بدون هیچ توضیحی. نظر شخصی من این است که ‘#!/usr/bin/python’ رایج تر است، اما حتی این نیز مشکلات خود را دارد. از آنجایی که پایتون 3 هنوز بسیار جدید است، تقریباً همه سیستمهای لینوکس فعلی دارای پایتون 2.x بهعنوان /usr/bin/python هستند، بنابراین هر دوی این روشها سعی میکنند کد را با پایتون 2.x اجرا کنند نه با 3.x. بسیاری از نمونه فایلهای منبع وبسایت نیز یکسان هستند، و چون python3 را به عنوان مفسر از طریق خط hash-bang (#!) تعریف نمیکنند، اگر فقط سعی کنید آنها را اجرا کنید، اجرا نمیشوند، که این واقعی است. شرم برخی از کد منبع دانلود شده با ‘# بسیار نزدیک می شود! /usr/bin/env python3.0’، با این حال در اوبونتو کارمیک نسخه فعلی Python 3.x 3.1 است، بنابراین این کد همچنان اجرا نمی شود مگر اینکه صریحاً آن را با Python3.1 فراخوانی کنید یا خط را ویرایش کنید تا فقط “# داشته باشد. !/usr/bin/env python3’ که به 3.1 پیوند داده شده است، برخی از مثالهای کوتاه، بهویژه در مورد عبارات منظم، به متغیرهایی اشاره میکنند که آخرین بار چهار صفحه به خواننده نشان داده شدهاند یا قبلاً صفحاتی ارائه کردهاند. این کار را بسیار سخت میکند.
به غیر از مشکلات جزئی بالا در مورد کتاب، مقدمه بسیار کاملی برای برنامه نویسی و پایتون 3 است. اگر هرگز برنامه نویسی نکرده اید، پس این کتاب بسیار خوبی برای شروع است. اگر برنامهنویسی کردهاید، اما هرگز در پایتون برنامهنویسی نکردهاید، پس این کتاب هنوز هم بسیار خوب است، اگرچه متوجه خواهید شد که بخشهای h را رد میکنید.
Python 3 for Absolute Beginners, Tim Hall and J-P Stacey, Apress (ISBN: 978-1-4302-1632-2)
Disclaimer: I was asked to review this book through the Hampshire Linux User Group. I did not receive any instruction for the outcome of the review nor any payment for the review (though I did get to keep the book).
I believe it is important to know something about a reviewer of a book, so that the statements made can be fully appreciated. I am a Software Developer, so spend most of my day reading and writing code. These days it is mostly Perl and Java, though some days it is all C++. I have never written Python before, though I have poked at about two scripts (and even made a fix to one), but it is probably fair to say that I have spent less than an hour looking at Python code before reading this book.
The book does actually mention that the source code examples are available for download from […] however it is mentioned on the first inside page where all the copyright information is (and which you normally skip over automatically). If you want the exapmles, they are at […]
The book opens fairly well for a beginners book, and seems strongly aimed at someone who has never programmed before (I have heard lots of people recommending Python as a good language to teach yourself programming with and can understand why). I was pleased to an early reference to Monty Python as well, as this is where the name Python comes from.
The use of Python’s interactive interpreter is excellent and it makes for great examples of simple parts of the language, while also being so short that you actually want to type them into your computer and try them out! In particular the author’s use of Pythons interpreter to print out details of a data-type or variable, and even the outcome of comparisons (e.g. entering “1==2” into the Python interpreter returns “False” without having to actually use a print statement or any other debug methods which I think is fantastic for a new programmer and a real time saver)
It is a shame that the author fails to stress the differences between Python 2.x and 3.x strongly enough. While some code will work on both versions, there are very large changes and it should have been made more clear early on that Python 2.x code is unlikely to work in Python 3.x, and vice-versa, as I would expect users to also seek examples on the web and it will just be confusing if the examples don’t work because of changes between versions of Python.
By chapter two some software design principles have been introduced alongside the first actual program, which is of course “hello world”. The author spends a long time talking about Software Engineering and Design principles, which is all valuable information, but I doubt many readers will actually spend time reading this and will instead skip over it. It does cover pretty much everything from design approaches (inside-out vs top-down) all the way to code control, versioning, comments, documentation, etc so certainly tries to cover all the bases.
The book then moves on to explaining variables and datatypes, operators and precedence, integers vs floats and all the core basics of a language. I initially thought that explanations of Octal and Hexadecimal values were perhaps a little advanced for a book aimed at “Absolute Beginners”, but the author did make a good point that these are often used in file permissions and html colours and this makes them very useful to know.
The examples in the book start off short and sweet, but at some point the author had the idea to continually rework a text-based RPG game he invented for the book. The only problem with this is that you end up staring at several pages of code, and all you want to do then is skip over it, and then start skipping the explanations of this long code. I think the author was trying to teach some good refactoring techniques throughout the book by using this larger piece of code, however I feel that shorter, separate examples would have been easier to understand.
At one point the example programs start using ‘#! /usr/bin/env python’ as the first line of the code but without any explanation. My personal opinion is that ‘#!/usr/bin/python’ is more common however even that has its problems. As Python 3 is still very new, pretty much all current Linux systems will have Python 2.x installed as /usr/bin/python so both of these methods would attempt to run the code with Python 2.x and not 3.x. Many of the example source files from the website are also the same, and because they do not define python3 as the interpreter via the hash-bang (#!) line they will not run if you just try to execute them, which is a real shame. Some of the downloaded source code gets very close with ‘#! /usr/bin/env python3.0′, however on Ubuntu Karmic the current Python 3.x version is 3.1, so this code still fails to run unless you explicitely call it with Python3.1 or edit the line to just have “#!/usr/bin/env python3’ which is symlinked to 3.1 Some of the short examples, particularly around regular expressions, refer back to variables that were last shown to the reader four or give pages previously. This makes it very hard
Other than the above minor problems with the book, it makes a very thorough introduction to programming and Python 3. If you have never programmed, then this is a very good book to start with. If you have programmed, but never in Python then this book is still very good, though you will find yourself skipping sections here and there. If you already know Python 2.x then this book is probably not for you, as it only explains a few changes between version 2.x and 3, and you will probably know the rest already.
One thing to mention is that Python 3 is still very new, and in fact 2.6 is the default for the Ubuntu Lucid Lynx release as well as (at this stage) Debian Squeeze. I expect Python 3 is still a few good years from becoming the default – This is either a good thing as you have more time to learn version 3, or it can be seen as a bad thing as most existing code is based on 2.x and will need quite a bit of changing to work in version 3 (and vice-versa).
[ review originally posted at […]]
نقد و بررسیها
هیچ دیدگاهی برای این محصول نوشته نشده است.