You are viewing a single comment's thread from:

RE: Python Libraries: Expanding the Functions

in STEMGeeks3 years ago

You could check the length of posts as part of deciding if they are worthy of a vote. I know some bots count words.

This was something I was going to incorporate into the next change. I have yet to find an example in Holger's docs.

You can do a lot in one line. It may be quicker than a loop if that matters.

I once wrote a VB6 Forms app when working for HBOS (Now Lloyds Banking Group), and had to hand over the source when I left. I feel sorry for the person who had to dissect what I had done. It worked but even I struggled to read it!

When checking a boolean you don't really need the == True, but it does no harm if you find it easier to read.

image.png

This I do know and the function calls rely on True using the just the If statement, but on other occasions its stated more obviously.

In the proper coding world, I guess it has to conform all one way or another?

Sort:  

There has to be a compromise between being concise and being readable, but doing things in one line can be more efficient. There's a lot you can do with lists without resorting to a loop. Can always add a comment to make it clear what was intended.

There's a lot you can do with lists without resorting to a loop.

I know, still learning. I come from a VBS background and it shows.

I like that Python gives you options. You can write in the same style as some other languages, but you gradually learn the more 'Pythonic' ways.