by russell
Stumbled across this interview with Barbara Liskov in the news feed. Liskov is an important presence in the history of computing for her contributions in areas like type theory, but mostly for her very pragmatic insights into how to structure a code base so that working with it doesn't lead to insanity and an early death from alcoholism. (slight joke, but only slight). She has bubbled up into the general consciousness of the software development community due to one of her papers being dragooned into support for one of the latest of software development's maniacal fad diets. But, I digress.
I thought the ObWi community might enjoy this because (a) she's a very intelligent person, and it's always a pleasure to listen to intelligent people think out loud, and (b) she touches on topics that are generally of interest here: software development, the realities facing gifted women trying to make their way in technical (or any) fields, and the emergence of the internet and its effects on society.
Hope you find it interesting!
Enjoy
Interesting.
I am pleased that my adviser in the math dept at the University of Nebraska many years ago became chair and pushed really hard to increase the number of women faculty members and graduate students. More importantly, successful women graduate students: the department has earned notice and awards from the AMS for the mentoring program for women PhD students. They do a lot of interesting support for undergraduate women as well.
Goto took an ungodly long time to die. In 1977 I was doing a masters thesis on large-scale network optimization problems. As part of that I got a copy of what was then the world's fastest code for that class of problems from the Naval Postgraduate School. It was Fortran and was full of every goto variant the language supported, with comments suggesting they were all there to make the code faster. I spent a month rewriting with normal control structures. The result had 20% fewer lines of code and was 40% faster. Mostly because with reasonable structure (and indenting) it was possible to recognize some obvious inefficiencies in how the data was organized.
Posted by: Michael Cain | November 21, 2019 at 01:09 PM
About the most GOTO riddled code I ever worked on was software to monitor and control oil and gas pipeline pumping stations. Luckily, at the time - 1992, there was software that could restructure and pretty print FORTRAN and point out the places it couldn't be fixed by the software. That made the original code easier to understand even if it didn't get replaced.
Posted by: CharlesWT | November 21, 2019 at 01:48 PM
(and indenting)
OMG.
I've only skimmed the Liskov interview so far. It brings up a lot of difficult issues for me, which maybe I'll touch on later, or maybe not.
But indenting? I spent a significant chunk of my working life taking over existing code from other people and maintaining/expanding it for new versions and enhancements and fixes, or helping to translate old code as replacement systems were being written in more modern environments.
For a lot of that work, the first thing I did was to reformat everything to make the structure clear.
I don't understand how anyone can write/read/debug code that is not just not sensibly indented to reflect the logic, but indented all over the place without any regard to the logic whatsoever.
Circling back to the OP's link, for most of the almost 40 years I worked as a technical person, I was the only woman doing that kind of work in my company (i.e. taking over existing code, interpreting old code, etc.). I was the only one willing (able?) to read other people's code and take it on as my responsibility. It was beneath my colleagues' dignity, apparently, to try to decipher stuff other people had written in languages they didn't know.
.....Biting my metaphorical tongue on a much longer rant.
Posted by: JanieM | November 21, 2019 at 02:08 PM
Goto took an ungodly long time to die
oh, i assure you it's not dead.
that is the approved standard at the rather large software company where i work, for C.
nested ifs are considered gauche because so many of us still use vi in 80-char-wide terminal windows and horizontal scrolling is bad.
Posted by: cleek | November 21, 2019 at 02:17 PM
At least, in your example, the GOTOs are contained within the subroutine.
Posted by: CharlesWT | November 21, 2019 at 02:21 PM
C only lets GOTO within the function. thankfully.
(there's always the terrifying setjmp / longjmp, though!)
Posted by: cleek | November 21, 2019 at 02:25 PM
I don't understand how anyone can write/read/debug code that is not just not sensibly indented to reflect the logic, but indented all over the place without any regard to the logic whatsoever.
My first assignment at Bell Labs was to take over a piece of PL/I code. The guy who wrote it wrote in paragraphs. Statement, semicolon, a blank space, start the next statement. When the editor line was nearly full, newline at a point where it didn't break the syntax -- in practice, anywhere that didn't split a keyword or variable name -- and continue. Not unusual to see the last line in a paragraph that finished with:
END; END; END; END; END; END; END;
The equivalent of 5,000 lines of that stuff. It actually ran and produced correct results. I never figured out how he did it. I couldn't find an existing pretty printer for PL/I at the Labs, so I had to write one.
Posted by: Michael Cain | November 21, 2019 at 02:31 PM
job security.
Posted by: cleek | November 21, 2019 at 03:13 PM
I don't understand how anyone can write/read/debug code that is not just not sensibly indented to reflect the logic, but indented all over the place without any regard to the logic whatsoever.
Amen, sister, amen.
But then, I've never understood why people don't comment their code either. It not only makes life enormously easier for someone else who has to come along and try to maintain it later. I find that it also makes it easier for ME to remember what I was doing months or years ago when I wrote it.
Posted by: wj | November 21, 2019 at 03:14 PM
(there's always the terrifying setjmp / longjmp, though!)
I have a piece of antique interactive C code that implements the main program loop with setjmp/longjmp. Given the overall purpose and structure of the program and data, bailing out of the C stack from an arbitrary depth is not an unreasonable way to handle things.
The C style you showed is also not unreasonable in its place. Absent the syntactic sugar, it's basically Python's
try:
doSomething()
doSomethingElse()
except Exception as e:
cleanup()
Posted by: Michael Cain | November 21, 2019 at 03:18 PM
CLU looks like an interesting language.
https://en.wikipedia.org/wiki/CLU_(programming_language)
a long lost cousin of C++.
Posted by: cleek | November 21, 2019 at 03:21 PM
Absent the syntactic sugar, it's basically Python's...
that's what i keep telling myself.
i should do it like this:
and then just write it:
then i could pretend i was using a proper language.
Posted by: cleek | November 21, 2019 at 03:28 PM
unexpected bonus newlines keep on-line life fresh.
Posted by: cleek | November 21, 2019 at 03:29 PM
10 PRINT "HAIRSHIRTHEDONIST IS AWESOME!"
20 GOTO 10
30 END
See. I know all about this stuff.
Posted by: hairshirthedonist | November 21, 2019 at 03:39 PM
But then, I've never understood why people don't comment their code either. It not only makes life enormously easier for someone else who has to come along and try to maintain it later. I find that it also makes it easier for ME to remember what I was doing months or years ago when I wrote it.
Absolutely, esp. the last bit.
*****
See. I know all about this stuff.
That went without saying. ;-)
Posted by: JanieM | November 21, 2019 at 03:45 PM
At a facility I once worked at, the mini-computer we were using would come to a near-complete stall about noon every day. Turned out that one of the engineers was using a bit of code he had written to display the time on his terminal when he went to lunch. The code was using a hard loop without any pause between each update of the time.
Posted by: CharlesWT | November 21, 2019 at 03:54 PM
bet it kept that CPU nice and warm, too.
Posted by: cleek | November 21, 2019 at 03:57 PM
See. I know all about this stuff.
Well, you've definitely got the infinite loop down.
Posted by: wj | November 21, 2019 at 04:52 PM
I write most of my comments before I write the code, to tell myself what to do.
Posted by: Pro Bono | November 21, 2019 at 06:30 PM
Well, you've definitely got the infinite loop down.
At least since 1985, and I was a late starter.
Posted by: hairshirthedonist | November 21, 2019 at 07:47 PM
The introduction to the interview says:
Other people were definitely thinking about abstract data types at that time, with encapsulation. (For example, James H. Morris Jr.'s papers from that time, such as "Types are Not Sets".) I think of CLU (the language Liskov and her students designed) as having abstract data types with parametric polymorphism (which was new and perhaps unique, although Jim Morris's 1969 PhD thesis laid some groundwork).
I don't see how C++ can be considered a descendant of CLU, since its designer explicitly based it on the classes and inheritance of the much earlier Simula-67.
Posted by: Paul McJones | November 22, 2019 at 04:44 PM
i think Stroustrup has said the idea for C++ templates and were inspired by CLU and Ada. exceptions, too.
Posted by: cleek | November 25, 2019 at 10:03 AM
A blatant bit of commercialism. A book was written by an Internet buddy.
"Learn C++ the quick, easy, and “lazy” way. This book is an introductory programming text that uses humor and fun to make you actually willing to read, and eager to do the projects -- with the popular C++ language."
C++ for Lazy Programmers: Quick, Easy, and Fun C++ for Beginners
Posted by: CharlesWT | November 30, 2019 at 04:46 PM
Spent an hour or two yesterday running C++ constexpr examples through various compilers on the Godbolt website, to see what it would actually do at the machine level.
I've spent about half of my fabulous 35 year and counting tech career working in C++. It's weird to work in a language where what you write might... not be what you get. Sometimes in consequential ways.
That was always kind of so, but with the language enhancements since the C++11 standard, even more so.
"Hints to the compiler" are my bete noire.
Posted by: russell | November 30, 2019 at 10:36 PM