HNHacker News
TopNewBestAskShowJobs

dianeb

32 karma · joined September 27, 2018

submissionscomments
dianeb··on What's functional programming all about? (2017)
Define what you mean by "everyone" -- there are times where the cost of immutability can be overwhelming, such as in high traffic systems with overly complex data structures which you are required to use because someone who should have known better insisted upon writing.

(sorry, bitter personal experience) And yes, that is explicitly "modern" Java code written by a lead engineer and "java champion" in 2023.

dianeb··on AI Checkers Forcing Kids to Write Like a Robot to Avoid Being Called a Robot
It's really difficult to plagiarize if you write the paper or take the exam in class using paper and pen-or-pencil. It's also difficult to plagiarize if the teacher/professor/TA actually wanders around the room during the test (without stopping behind a student and raising the student's blood pressure in the process.)

Of course, that involves more on your part as teacher/professor -- you actually have to teach and test and act as editor -- on an ongoing basis. At university, that's part of what TA's are (or should be) expected to do. As a teacher, it's your responsibility.

So, if you happen to be a CS 101 instructor ask for the evolutionary copies of a program. If you happen to teach poetry and cover Herrick, ask for an original poem in the style of "Upon Julia's Dress" and see what the students happen to see from the same poem.

Teaching without ensuring that learning happens is a waste of time and a disservice to your profession.

dianeb··on Show HN: New RISC-V emulator for Computer Science education
I made a mistake. I'd like to blame it on my new mouse, but it was me. Thank you for pointing it.

I regret the error and shan't make it again.

dianeb··on Show HN: New RISC-V emulator for Computer Science education
@dang, the "comments" (other than this one) are all from a bot.
dianeb··on The Neat Programming Language
This construct: string longestLine = [ argmax(line.strip.length) line for line in text.split("\n")]; print(longestLine);

looks problematic to me -- are the brackets indicating scope? an array? something else?

As far as the naming is concerned, you'll probably have to put up with remarks such as "neat code is messy" because that's the way people are with something new. Don't let that dishearten you!

dianeb··on Cray-1 vs Raspberry Pi
As interesting as this article is as a comparison to a 40 year old supercomputer, the reality is that computers really are artifacts of an era and their place in the progress or regress of technology is possibly valid. Today's world's fastest computer is a Cray:

https://www.top500.org/news/frontier-remains-no-1-in-the-top...

So, how does the Raspberry Pi stack-up against today's computers?

dianeb··on The Neat Programming Language
Once upon a time, NCR's mainframe language was called Neat (the version I briefly used was called Neat/3 which was a low-to-mid-level language if memory serves. I was writing compilers.) My memories of a language with that name are unpleasant.

This is probably the least useful of all comments, but please think of another name. My quibble with the language has to do with the use of '[' .. ']' pairs. I'm not confident that refactoring will be straight-forward. I could be wrong.

dianeb··on Twilight of the programmers?
Actually, it's also the job of lead or senior engineers who have to teach their experienced and educated teammates how to read and write a state diagram and how to use it in order to show them why the code/service in question is unreachable from the current state -- and should remain so.
dianeb··on Announcing WCGI: WebAssembly and CGI
Sure, this fits the way software evolves on the circle of dumb. It goes something like this: What a great idea!... (a little later) Hmmm. That's a problem... (later) We need something to run apps in the browser. I wonder if WASM would work... (now) What a great idea!...

Software development always goes in cycles. "Apps" were great now maybe not so much so...

In the late 80s/early 90s, the CEO of ETA Systems (a supercomputer company) had a vision that by 2000, the world would be split between supercomputers and workstations. I have seen some evidence that people are considerng that once again... The Circle of Dumb is always with us in software land.

dianeb··on Campanology
For those who prefer reading books, there's always the precursor: _The_Nine_Tailors_ by Dorothy L Sayers. If you can find it, I believe there was a program or series called something like _Lord_Peter_Wimsey_ that aired on PBS that may have aired some time before the turn of the century.
dianeb··on Medicare Advantage plans use algorithms to cut off care
MedicareAdvantage is one of those things where people say, "Oh. It's Medicare and it has all this extra stuff!" because living on basic Medicare is expensive and finding appropriate physicians can be daunting because of high deductables and low cash to practitioners. It's not a scam but an attempt to provide better care.

The problem is that it's almost always run by insurance companies and they're concerned about profit rather than the individual. Think of it in the same way as you would a PPP or basic HMO plan from your employer. Other than the oddities such as money to pay for over-the-counter medication (limited to $40 per quarter) there's little-to-no difference.

It's not the government limiting the care but rather the insurance companies protecting their profits. It's capitalism in action. Deal with it.

dianeb··on Debugging Architects
There is nothing useful here. Don't waste your time.
dianeb··on Architecture and Design, the backbone of cutting-edge software products
Yes architecture is important. Yes, there are various software models that may fit in the general case. Seeing this short list is semi-useful, but the key is knowing the problem you wish to solve and how it fits within an organization.

There are no silver bullets. You still need to do the analysis, you still need to understand the technical competencies associated with any possible solution, and you won't get a good solution for your organization just by saying, "Domain-driven design (for example) is the way to go here." if the organization isn't prepared to make the investments in time and money required. If you expect to do an enterprise architecture, find an architect or three and give them a team to actually do the job. It will take longer than you would think.

dianeb··on Paving the on-ramp to Java
Alas, the language is incredibly verbose in and of itself and the plethora of examples continue to be incredibly verbose. From _Java in a Nutshell_ to the latest documentation, the examples all tend to be of the form:

UnbelievablyLongClassName unbelievablyLongClassName = new UnbelievablyLongClassName(parameterName, anotherParameterName);

Given that nearly all existing code follows this pattern (yes, there is var which is only useful in some cases as opposed to C++'s auto keyword) Java has become hopelessly convoluted.

Before I get downvoted, you should keep on mind that I was an early adopter (1996) of "Java as a sane C++" and have been stunned by the verbosity of "modern" Java applications. Unless the standard libraries change (and the effect of that would be staggering) and the open source libraries all change, and every existing application code changed to use reasonable names, Java will always be overly verbose.

dianeb··on C23 is finished: Here is what is on the menu
In C, you get what you pay for. When the platform changes, it's not unreasonable to recompile in order to take advantage of new hardware features. The OS is certainly different, even if it's still called "Whatever OS", it had to be recompiled in order to support the new hardware, unless, of course, it doesn't. We're all lazy when it comes to our own work, whether it's supporting new hardware in a compiler or OS or super web service on some new cloud platform or a large system vendor.

intmax_t by intent is the maximum integer available on a given platform. Abandoning that idea is a disservice to compiler writers, programmers -- especially scientific programmers -- everywhere.

dianeb··on Why 'worthless' humanities degrees may set you up for life
Generalizations are such fun; when you say, "The intellectual rigor just isn't there in any humanities classes because most of the students shouldn't be in college at all" I think you are conflating rigor with substance. Computer Science is easy but tedious if you're a Math major as I was. On the other hand, Native American literature was anything but easy because it required the clarity of a different world view as well as being able to write about it within the reality of the "inside-outside" nature where much of the literature originates. That understanding and the ability to write well is a rigor of its own.
dianeb··on Programming Languages: Survivors and Wannabes (1996)
Well, "better" is a loaded word, and you need to remember that C++ is not a superset of C. The two languages intersect in a fairly large subset of C, but there are parts of C++ that are not the same. I would claim that C++ is remarkably less safe than C because of the crazy games some people play with what's laughingly called "template meta-programming." You can abuse the C preprocessor, but not to the extent that its C++ mode permits.

That aside, the comparison of programming languages to automobiles still holds: C is a Formula One race car without seatbelts. C++ now resembles Ada in terms of size to the extent that it's a large staff car that comes in only one color. Java, which originally seemed to be a sane C++, is sort of like my father's Buick -- it looks nice but when you really need to do something slightly out of the ordinary like carry skis you can't do it without an accessory. That's right, it is a proprietary language (hence C#)

dianeb··on Enquire: Everything you wanted to know about your C compiler and machine
Somewhat surprisingly, clang 10's long double on a mac is implemented with 64 mantissa digits (bits) (LDBL_MANT_DIG = 64) so the information as presented is correct for clang on a MacBook Pro 2017 with a 2.8 GHz Intel Core i7.

So, is this a bug? Well, perhaps, but not in enquire.c. Experimental usage shows that only 10 bytes (79 bits) are actually used. This is clearly implemented as an x87 80-bit floating point number.

dianeb··on Enquire: Everything you wanted to know about your C compiler and machine
I wrote C compilers for several large companies in the 80's and 90's. Everyone in a compiler group had something like this if for no other reason than to demonstrate why "bugs" weren't bugs but "features". My code -- very different than this -- works to this day, but only because I keep it up-to-date with the C standard. Over the years, it's been very useful, especially when moving from one platform to another.

Most code really doesn't need this much detail -- "sizeof" is your friend -- You can start with something like this:

  sizes.c

  #include <stdio.h>

  int isBigEndian() {
    int x = 1;
    return(*(char *)&x != 1);
  }

  int main() {
    printf("This is a %s endian machine\n", isBigEndian() ? "big" : "little");
    printf("char: %lu\n", sizeof(char));
    printf("short: %lu\n", sizeof(short));
    printf("int: %lu\n", sizeof(int));
    printf("long: %lu\n", sizeof(long));
    printf("long long: %lu\n", sizeof(long long));
    printf("float: %lu\n", sizeof(float));
    printf("double: %lu\n", sizeof(double));
    printf("long double: %lu\n", sizeof(long double));
  }
compile as: cc -std=c17 sizes.c

...and add whatever else you need as you go along. A version of my compiler information code is in my forthcoming book.

dianeb··on Enquire: Everything you wanted to know about your C compiler and machine
This is Intel's 80-bit floating point. The reason the size is 128 is that it needs to align on a word boundary.