Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":28076,"date":"2015-11-25T19:14:28","date_gmt":"2015-11-26T01:14:28","guid":{"rendered":"http:\/\/charliegdrummer.wordpress.com\/?p=284"},"modified":"2015-11-25T19:14:28","modified_gmt":"2015-11-26T01:14:28","slug":"mastery08-the-zen-of-python","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2015\/2015\/mastery08-the-zen-of-python\/","title":{"rendered":"Mastery08: The Zen of Python"},"content":{"rendered":"

The zen of python is a set of 19 principles that rule the design of the programming language python<\/p>\n

1.- Beautiful is better than ugly<\/span><\/h3>\n

This basically means the fact that python is, unlike others, a language restricted by identations and arrangements; in python, identation and order really counts. That’s one of the main reasons of why python is the first programming language that is taught.<\/p>\n

Is not the same to write<\/p>\n

if (x in y):<\/span>
\ns = all<\/span><\/p>\n

Than to write<\/p>\n

if (x in y):<\/span>
\n\u00a0 \u00a0 s = all<\/span><\/p>\n

The correct way is the second one.<\/p>\n

 <\/p>\n

2.- Explicit is better than implicit<\/span><\/h3>\n

In a contrast to another programming language that is implicit, JavaScript<\/p>\n

in JS, if you type the following line<\/p>\n

“55” + 5<\/span><\/p>\n

JS will IMPLICITLLY take the five as string<\/p>\n

On the other hand, in Python that line would result in an error, you have to specify first if both are srtrings or numbers<\/p>\n

3.- Simple is better than complex<\/span><\/h3>\n

This can be explained with the cocept of debugging, of fixing your program; If you use a lot of global variables, nesting conditional and other complex methods, you may get to you goal, but if not, seeing and fixing why you didn’t reach that goal is going to be a pain in the feelings.<\/p>\n

4.- Complex is better than complicated<\/span><\/h3>\n

To example this concept, we can use the loops for and while, check out this code:<\/p>\n

counter = 0<\/span>
\nwhile (counter < 10):<\/span>
\n\u00a0 \u00a0 \u00a0 x = counter\/3<\/span>
\n\u00a0 \u00a0 \u00a0 counter = counter + 1<\/span><\/p>\n

You see, this code is not complex, it is easy to get what it does, but it is too complicated, there are too many steps there; this code can be simplified with a for loop<\/p>\n

for e in range(0,11):<\/span>
\n\u00a0 \u00a0 \u00a0x = e\/3<\/span><\/p>\n

So both codes do the same work, the diference is that one is easier to explain.<\/p>\n

5.- Flat is better than nested<\/span><\/h3>\n

We can clear that with the conditionals. Each conditional has two paths, if the condition is met, or not. Those are the two only posibilities; now, i f you start nesting and nesting, the posibilities will grow as the powers of two, and we know it grows fast, in a four-level you will have sixteen posible paths, so things got hard. Imagine you have to debug –<\/p>\n

 <\/p>\n

6.- Sparse is better than dense<\/span><\/h3>\n

This is just a way of writting, you see, is really easier to read a code when it is well spaced and cute, rather than if it looks like the 380 bus at 7am. personally, I think that this principle has to be in every programming language because it makes it easier to read and manipulate the file itself<\/p>\n

 <\/p>\n

 <\/p>\n

7.- Readibility counts<\/span><\/h3>\n

Just as the last one, it has more benefit to have a well ordene code rather than a 380 bus at 7am; it is easier to detect where have you made a mistake and how to correct it…<\/p>\n

 <\/p>\n

8.- Special cases are not special enough to break the rules<\/span><\/h3>\n

This means just one thing, everything is an object<\/p>\n

 <\/p>\n

9.- Altough practicality beats purity<\/span><\/h3>\n

<\/h3>\n

 <\/p>\n

10.- Errors should never pass silently<\/span><\/h3>\n

That is why python does not runs when it finds an error<\/p>\n

 <\/p>\n

11.- Unless explicitly silenced<\/span><\/h3>\n

<\/h3>\n

 <\/p>\n

12.- In the face of ambiguity refuse the temptation to guess<\/span><\/h3>\n

Stay stick to the status quo!, \u00a0Just dont<\/p>\n

1 + ‘1’<\/span> dont guess!<\/p>\n

 <\/p>\n

13.- There should be one obvious way to do it<\/span><\/h3>\n

This gets to an unknown to me part of python, the protocols<\/p>\n

 <\/p>\n

14.- Altough it may not be that obvious unless you are a dutch<\/span><\/h3>\n

Whuuuut?! \ud83d\ude41<\/span><\/p>\n

15.- Now is better tha never<\/span><\/h3>\n

It’s better to fix the rpoblem ASAP because if not, debugging and functionality of further code could be negatibely affected<\/p>\n

 <\/p>\n

16.–Altough never is often better than now<\/span><\/h3>\n

Sometimes the problems won’t be resolved or would last a lot of time that is better to skipp them<\/p>\n

 <\/p>\n

17.- If the implementation it’s hard to explain, it’s a bad idea<\/p>\n

As it’s says, if it is too complicated to explain, it is too complicated to understand, tus it may be a bad idea.<\/p>\n

 <\/p>\n

18.- If the implementation it’s easy to explain, it may be a good idea<\/p>\n

Well, if it\u00a0can be read fluently, and explained easylly, it can be a good idea, it MAY be, so don’t assume that if it can be read then it’s ok<\/p>\n

 <\/p>\n

19.- Namespaces are \u00a0one hoonking great idea … let’s do more of those<\/span><\/h3>\n

it all has an order<\/p>\n

like local variables, nonlocal variables, the evil global variables, and the built in functions, it has a good hierarchy<\/p>\n

 <\/p>\n

\"zen_stones_by_3dbasti\"<\/p>\n

\"\"<\/a> \"\"<\/p>\n","protected":false},"excerpt":{"rendered":"

The zen of python is a set of 19 principles that rule the design of the programming language python 1.- Beautiful is better than ugly This basically means the fact that python is, unlike others, a language restricted by identations and arrangements; in python, identation … Continúa leyendo Mastery08: The Zen of Python<\/span><\/a>\"\"<\/p>\n","protected":false},"author":191,"featured_media":28075,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[178,45,39],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28076"}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/users\/191"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/comments?post=28076"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28076\/revisions"}],"predecessor-version":[{"id":28077,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/28076\/revisions\/28077"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media\/28075"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media?parent=28076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/categories?post=28076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/tags?post=28076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}