Re: Why Python When There Is Perl?

Liste des GroupesRevenir à ol advocacy 
Sujet : Re: Why Python When There Is Perl?
De : bowman (at) *nospam* montana.com (rbowman)
Groupes : comp.os.linux.advocacy
Date : 21. Mar 2024, 07:36:18
Autres entêtes
Message-ID : <l61vaiFn16lU2@mid.individual.net>
References : 1 2 3
User-Agent : Pan/0.149 (Bellevue; 4c157ba)
On Wed, 20 Mar 2024 18:31:00 -0400, DFS wrote:

After I learned enough python, I started working on the same problems
with C.  C executes 5x to 10x faster than Python, but requires 3x to 5x
the amt of time and code.  Note: you will NEVER recoup the extra C
development time with savings in program execution time.

To quote Kenny Rodgers (Don Schiltz actually) you've got to know when to
hold them and when to fold them. A common mistake is worrying too much
about optimization early in the development cycle.

While I agree on the volume as measured by lines of code I'm not sure
about the time, particularly when you have an established codebase.

url = f" https://itunes.apple.com/search?term={term}
&media=music&limit={self.limit}"
response = requests.get(url).json()
list = []
for result in response["results"]:

does a lot in four lines. I'm looking at some C code using the OpenSSL
library to connect to a host/port, do a HTTPS transaction. and return the
result. There's a generous amout of error checking and handling and it's
84 lines rather than 1.

BUT. amd this is the big but, like whoever developed the Python requests
package I wrote the code a long time ago. It's in a file called http.c
strangely enough. Include the file and the 84 lines becomes

static char* https_send(char* msg);

As the static implies that function isn't directly called. There are other
entry points that build the HTTP header as required, figure out the
ContentLength and so forth, 

The real time spent is figuring out what you want to do or to put it in
geek speak, developing the necessary algorithms and data structures.

I've been reading

https://www.amazon.com/Python-Tricks-Buffet-Awesome-Features/dp/1775093301

The sniipets aren't long but he goes into list comprehension, decorators,
some of the more obscure dunders, setting up classes with class variables,
instance variables, and static functions using decorators, why you might
want to do so, and how they work.

The section I'm on now is Common Data Structures in Python. Every Python
programmer knows what a list is, but how does it work? Is it a linked
list, and array, or what?  Again in C linked lists of structs are common.
They don't have the nice neat look of Python but I can build single or
doubly linked lists, insert or remove elements, set up sorting and so
forth in my sleep. If there isn't boilerplate I can cut'n'paste' the time
to implement one depends on my typing speed. The same can be said for C++
containers; if you know how to do it in C, it comes down to typing.




Date Sujet#  Auteur
19 Mar 24 * Why Python When There Is Perl?308Lester Thorpe
20 Mar 24 +* Re: Why Python When There Is Perl?10Lawrence D'Oliveiro
20 Mar 24 i+* Re: Why Python When There Is Perl?2rbowman
20 Mar 24 ii`- Re: Why Python When There Is Perl?1Lawrence D'Oliveiro
20 Mar 24 i`* Re: Why Python When There Is Perl?7Nuxxie
20 Mar 24 i +* Re: Why Python When There Is Perl?2Chris Ahlstrom
21 Mar 24 i i`- Re: Why Python When There Is Perl?1rbowman
21 Mar 24 i `* Re: Why Python When There Is Perl?4rbowman
21 Mar 24 i  `* Re: Why Python When There Is Perl?3Lawrence D'Oliveiro
21 Mar 24 i   `* Re: Why Python When There Is Perl?2Lawrence D'Oliveiro
22 Mar 24 i    `- Re: Why Python When There Is Perl?1rbowman
20 Mar 24 `* Re: Why Python When There Is Perl?297Physfitfreak
20 Mar 24  +- Re: Why Python When There Is Perl?1rbowman
20 Mar 24  +* Re: Why Python When There Is Perl?4DFS
20 Mar 24  i`* Re: Why Python When There Is Perl?3rbowman
21 Mar 24  i `* Re: Why Python When There Is Perl?2DFS
21 Mar 24  i  `- Re: Why Python When There Is Perl?1rbowman
20 Mar 24  +* Re: Why Python When There Is Perl?202Nuxxie
21 Mar 24  i+* Re: Why Python When There Is Perl?194Physfitfreak
21 Mar 24  ii+- Re: Why Python When There Is Perl?1DFS
21 Mar 24  ii+- Re: Why Python When There Is Perl?1DFS
21 Mar 24  ii`* Re: Why Python When There Is Perl?191Farley Flud
21 Mar 24  ii +- Re: Why Python When There Is Perl?1Lawrence D'Oliveiro
22 Mar 24  ii +* Re: Why Python When There Is Perl?187Physfitfreak
22 Mar 24  ii i+* Re: Why Python When There Is Perl?2Lawrence D'Oliveiro
22 Mar 24  ii ii`- Re: Why Python When There Is Perl?1Physfitfreak
22 Mar 24  ii i+* Re: Why Python When There Is Perl?12Farley Flud
22 Mar 24  ii ii`* Re: Why Python When There Is Perl?11DFS
22 Mar 24  ii ii +* Re: Why Python When There Is Perl?7rbowman
22 Mar 24  ii ii i`* Re: Why Python When There Is Perl?6DFS
23 Mar 24  ii ii i `* Re: Why Python When There Is Perl?5rbowman
23 Mar 24  ii ii i  `* Re: Why Python When There Is Perl?4Lawrence D'Oliveiro
23 Mar 24  ii ii i   `* Re: Why Python When There Is Perl?3rbowman
23 Mar 24  ii ii i    `* Re: Why Python When There Is Perl?2Lawrence D'Oliveiro
23 Mar 24  ii ii i     `- Re: Why Python When There Is Perl?1rbowman
24 Mar 24  ii ii `* Re: Why Python When There Is Perl?3Stéphane CARPENTIER
24 Mar 24  ii ii  `* Re: Why Python When There Is Perl?2DFS
24 Mar 24  ii ii   `- Re: Why Python When There Is Perl?1rbowman
22 Mar 24  ii i+* Re: Why Python When There Is Perl?169Farley Flud
23 Mar 24  ii ii`* Re: Why Python When There Is Perl?168Physfitfreak
23 Mar 24  ii ii +* Re: Why Python When There Is Perl?6Physfitfreak
23 Mar 24  ii ii i`* Re: Why Python When There Is Perl?5Physfitfreak
24 Mar 24  ii ii i `* Re: Why Python When There Is Perl?4Lawrence D'Oliveiro
24 Mar 24  ii ii i  `* Re: Why Python When There Is Perl?3Physfitfreak
24 Mar 24  ii ii i   +- Re: Why Python When There Is Perl?1Physfitfreak
24 Mar 24  ii ii i   `- Re: Why Python When There Is Perl?1rbowman
23 Mar 24  ii ii +* Re: Why Python When There Is Perl?160Farley Flud
23 Mar 24  ii ii i+- Re: Why Python When There Is Perl?1DFS
23 Mar 24  ii ii i+* Re: Why Python When There Is Perl?113rbowman
24 Mar 24  ii ii ii`* Re: Why Python When There Is Perl?112Physfitfreak
24 Mar 24  ii ii ii `* Re: Why Python When There Is Perl?111rbowman
25 Mar 24  ii ii ii  `* Re: Why Python When There Is Perl?110Physfitfreak
25 Mar 24  ii ii ii   +* Re: Why Python When There Is Perl?102rbowman
25 Mar 24  ii ii ii   i+- I control Afghanistan; they do what I say, when I say.1Relf
26 Mar 24  ii ii ii   i`* Re: Why Python When There Is Perl?100Physfitfreak
26 Mar 24  ii ii ii   i +* Re: Why Python When There Is Perl?98Physfitfreak
26 Mar 24  ii ii ii   i i+* Re: Why Python When There Is Perl?9Physfitfreak
2 Apr 24  ii ii ii   i ii`* Re: Why Python When There Is Perl?8Lawrence D'Oliveiro
2 Apr 24  ii ii ii   i ii `* Re: Why Python When There Is Perl?7rbowman
2 Apr 24  ii ii ii   i ii  +* Re: Why Python When There Is Perl?4Physfitfreak
3 Apr 24  ii ii ii   i ii  i`* Re: Why Python When There Is Perl?3rbowman
3 Apr 24  ii ii ii   i ii  i `* Re: Why Python When There Is Perl?2Physfitfreak
3 Apr 24  ii ii ii   i ii  i  `- Re: Why Python When There Is Perl?1Physfitfreak
6 Apr 24  ii ii ii   i ii  `* Re: Why Python When There Is Perl?2Stéphane CARPENTIER
6 Apr 24  ii ii ii   i ii   `- Re: Why Python When There Is Perl?1rbowman
26 Mar 24  ii ii ii   i i`* Re: Why Python When There Is Perl?88rbowman
26 Mar 24  ii ii ii   i i +* Re: Why Python When There Is Perl?2Chris Ahlstrom
26 Mar 24  ii ii ii   i i i`- Re: Why Python When There Is Perl?1rbowman
26 Mar 24  ii ii ii   i i +- Re: Why Python When There Is Perl?1rbowman
26 Mar 24  ii ii ii   i i +* Re: Why Python When There Is Perl?83Physfitfreak
26 Mar 24  ii ii ii   i i i+* Re: Why Python When There Is Perl?3rbowman
27 Mar 24  ii ii ii   i i ii+- Re: Why Python When There Is Perl?1Physfitfreak
27 Mar 24  ii ii ii   i i ii`- Re: Why Python When There Is Perl?1Chris Ahlstrom
2 Apr 24  ii ii ii   i i i`* Re: Why Python When There Is Perl?79Lawrence D'Oliveiro
2 Apr 24  ii ii ii   i i i +- Re: Why Python When There Is Perl?1Chris Ahlstrom
2 Apr 24  ii ii ii   i i i `* Re: Why Python When There Is Perl?77Physfitfreak
3 Apr 24  ii ii ii   i i i  `* Re: Why Python When There Is Perl?76Lawrence D'Oliveiro
3 Apr 24  ii ii ii   i i i   `* Re: Why Python When There Is Perl?75Physfitfreak
5 Apr 24  ii ii ii   i i i    `* Re: Why Python When There Is Perl?74Lawrence D'Oliveiro
5 Apr 24  ii ii ii   i i i     +* Re: Why Python When There Is Perl?72rbowman
5 Apr 24  ii ii ii   i i i     i+* Re: Why Python When There Is Perl?61Lawrence D'Oliveiro
5 Apr 24  ii ii ii   i i i     ii`* Re: Why Python When There Is Perl?60rbowman
5 Apr 24  ii ii ii   i i i     ii +* Re: Why Python When There Is Perl?3Lawrence D'Oliveiro
5 Apr 24  ii ii ii   i i i     ii i+- Re: Why Python When There Is Perl?1Physfitfreak
6 Apr 24  ii ii ii   i i i     ii i`- Re: Why Python When There Is Perl?1RonB
5 Apr 24  ii ii ii   i i i     ii `* Re: Why Python When There Is Perl?56Chris Ahlstrom
6 Apr 24  ii ii ii   i i i     ii  `* Re: Why Python When There Is Perl?55RonB
7 Apr 24  ii ii ii   i i i     ii   `* Re: Why Python When There Is Perl?54Chris Ahlstrom
7 Apr 24  ii ii ii   i i i     ii    +* Re: Why Python When There Is Perl?10Chris Ahlstrom
7 Apr 24  ii ii ii   i i i     ii    i+* Re: Why Python When There Is Perl?2rbowman
8 Apr 24  ii ii ii   i i i     ii    ii`- Re: Why Python When There Is Perl?1RonB
7 Apr 24  ii ii ii   i i i     ii    i+- Re: Why Python When There Is Perl?1Physfitfreak
8 Apr 24  ii ii ii   i i i     ii    i`* Re: Why Python When There Is Perl?6RonB
8 Apr 24  ii ii ii   i i i     ii    i `* Re: Why Python When There Is Perl?5Chris Ahlstrom
10 Apr 24  ii ii ii   i i i     ii    i  `* Re: Why Python When There Is Perl?4RonB
10 Apr 24  ii ii ii   i i i     ii    i   `* Re: Why Python When There Is Perl?3Chris Ahlstrom
10 Apr 24  ii ii ii   i i i     ii    i    +- Re: Why Python When There Is Perl?1Physfitfreak
11 Apr 24  ii ii ii   i i i     ii    i    `- Re: Why Python When There Is Perl?1RonB
7 Apr 24  ii ii ii   i i i     ii    +* Re: Why Python When There Is Perl?30rbowman
8 Apr 24  ii ii ii   i i i     ii    i+* Re: Why Python When There Is Perl?5RonB
8 Apr 24  ii ii ii   i i i     ii    ii`* Re: Why Python When There Is Perl?4Chris Ahlstrom
8 Apr 24  ii ii ii   i i i     ii    i`* Re: Why Python When There Is Perl?24Chris Ahlstrom
7 Apr 24  ii ii ii   i i i     ii    +- Re: Why Python When There Is Perl?1Physfitfreak
8 Apr 24  ii ii ii   i i i     ii    +* Re: Why Python When There Is Perl?9RonB
8 Apr 24  ii ii ii   i i i     ii    +- Re: Why Python When There Is Perl?1RonB
9 Apr 24  ii ii ii   i i i     ii    `* Re: Why Python When There Is Perl?2Lawrence D'Oliveiro
5 Apr 24  ii ii ii   i i i     i+- Re: Why Python When There Is Perl?1Chris Ahlstrom
6 Apr 24  ii ii ii   i i i     i`* Re: Why Python When There Is Perl?9RonB
5 Apr 24  ii ii ii   i i i     `- Re: Why Python When There Is Perl?1Physfitfreak
2 Apr 24  ii ii ii   i i `- Re: Why Python When There Is Perl?1Lawrence D'Oliveiro
26 Mar 24  ii ii ii   i `- Re: Why Python When There Is Perl?1rbowman
2 Apr 24  ii ii ii   +* Re: Why Python When There Is Perl?6Lawrence D'Oliveiro
2 Apr 24  ii ii ii   `- Re: Why Python When There Is Perl?1Lawrence D'Oliveiro
24 Mar 24  ii ii i`* Re: Why Python When There Is Perl?45Physfitfreak
23 Mar 24  ii ii `- Re: Why Python When There Is Perl?1DFS
23 Mar 24  ii i`* Re: Why Python When There Is Perl?3DFS
24 Mar 24  ii `* Re: Why Python When There Is Perl?2Stéphane CARPENTIER
21 Mar 24  i+- Re: Why Python When There Is Perl?1Lawrence D'Oliveiro
21 Mar 24  i+* Re: Why Python When There Is Perl?5DFS
21 Mar 24  i`- Re: Why Python When There Is Perl?1rbowman
20 Mar 24  +* Re: Why Python When There Is Perl?56Yaxley Peaks
21 Mar 24  +* Re: Why Python When There Is Perl?32DFS
22 Mar 24  `- Re: Why Python When There Is Perl?1DFS

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal