Programming sucks. Code sucks. It’s hard to read, hard to test, and hard to maintain. Only a handful of people can understand any particular software project. These are major problems. I’m here to explain how we can fix them.

We& liked the ideas posed in this article. Literate programming has intrigued us for some time, and those of us who like Windows (in a retrocomputing sense lol) are also quite fond of Visual Basic (at least pre-.NET), which is at least part way towards a visual programming environment.

  • TootSweet@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    5 days ago

    Lost me at:

    Programming sucks.

    Won me back over a bit at:

    There are so many conflicting software stacks … and annoying libraries. The work of the average software developer has been reduced to gluing libraries together rather than developing interesting code.

    and:

    We don’t have to give up automation if we give up LLMs.

    A “culture of automation” is a hella-good thing. But LLMs aren’t that.

    But lost me again somewhat at:

    The urge to automate the process of writing code has shown us we need to abstract the need to write code at all. We need another layer of abstraction that allows us to think about software even to the ways humans—not computers—naturally think.

    We need less layers of abstraction, not more. The Java ecosystem is just rife with abstraction layers on top of abstraction layers to “fix” what’s underneath. (Web programming in raw Java was hard, so they made an abstraction layer called “Servlets” which has its warts but works, but using Servlets was hard, so they made Spring, which sucks more and now in order to make it act the way you want it to act, you have to understand both Spring and Servlets, which sucks, so they “fixed” it… with another abstraction layer on top called “Spring Boot” which is even worse than Spring and Servlets alone. God help you if you try to upgrade your Java version. It’s like trying to install a new foundation under a 30 story building without damaging the rest of the building. Believe me, they’ll make another “abstraction layer” on top of Spring Boot one day.)

    It really feels like the OP article just almost grazes the point they should have drawn but then veers away in exactly the wrong direction. If the problem is “conflicting software stacks” and “annoying libraries” and “developers [being] reduced to gluing libraries together rather than developing interesting code”, to me that screams “too much abstraction”.

    It’s that classic problem that NPM and Rust have such a reputation for. “I imported something for doing this one tiny little thing and it pulled in 100 dependencies.” It’s abstraction layers on top of abstraction layers all the way down.

    The Go ecosystem tends in the opposite direction. “A little copying is better than a little dependency”.

    Don’t pull in abstraction layers. Eschew them. The fewer the better. Some are quite necessary. (High-level programming languages are abstraction layers, after all.) But where you can, keep them segregated out into tiny little edges of your codebase, not all up in the guts of your codebase. Make it a tiny library for reading/writing this file format here and a tiny library for interacting with VT100-style terminals there. Not something that every third line of code in your whole codebase is tightly coupled with. And every time you do add a dependency, hate yourself just a little more. Your dependencies should keep you up at night. If they do, your own code won’t.

    We tell humans what our program does and then we tell the computer what it is supposed to do. This is a concept known as Literate Programming.

    I’ve heard James Bennett refer to this as “Documentation-Driven Development”. And it’s something I think every developer should know about. I don’t think it’s strictly necessary to always write documentation before code. “Shu Ha Ri” isn’t only applicable to Agile. But you should always be thinking kindof in the “Literate Programming”/“Documentation-Driven Development” way.

    bi-directional tangler

    I’ve been reading and searching for a bit at this point and I have yet to understand the purpose of this. I might do more study. But writing code in Markdown files sounds… weird… and I don’t yet know what benefits they’re purporting to get from doing so.

    But we can go further. Not only can we document our code—we can destroy it.

    Oh god. I’m going to hate this section, aren’t I?

    Code is a concept from a bygone era.

    Yup. I hate it already.

    I believe one important aspect to replacing code is embracing the Graphical User Interface (GUI).

    First, off: 🤮

    Second, when has there ever been a “GUI programming interface” that wasn’t a “toy”? I admit to having nostalgic feelings about pre-.NET Visual Basic, but it was basically “Fischer Price My First Programming™”. And the GUI parts don’t deal with code. Just building GUIs. The code is still… code. In a text editor.

    I’m investing hard in quite the opposite approach. I’ve written two domain-specific languages for doing traditionally GUI-based workflows: codecomic and Glot3. And I’ve written quite passionately on the topic that we need more ways to make GUI-based workflows into code. (Not the other way around.)

    This is a long article. I might come back and edit my comment here later to add more commentary, but I’ve run out of time for the moment. So far, I’m really not on board with much of what the article says.

    Update: Ok. Continuing.

    GUIs allow us to reason about concepts in more complex ways than text-based interfaces

    [Citation needed]

    What do they even mean by this exactly?

    …while also often being more approachable to new users.

    For programming, though? I mean, of course new users are going to feel more empowered right out of the gate if they have a nice GUI for writing music or doing image editing or whatever.

    I mean, one-off little macro kind of automations or BRMS systems are fine to do through a GUI. But none of that is a replacement for more “traditional” ways of programming. What are you going to make a AAA video game or an eCommerce application by dragging if-statement-equivalent diamond icons onto a canvas and drawing little lines between them?

    I’m guessing their answer would be something like “no, if statements are too low-level; you’d be connecting up much higher-level abstractions”. But… how? Each one could have inputs and outputs, sure, and you could feed the inputs of one into the outputs of another, but you can’t just take preexisting abstractions and connect them together and expect them to be talking the same language. You have to have something to glue them together. That is if the abstractions that you need even exist in the first place and you don’t have to invent your own.

    I’m trying hard to think of some way in which something like what the article’s talking about could work for real. I’ll probably give it more thought. I do think that BRMS systems could stand to be used more. For rules that a BSA or a product owner can come up with and formalize sufficiently, it doesn’t make sense to have developers frequently go back to the same part of the codebase to implement yet another multivariate testing scenario or change the rules for deciding which warehouse will ship the product to the customer. Make a way for the BSA or product owner to do that themselves. But replacing development… how is that supposed to work at all?

    Like, I think the author just doesn’t know how coding works. They call themself a “physics and computing student”, so maybe I’m full of shit, but I… I really can’t see how this is different from a non-structural-engineer saying “why don’t we just manufacture the bridge and then transport it here in one piece and set it here across the Golden Gate? Easy peasy. That’s how all bridges should be made.” Obviously, there are a billion and one different reasons why big suspension bridges aren’t made that way and anyone who would say something like that just has a hugely naive surface understanding of what a bridge even is, let alone how one can be designed and built.

    I dunno. I’ll have to go back to bi-directional tangler thing and see if I can better figure out what she’s advocating for.

    I will admit that some of what’s mentioned in this article reminds me of this lecture about Femminism in Programming Language Design. But I think the video I just linked was a lot more grounded.

    I dunno. This is giving me cognitive dissonance, and I probably should delve more into it and try to figure out what they’re really talking about and make sure I’m not just flippantly disregarding something that could work in practice, but I definitely don’t “get it” yet. I might come back to this when I feel like I have a better grasp on it.

    Update: I think I have a better understanding of Literate Programming now. It’s maybe a step beyond what James Bennett called “documentation driven development”. As Timothy Daly said in this video, “If you talk to a programmer about this, they’re going to hear ‘oh, I’m documenting’. Here’s the mindset change. You want to communicate human-to-human. Not ‘oh there’s some documentation in the code’. Programmers can’t get past the code. You need to think about it like you’re writing a book and they’re writing a little section of the book. You’re writing a book to explain… what this thing does. That’s a mindset change.” In a way, DDD and Literate Programming are very very closely related. In another way, they’re a paradigmatic shift away from each other.

    He describes literate programming as you write “a book” explaining to other developers “why you’re doing the thing and what you’re trying to accomplish”. And then you include the code in the book in various sections and have a build process that pulls the code from the book and runs it through a compiler to get working software.

    But!

    There’s still code involved. And the article goes (or attempts to go, but doesn’t really explain at all) a step further. No code involved. And then… throws GUIs in there. How do you “write a book” in a GUI better than you’d go about writing a book with Latex? I hate Microsoft Word, but it’s commonly used…

    • TootSweet@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      edit-2
      4 days ago

      (I hit the comment character limit.)

      …to write books. It is a GUI, I suppose. (In a way that Vim or even Gvim isn’t.) But it is heavily text-based. It’s a “glorified text editor”, not a “graphical editor”.

      So, I guess what the OP article is going for is something like you write a book about the “why” and “what you’re trying to accomplish” and an NLP wizard in your computer turns that “book” into a working program. It’s “common knowledge” (not to say “common knowledge” can’t be wrong) that human language is not “precise” or “unambiguous” enough to make working software in. But I don’t know OP would respond to that. (I think often times, the non-programmers’ problem isn’t so much in being able to communicate precisely as in being able to think in terms of the specific kinds of questions that need answered when you’re doing software engineering. To non-coders, it’s not always clear to them that the button on the page is distinct from the action the button takes when you click it. Once the button exists, the task is done, right? And if the button doesn’t “work” (whatever that means) before the code to handle the click is written, that’s a “bug” (rather than a yet-to-be-implemented feature). This is a big part of the reason why LLMs are so popular. You can make a barely-functional tech-demo/mockup very quickly that chokes the moment you try to use it for anything even slightly interesting, but the news media all picks that up and says “AI just re-coded Photoshop from scratch!!!”. (Note the “early alpha” at the top right there.)

      But then they shift tactics and say “no, not NLP, actually visual editing”. But I don’t see how that solves anything. And I’m not sure whether OP sees how that solves anything either beyond just “visual editing” (whatever that even means) “is easier for non-coders”. I mean… yeah, if you can figure a reasonable way to make it even remotely feasible.

      I linked Glot3, a DSL for doing 3d modelling, earlier. I spent months writing stream-of-consciousness vague thoughts trying to figure out even the basics of the data model that should use, struggling with questions like “what is a vertex really” and “what is a face” before settling on something that I thought was serviceable. After settling and starting to code, I still ran into obstacles – holes in my prior thinking – that necessitated relatively significant refinements to what I’d decided previously. And I’ve been coding for almost 20 years. How is “visual editing” going to make non-coders capable of thinking in the right way to develop software? Let alone describing it sufficiently precisely (even in their native language).

      I dunno. Maybe there’s some seemingly-magical solution. I think it’d have to be more interactive than just “write a book and run it through a thing”. There’d have to be something capable of saying “you’ve been ambiguous here” and forcing the user to fix it before continuing. (Kinda like a compile-time error.) It would have to be capable of teaching non-coders how to think like coders by stubbornly refusing to work any time they didn’t think sufficiently precisely. And even then, it’s likely they’d end up with something that, although it followed their instructions, didn’t solve their problem. (Just like an amateur building a bridge any more ambitious than a little stone walkway over a creek might end up with a bridge that collapsed under the weight of whatever might pass over it.) In which case, they’d probably have to make pretty significant revisions or start over. I’d worry that the result would end up being organically throwing things at the wall until it kinda-sorta works. Basically the same thing a coder who didn’t know what they were doing would end up with if they did the same but with code rather than NLP or graphical editing. A Ball of Mud.

      One thing the article says is “The GUI version of a program could merely be one of several human-editable representations”. Maybe the idea is that the GUI and human-language and code versions of the project all be translateable between each other at will. But if this whole thing didn’t already sound like magic, this makes it sound like straight-up fantasy. Unless they can demonstrate some way to make this work. But if they’d done that, I doubt I’d have to do anywhere near as much research to figure out what it is they even mean.

      I dunno. I still don’t get it. Literate programming is one thing, but even in literate programming, coders have to be involved, and they have to architect the overall system just like they’d have to the non-literate-programming way to do things.

      I kinda want to see what an FAQ would look like. Somewhere where people could push back on the author a bit. Ask the “hardball questions” and see how the author responds. I’m not sure I’ll have a picture in mind of anything like what the author is going for that could possibly actually work without seeing something like that.