If you use Linux, libc.info is a must. I could not have written all the stuff I did without it. One my system it is here /usr/info/libc.info.gz /usr/info/libc.info-1.gz .... /usr/info/libc.info-10.gz /usr/info/libc.info-11.gz
I unzipped all files and concatenated (cat remember) all together into on long libc.info ASCII file. This one is 69804 lines long.
Use search in your editor (I use 'joe' as editor in Linux) for any subject regarding library functions you like. It has clear examples too.
There is everything from networking to memory to files to whatever, math functions... Here is a very old version from 1999 on my site:
formatting link
If you know all that you are good to go for most projects. I still use it frequently.
Made famous in John Carmack's Quake 3 source code, as a fast inverse square root is used to calculate draw distance. Arithmetic operations, and a bit of floating point abuse, saved many cycles over doing it the canonical (more accurate) way.
Well, maybe not directly, but shared libraries, virtual memory and other understructure can have the same effect when it's useful. In VMS, there were lots of cross-language subroutine calls, and very useful ones, because the languages had a LOT in common, courtesy of good OS support.
The prototypical slide rule (Napier's bones) didn't have the cursor, but I take your meaning. One of my collection of slipsticks has a broken cursor, it's HARD to build one; thin glass from a craft-shop mirror, diamond blade to cut it (too small for scribe/snap), and I'm still not sure how to make that little groove and fill it with paint. Copper wheel and abrasive, maybe?
In VAX/VMS each language was require the hardware defined subroutine call instruction that defined the stack frame etc. Hence you could programming languages in a program quite freely. The run time library (RTL) also contained a lot of useful functions callable from any language.
Once a customer demanded that a data security program to be written in Cobol. No problem handling access control lists (ACL) and protection bitmask. and other system programming things. That Cobol program consisted mostly on RTL calls :-).
I used to use PC-Lint, but my most recent version is C++98. ;)
What are your faves?
Cheers
Phil Hobbs
--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510
http://electrooptical.net
http://hobbs-eo.com
--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510
http://electrooptical.net
http://hobbs-eo.com
On Jan 3, 2019, snipped-for-privacy@downunder.com wrote (in article):
All true, but not for the platforms I was using, for reasons that I no longer recall. We did use COMMON a lot. But reverting to assembly was usually easier
function or subroutine.
handle realtime I/O very well, where one cannot predict the order in advance, and so must be able to dance to the events as they arrive.
1980. No stack back then. The ISR code had to be in a different process than the application code, or they would overlay return pointers with each other's return pointers. System would run for maybe ten minutes, then bang - all the red lights came on. It was about 40,000 lines of Fortran, too much to attempt debugging by code review.
I was brought in from a different project - fresh eyes. Spent a week figuring this out, largely spent asking questions looking for the slipped assumption. Which was basically that the application programmers did not know how subroutines worked, and ended up sharing a common runtime utility function, that converted from float to integer or the like, but had a name that was not itself valid in Fortran code, and could only be used by generated code
overlaid with the wrong return address.
Nah. The political problem with C was that C and Ada83 were direct competitors in the language wars. The Ada folk did not feel threatened by
the process of losing the war to C. Ada95 came out long after the war was lost. Now, C/C++ dominates, and Ada95 is a niche language used almost entirely for DO-178-level safety critical code.
Or one could just compile an empty function into assembly, and hack that up manually.
In my late teens and early 20s I used to do a lot of HP calculator programming, which was about as close to assembly language as I wanted to get.
Cheers
Phil Hobbs
(Who still uses an HP 41CV a few times per week)
--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510
http://electrooptical.net
http://hobbs-eo.com
If I were prepared to run Android, that might be useful. ;)
Cheers
Phil Hobbs
(Blackberry 10 diehard, for data security reasons)
--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510
http://electrooptical.net
http://hobbs-eo.com
It was nothing to do with the debugging techniques. Printf / serial port debugging outputs are often useful as a complement to a normal debugger - gdb gives you a lot more power and flexibility for debugging, but has the disadvantage of usually requiring you to pause the program during debugging. There is no single debugging technique that suits all purposes - and no good developer would dismiss particular types out of hand.
No, my issue is with the code itself. Functions with half a dozen parameters? Hugh swaths of local variables, all declared at the start of functions? Identifier lengths at odds with their scopes? Maybe I am being unfair to judge from a couple of snippets here, but this looks like someone who learned their C coding some 25 or 30 years ago, without learning about code and data structures, and has not learned more since then.
I programmed a steamship propulsion system (steam valve, turbines, prop, hull mass) on an HP 9100 desktop calculator, and sold a couple hundred million dollars worth of systems (for which I was paid $400 a month at the time.)
I graduated to a PDP-8 running Focal, which was a lot better.
Most calcs are programmable now, but I never program them. It's more sensible to write a PowerBasic program, which allows comments.
I have a bunch of HP 32SII's, which is a decent calculator. Almost as good as the original HP35.
--
John Larkin Highland Technology, Inc
lunatic fringe electronics
For reusable calculations, like power system design, I use Excel spreadsheets. The language sucks but the interface makes up for it. I only need to write the "application" once and I can use it forever. In fact several of the other engineers in the organization use my spreadsheets and they're considered "best practices" in our organization now.
I have a 35S (whatever the "new" HP-35 is called). It sucks, compared to the original and the '45 but at least it's RPN. I also bought a mint condition 11C from eBay a couple of years ago. It's the best of the HPs, IMO. I also have an 11C emulator on my Note-8 (and every cell phone before) that's identical to the original.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.