Every Python programmer had to learn the language at one time, and started out as a beginner. Beginners make mistakes. This article highlights a few common mistakes, including some I made myself.Beginner's mistakes are not Python's fault, nor the beginner's. They're merely a result of misunderstanding the language. However, there is a difference between misunderstanding (often subtle) language features, vs misunderstanding the language as a whole, and what can (and cannot) be done with it. The pitfalls article focused on the former; this article deals with the latter. To put it another way, the mistakes in this article are often cases of "the wrong tool for the job", rather than coding errors or sneaky language traps.Mistake 1: trying to do low-level operations Python is sometimes described as a VHLL, a Very High-Level Language. As such, it is naturally suited for high-level tasks, like generating or parsing HTML pages, scripting a game engine, or writing web frameworks, to name a few examples. It is not so suitable for tasks typically done by low-level languages, like writing device drivers, or tasks where performance is critical, like rendering of 3D graphics, or serious number-crunching. This doesn't mean that it isn't possible to do these things with Python; but it's probably just not the right language for these jobs. One way to work around this is to write the low-level code in C, then have Python call it.
Mistake 2: writing "language X" code in PythonThis is a mistake that is almost unavoidable. You come from, say, Pascal, and try your hand at Python. The first code you write will probably look like Pascal with a Python syntax. You are writing Pascal code in Python. Some notorious symptoms of "language X" code, and the languages that may cause them:
Read more: Python beginner's mistakes
Mistake 2: writing "language X" code in PythonThis is a mistake that is almost unavoidable. You come from, say, Pascal, and try your hand at Python. The first code you write will probably look like Pascal with a Python syntax. You are writing Pascal code in Python. Some notorious symptoms of "language X" code, and the languages that may cause them:
- You're really paranoid about data hiding (some would call this "encapsulation"), and/or write getters and setters for all object attributes, no matter whether they add special rules or not. (Java, C++, Delphi)
- You overuse properties (one of the shiny new features in Python 2.2). (Java, Delphi, maybe Visual Basic, C++?)
Read more: Python beginner's mistakes
31 comments:
Incredible! This blog looks just like my old one!
It's on a totally different topic but it has pretty much the same layout and design. Excellent choice of colors!
My webpage: haare dünner
my webpage > Haarwuchs
buy tramadol online tramadol hcl 50 mg tablets used - order tramadol europe
xanax online xanax schedule 2 drug - type drug xanax valium
buy tramadol online buy tramadol no prescription online - tramadol addiction nhs
buy tramadol online buy tramadol with american express - tramadol dosage pain dogs
xanax online xanax drug test job - order xanax online no prescription
buy tramadol online tramadol withdrawal day 8 - how to buy tramadol online overnight
cheap tramadol online tramadol 50 mg vs oxycodone 30 mg - kind high tramadol
buy carisoprodol soma carisoprodol dosage - carisoprodol 350 mg codeine
buy tramadol online tramadol 50 mg snorting - could you overdose tramadol
buy tramadol online tramadol sr tablet 100mg - tramadol for dogs addictive
buy tramadol online soma tramadol high - tramadol online for cheap
buy tramadol online beat tramadol addiction - what is tramadol addiction
buy tramadol online tramadol overnight no prescription mastercard - can take 3 50 mg tramadol
xanax online dosage for xanax for anxiety - xanax 2mg alprazolam
My developer is trying to persuade me to move to .
net from PHP. I have always disliked the idea because of the expenses.
But he's tryiong none the less. I've been using
Movable-type on several websites for about a year and am worried about switching to another
platform. I have heard great things about blogengine.net.
Is there a way I can import all my wordpress content into
it? Any help would be greatly appreciated!
Check out my web site; barcode scanner repair
xanax online how to pass a drug test in 24 hours + xanax - xanax dosage muscle spasm
Hi, its fastidious piece of writing regarding media print,
we all be familiar with media is a great source of information.
Also visit my site ... motorola scanner repair
Also see my web page :: psc barcode scanner repair
buy cialis from canada reviews on cialis vs. viagra - buy cialis online ireland
http://landvoicelearning.com/#74967 tramadol drug buyers - tramadol extended release 100 mg
tramadol online tramadol canadian pharmacy no prescription - tramadol online
http://buytramadolonlinecool.com/#28875 tramadol withdrawal while pregnant - safe take 2 50mg tramadol
buy tramadol tramadol dosage bluelight - tramadol 50 mg extended release
http://buytramadolonlinecool.com/#96430 tramadol for dogs dosage usa - tramadol no prescription overnight cod delivery
http://blog.dawn.com/dblog/buy/#blog tramadol hcl 30 mg - tramadol overnight shipping cod
cheap ativan buy lorazepam online no prescription needed - what is ativan high like
buy tramadol cod online order tramadol online us pharmacy - tramadol hcl 50 mg generic ultram
Oh my goodness! Impressive article dude!
Many thanks, However I am experiencing troubles with your RSS.
I don't know why I cannot subscribe to it. Is there anybody else getting identical RSS problems? Anyone who knows the answer will you kindly respond? Thanx!!
Feel free to surf to my web site; Recover Twitter Account
So from your Severe Love Spells of advertising your soul
to conjuring up state of mind to aid http://h2u.hartlake.org/groups/blakessciencepage/wiki/2de9d/How_to_Get_Your_Ex_Back__About_three_Methods_For_Success_and_three_Items_to_Avoid.html on two separate pieces of orange-coloured papers.
[url=http://www.nastyville.eu/help/index.php?title=Will_My_Ex_lover_Revisit_Relationship_Advice_Online_That_Will_Make_Your_Ex_Come_Back_to_You]how to
get your ex boyfriend back[/url] The Way To Get He Or She
Boyfriend show you this. For many have confidence in is simply challenging to obtain http:
//metrodetroitsalsa.com/index.php?option=com_blog&view=comments&pid=194849&Itemid=0 countless men and women think that
there's nevertheless desire to enable them to conserve their partnership.
Also visit my site; how to get your ex girlfriend back
Great delivery. Solid arguments. Keep up the good effort.
Here is my blog ... password hacking software
This program is intended to recover lost passwords for RAR/WinRAR archives of versions 2.
xx and 3.xx. http://www.passwordrecoveryforrar.
tk The free professional solution for recovering lost passwords to RAR
and WinRAR archives.
I really love your blog.. Pleasant colors & theme.
Did you build this web site yourself? Please reply back
as I'm wanting to create my very own blog and would like to find out where you got this from or what the theme is called. Many thanks!
Post a Comment