Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 333895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:00:14+00:00 2026-05-12T10:00:14+00:00

I had an argument with a colleague about writing python efficiently. He claimed that

  • 0

I had an argument with a colleague about writing python efficiently. He claimed that though you are programming python you still have to optimise the little bits of your software as much as possible, as if you are writing an efficient algorithm in C++.

Things like:

  • In an if statement with an or always put the condition most likely to fail first, so the second will not be checked.
  • Use the most efficient functions for manipulating strings in common use. Not code that grinds strings, but simple things like doing joins and splits, and finding substrings.
  • Call as less functions as possible, even if it comes on the expense of readability, because of the overhead this creates.

I say, that in most cases it doesn’t matter. I should also say that context of the code is not a super-efficient NOC or missile-guidance systems. We’re mostly writing tests in python.

What’s your view of the matter?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T10:00:15+00:00Added an answer on May 12, 2026 at 10:00 am

    My answer to that would be :

    We should forget about small
    efficiencies, say about 97% of the
    time: premature optimization is the
    root of all evil.

    (Quoting Knuth, Donald. Structured Programming with go to Statements, ACM Journal Computing Surveys, Vol 6, No. 4, Dec. 1974. p.268)

    If your application is doing anything like a query to the database, that one query will take more time than anything you can gain with those kind of small optimizations, anyway…

    And if running after performances like that, why not code in assembly language, afterall ? Because Python is easier/faster to write and maintain ? Well, if so, you are right 🙂

    The most important thing is that your code is easy to maintain ; not a couple micro-seconds of CPU-time !

    Well, maybe except if you have thousands of servers — but is it your case ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 493k
  • Answers 493k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Google has an official API for accessing search features, including… May 16, 2026 at 10:49 am
  • Editorial Team
    Editorial Team added an answer To create an array: NSMutableArray* africa = [NSMutableArray arrayWithObjects: @"Lion",… May 16, 2026 at 10:49 am
  • Editorial Team
    Editorial Team added an answer As the exception happens when you try to save, it… May 16, 2026 at 10:49 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I had a friend ask me about writing a program that would allow data
A colleague of mine told me about a little piece of design he has
My colleague and I have been having a discussion about what Collections should be
I have created a Data Access Layer using .NET. Everywhere that I update a
Coming from C/C++ a long time ago I still have a habit of ensuring
I have a c# program that access a java program by tcp. In my
I wrote a nice little app that gets Yahoo weather info and posts it
I had this simple modal contact form working fine but must have broke it
In the late years of college, I had a course on Compilers. We created
I had web site I launched it on server and it worked well internal

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.