Author Topic: Toward more efficient programming!  (Read 625 times)

Offline gunug

  • TS Addict
  • *****
  • Posts: 6710
  • TS Palindrome
    • View Profile
Toward more efficient programming!
« on: January 13, 2020, 09:58:48 AM »
I learned Machine Language (assembler) Programming on processors with a much smaller amount of memory and when every processor cycle made a difference; now we may come back to that:

Quote
But computing involves a combination of hardware and software and one of the predictable consequences of Moore’s law is that it made programmers lazier. Writing software is a craft and some people are better at it than others. They write code that is more elegant and, more importantly, leaner, so that it executes faster. In the early days, when the hardware was relatively primitive, craftsmanship really mattered. When Bill Gates was a lad, for example, he wrote a Basic interpreter for one of the earliest microcomputers, the TRS-80. Because the machine had only a tiny read-only memory, Gates had to fit it into just 16 kilobytes. He wrote it in assembly language to increase efficiency and save space; there’s a legend that for years afterwards he could recite the entire program by heart.

There are thousands of stories like this from the early days of computing. But as Moore’s law took hold, the need to write lean, parsimonious code gradually disappeared and incentives changed. Programming became industrialised as “software engineering”. The construction of sprawling software ecosystems such as operating systems and commercial applications required large teams of developers; these then spawned associated bureaucracies of project managers and executives. Large software projects morphed into the kind of death march memorably chronicled in Fred Brooks’s celebrated book, The Mythical Man-Month, which was published in 1975 and has never been out of print, for the very good reason that it’s still relevant. And in the process, software became bloated and often inefficient.

. . .

It is. In a lecture in 1997, Nathan Myhrvold, who was once Bill Gates’s chief technology officer, set out his Four Laws of Software. 1: software is like a gas – it expands to fill its container. 2: software grows until it is limited by Moore’s law. 3: software growth makes Moore’s law possible – people buy new hardware because the software requires it. And, finally, 4: software is only limited by human ambition and expectation.

https://www.theguardian.com/commentisfree/2020/jan/11/we-are-approaching-the-limits-of-computer-power-we-need-new-programmers-n-ow
"If there really is no beer in heaven then maybe at least the
computers will work all of the time!"

Offline Xairbusdriver

  • Administrator
  • TS Addict
  • *****
  • Posts: 26388
  • 27" iMac (mid-17), Big Sur, Mac mini, Catalina
    • View Profile
    • Mid-South Weather
Re: Toward more efficient programming!
« Reply #1 on: January 13, 2020, 11:29:57 AM »
My three rules (whenever I think I have grasped a programming concept :wallbash:):
  • Every program has at least one bug.
  • Every program can be reduced in size by at least one line.
  • Therefore, every program can be reduced to a single line - which is a bug.

Now we have compilers that can allow for much easier to read code that is then reduced to very difficult to read machine code. :thumbup: But there are still folks who think they should write the human-readable stuff so cryptically that it can still be nearly impossible to figure out what the app is doing or how or when. :wallbash: Saving bits/smaller file sizes in a high level 'language' is not the same as writing lean machine language. :nono:

I never really advanced from AppleSoft BASIC. Now I restrict myself pretty much to BBC. :blush-anim-cl: :doh:
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system
CAUTION! Childhood vaccinations cause adults! :yes: