Post AbPPGeGbAkAvBTcBxA by hhardy01@mastodon.social
(DIR) More posts by hhardy01@mastodon.social
(DIR) Post #AbMkyZjuseOPRrEfq4 by mhoye@mastodon.social
2023-11-01T13:48:06Z
0 likes, 1 repeats
People go to Stack Overflow because the docs and error messages are garbage. TLDR exists because the docs and error messages are garbage. People ask ChatGPT for help because the docs and error messages are garbage. We are going to lose a generation of competence and turn programming into call-and-response glyph-engine supplicancy because we let a personality cult that formed around the PDP-11 in the 1970s convince us that it was pure and good that docs and error messages are garbage.
(DIR) Post #AbMwCMS6B7Zxmvg4lE by mhoye@mastodon.social
2023-11-01T15:33:19Z
0 likes, 1 repeats
The number of people in this thread who are willing to tell me that the real problem is how stupid everyone is is incredibly embarrassing. Look, here's what happens when you compile Hello World with single quotes instead of double quotes. Note, please, that these are warnings, not errors. GCC finishes and produces an a.out executable.
(DIR) Post #AbMwCNEfGYQYDYOrSa by mhoye@mastodon.social
2023-11-01T15:37:09Z
0 likes, 0 repeats
Geez, that doesn't look good, but they're just warnings, maybe not deal-breakers. So let's run it and see what happens! An... immediate segmentation fault. Ok, well all those warnings are in printf so let's go look at the manual for printf.https://www.man7.org/linux/man-pages/man3/printf.3.htmlOh, yeah, check this out. You can tell we're on the right track:
(DIR) Post #AbMwCO0WOchybyn53Q by mhoye@mastodon.social
2023-11-01T15:44:18Z
0 likes, 0 repeats
It really gets rolling when we learn about the format of the format string. We wanted to print a string, not a constant character pointer to a "format string", but we can roll with that."The overall syntax of a conversion specification is: %[$][flags][width][.precision][length modifier]conversion"We're getting warmer you know? You can really feel it. We're close to figuring this out.
(DIR) Post #AbMwCOwIvmvfVBpE7U by publius@mastodon.sdf.org
2023-11-01T17:06:11Z
0 likes, 0 repeats
@mhoye Without disagreeing with you, I wonder whether it's possible (without true Artificial Intelligence) to consistently provide really useful error message, given the immense flexibility and power of even the simplest of programming languages (and the immense variety of ways a programmer can screw up).Documentation, on the other hand, suffers from having been written from the perspective of the people creating the program, not the people using it. I don't know how to fix that, either.
(DIR) Post #AbMwCPqJZXjSIu1xQG by mhoye@mastodon.social
2023-11-01T15:50:31Z
0 likes, 0 repeats
"The arguments must correspond properly (after type promotion) with the conversion specifier. By default, the arguments are used in the order given, where each '*' (see Field width and Precision below) and each conversion specifier asks for the next argument (and it is an error if insufficiently many arguments are given)."Uh... ok... look maybe we're getting off track here, that first error message said "character constant too long for its type", let's look for that.
(DIR) Post #AbMwCRl4S0j4FDanWi by mhoye@mastodon.social
2023-11-01T15:52:41Z
0 likes, 0 repeats
Welp.
(DIR) Post #AbMwCThbDt8aH1z3OS by mhoye@mastodon.social
2023-11-01T15:53:46Z
0 likes, 0 repeats
Let's try something different, maybe gcc --help will do something.And holy shit does it ever.
(DIR) Post #AbMwCVX2Q7sTwr3eD2 by mhoye@mastodon.social
2023-11-01T16:00:55Z
0 likes, 0 repeats
Well, let's see if we can find the error we got in that first message somewhere in the help file, the "-Wmultichar" thing we got in that first warning message. Let's see.... nope?
(DIR) Post #AbMwCXVL5Phu4AHJq4 by mhoye@mastodon.social
2023-11-01T16:03:09Z
0 likes, 0 repeats
The printf manual doesn't admit the existence of "multichar" either.
(DIR) Post #AbMwCZQRwYz61a0RUm by mhoye@mastodon.social
2023-11-01T16:32:41Z
0 likes, 0 repeats
"apropos multichar" comes up empty too, assuming I know about it.So tell me what I should have done differently. What should I have seen, what trail of breadcrumbs should I have followed, that would have gotten me from this message: "incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *'"to "You want double-quotes, not single quotes there", using the available docs.You complain about "StacktGPT Developers?" Well, this is what people are up against.
(DIR) Post #AbMyoHliExGaAt3zay by safiuddinkhan@toot.io
2023-11-01T17:35:32Z
0 likes, 0 repeats
@mhoye and i can tell you ChatGPT steals the stuff from Stack Overflow I saw it from my own eyes exactly the same snippet of code in ChatGPT and Stack Overflow otherwise ChatGPT has zero ability to think for itself.. Its more or less a procedural generation algorithm it cannot do any type of logic.
(DIR) Post #AbN4QUyc54OLui8dVY by immibis@social.immibis.com
2023-11-01T16:33:23.305653Z
0 likes, 0 repeats
@mhoye in this particular case the trail of breadcrumbs would have been basic language knowledge.
(DIR) Post #AbN4QWRMdez4SAb6xc by immibis@social.immibis.com
2023-11-01T16:35:47.139680Z
0 likes, 0 repeats
@mhoye the thing you are complaining about not being able to do amounts to learning a programming language by trial and error. And you're saying StackGPT allows one to learn a programming language by trial and error, and that's a good thing. Is it really?
(DIR) Post #AbN4QXGlYY6J1aeA52 by mhoye@mastodon.social
2023-11-01T17:04:33Z
0 likes, 0 repeats
@immibis Everything single thing in this world that is ever learned is to some degree learned by trial and error. There are mercifully ways to make the trials shorter, and the errors less frequent, repeated or costly, though, and I'm just saying we should do a specific set of them much better than we currently are, and that the StackGPT approach is a substandard alternative to that improvement.
(DIR) Post #AbN4QYdUTXs9GMHp8i by immibis@social.immibis.com
2023-11-01T17:09:01.640161Z
0 likes, 0 repeats
@mhoye Short of adding a whole lot of specific error patterns into the compiler, how would you improve this one? 'a' is indeed an integer and you're passing it somewhere a pointer to a char is expected. Even if 'a' was a char (as I think it is in C++? one of those differences that is rarely relevant) the most likely fix would be: char c='a'; f(&c);You know, because you need a pointer to a char.
(DIR) Post #AbN4QZYD4fF66Gp7Y0 by mhoye@mastodon.social
2023-11-01T17:32:54Z
0 likes, 0 repeats
@immibis Setting aside the deeper design questions - or at least, choosing the more achievable ablative path rather than some sort of "solution", I think the Rust people are on the right track with their much more humane, human-intent-focused errors. This could easily read "Warning - was this meant to be a string? Use double quotes."More generally, I think it's are deep-rooted design failure that Unix insists that "parsed by machines" and "interpreted by human eyes" be the same mechanism.
(DIR) Post #AbN4QaE2Z8heC0OWkS by immibis@social.immibis.com
2023-11-01T17:51:30.657641Z
0 likes, 0 repeats
@mhoye it could read that, but it basically requires the compiler to contain a database of common mistakes.
(DIR) Post #AbN4QazthCz4aQmkLI by mhoye@mastodon.social
2023-11-01T18:03:08Z
0 likes, 0 repeats
@immibis Yes. That complex machines be capable of mitigating or avoiding common sources of human error is an entirely reasonable thing to insist on. In most fields this is the barest minimum standard of responsible design.
(DIR) Post #AbN4QbcBOrboVAhK1A by john@liberdon.com
2023-11-01T18:38:24Z
0 likes, 0 repeats
@mhoye @immibis linters sometimes do something like this.
(DIR) Post #AbNKlk5ofmIC8xevya by tess@mastodon.social
2023-11-01T21:41:32Z
0 likes, 0 repeats
@publius @mhoye if you use your own thing, and you hire or work with people who are not as familiar with the thing as you are, or you just occasionally read the top Stack Overflow questions about your thing, it becomes fairly obvious where the documentation and/or error messages need to be improved."For experts by experts" isn't a way to make software for anyone but yourself.
(DIR) Post #AbODq0SjFRY5YAQFnM by msavoritias@tilde.zone
2023-11-02T07:58:17Z
0 likes, 0 repeats
@publius @mhoye The thing is though that rust has fixed that problem. And it is a language pitched as an alternative to C++ so it very complex. Also python is doing a lot of work to solve and it is another complex language.The thing is the tech community hasn't bothered to write good errors or documentation in the majority of projects. Because if we make it too easy the wrong people will get in. (Actual argument i have heard), or they are so out of touch with people actually using computers that they think the error is obvious (?!). (Usually for gatekeeping and superiority complexes).My point is AI cant fix the reason we don't have good errors or docs. Because the reasons are social. We could have good errors or docs without it.
(DIR) Post #AbOFVyjcA59kJBtl2m by niclas@angrytoday.com
2023-11-02T08:17:25Z
0 likes, 0 repeats
@mhoye Almost all projects/products have two mutually exclusive problems at the same time; "Too Much Information" and "Too Little Information", depending on WHO you ask and WHEN you ask.I think the "real" problem is much more about psychology and personal character. Why would software require less "practice" to reach "proficiency" than for instance becoming a doctor, a lawyer, a musician,...?I would argue that no matter what docs you have, it can't replace experience/practice.
(DIR) Post #AbOFrL5MG1FLi2Foki by niclas@angrytoday.com
2023-11-02T08:21:17Z
0 likes, 0 repeats
@mhoye But maybe I am missing your whole point... If this was only about C/C++ not understanding what are warnings and what are errors, then perhaps you should chose to work with a different language. Most of the weird errors in C are due to legacy code, and you could (I do) set compiler switches to treat all warnings to errors.Number of warnings tend to build up over time and quickly becomes "invisible" due to the noise.
(DIR) Post #AbOxvYIvRppfqeQ4bA by publius@mastodon.sdf.org
2023-11-02T16:35:00Z
0 likes, 0 repeats
@msavoritias @mhoye "Rust has fixed that problem" ― in what way, and for whom?As someone who very occasionally writes computer programs when needed to solve a problem (I wrote a very useful one in Motorola 68000 assembly, that time), I've seen a lot of discussion about Rust, none of which seemed to address that question.Also I've seen suggestions that it's often necessary to call some kind of "foreign function interface", in which case, why not program in the target language instead?
(DIR) Post #AbOzmUFnL1TMaVlC3U by mhoye@mastodon.social
2023-11-02T16:55:37Z
0 likes, 0 repeats
@publius @msavoritias The Foreign Function Interface situation is best understood, I think - thank you, @Gankra ! - by reading this: https://gankra.github.io/blah/c-isnt-a-language/... but more generally Rust gives you a set of guardrails that obviate entire classes of sometimes sec-critical errors, and the error messages they give you during the development process are just generally wildy more helpful and humane than you see in most other languages.
(DIR) Post #AbPO6viVL3ASSFTBYG by hhardy01@mastodon.social
2023-11-01T22:54:13Z
0 likes, 0 repeats
173036@mhoye
(DIR) Post #AbPO6wiBdiVXXYKRhA by hhardy01@mastodon.social
2023-11-02T21:22:41Z
0 likes, 0 repeats
Glad at least one person got that. :) 💻 @mhoye @ParadeGrotesque
(DIR) Post #AbPO6xUkj9M7yB3EOW by ParadeGrotesque@mastodon.sdf.org
2023-11-02T21:28:24Z
0 likes, 0 repeats
@hhardy01 VMS Q-Bus error, amirite? 😉 @mhoye
(DIR) Post #AbPON2kqwJdOupFfPM by hhardy01@mastodon.social
2023-11-02T21:31:14Z
0 likes, 0 repeats
PDP 11/23Address of error Octal CP1 error, R0 contains address of errorhttps://www.manualslib.com/manual/1948289/Digital-Equipment-Pdp-11-23-Plus.html?page=59@ParadeGrotesque @mhoye
(DIR) Post #AbPPGeGbAkAvBTcBxA by hhardy01@mastodon.social
2023-11-02T21:35:23Z
0 likes, 0 repeats
DEC PDP/8e was "my" first computer.@ParadeGrotesque @mhoye
(DIR) Post #AbPPGfXeQpPT8ebKAi by ParadeGrotesque@mastodon.sdf.org
2023-11-02T21:41:21Z
0 likes, 0 repeats
@hhardy01 That was way before my time.@mhoye
(DIR) Post #AbPQNMFqdgnBIm1kDg by hhardy01@mastodon.social
2023-11-02T21:53:46Z
0 likes, 0 repeats
I never was on the 11/23. At Hiram College in 1977 I thought the 11/45 with a 30 MEGABYTE!!! Winchester drive the size of a compact washing machine, was possibly the coolest thing I had ever seen. :)I could see the future, and it was bright.No idea how we got stuck in this crappy timeline. Well some idea but really humans?@ParadeGrotesque @mhoye