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.

all 2 comments

sorted by: hot top controversial new old
[–] 6 points 2 days ago* (last edited 2 days ago) (1 child)

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(tm)". 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...

  • source
  • hideshow 1 child comment
  • [–] 5 points 2 days ago* (last edited 2 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.

  • source
  • parent
  • 12 comments in c/programming@programming.dev view that post
    [–] 5 points 4 months ago (4 children)

    I fundamentally disagree with the idea that "programming sucks" but there are some neat thoughts and tools in there.

    This bit in particular:

    We don't even have to give up code! The GUI version of a program could merely be one of several human-editable representations. Just as some people love text-based interfaces to their operating systems, some people will continue to enjoy code-based interfaces to software editing. It just doesn't have to be the default—or the only—option anymore.

    I've often thought about the idea that to an extent a programming syntax does not have to be married to a language. We could potentially have editors and syntaxes designed so that each developer can interact with the code in the syntax they're most comfortable with, independent of the language. I don't know how realisable this is, it may be underestimating how tightly coupled syntax and language is.

    I'm not a big fan of graphical programming in general, but there are times when I would like it just for a single function or class, for signal processing or control systems or state machines. I usually think of this in terms of editor plugins or external code gen tools rather than whole environments. Although every code gen tool I've used to date sucks.

  • source
  • hideshow 4 child comments
  • [–] 4 points 4 months ago*

    it may be underestimating how tightly coupled syntax and language is.

    From a CS perspective, syntax is a major part of a programming language. A syntax (or formal language) is defined essentially as an alphabet and the sequences of words constructed from that alphabet that are allowed in the language. Programming languages combine the syntax, which can be defined formally through BNF (for example), with the semantics they enforce. Semantics include things like "types", "modules", or even "lifetimes" potentially.

    Where you can try to decouple it is between the syntax and the semantics. In fact, this is not without precedent. For example, the JVM and the CLR both allow arbitrary syntaxes to be compiled and executed on them, and both have many languages that can be seamlessly integrated together that all compile to the same intermediate representation. Here's a project compiling Rust to the CLR if you want an extreme example, though more practical examples for the CLR would be C#, F#, and Visual Basic (which can all use each other's defined types, methods, etc).

    So basically, what you might be looking for is a common "intermediate language" for languages. We actually have one already though, and that's the C ABI. I think a better ABI could exist though, ideally one which allows more information to be shared across boundaries. Still, that's where I'd start looking more into this, maybe with inspiration from the JVM or CLR.

  • source
  • parent
  • [–] 3 points 4 months ago (1 child)

    Decoupling language from syntax will not work because it's too hard (impossible?) to find a common denominator for all the languages and syntaxes, imo

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 4 months ago

    Certainly for all. I was mostly thinking in terms of e.g. languages that (can) compile to LLVM, since you have the intermediate form already defined. But then languages layer quite a lot on top of LLVM in terms of abstractions and safety constraints that make it probably a bad intermediary even for that subset. Even just for one language, there must be something funuseful that can be done just by viewing the same code with different syntaxes.

  • source
  • parent
  • [–] -2 points 4 months ago

    I don't believe your idea is completely crazy. We have had decompilers for, well, ever. Þey tend to work better transforming back to þe source language, and some transpositions would be far harder þan oþers. Go -> bin -> C might produce expecially painful C because of þe runtime, but I suppose if a decompiler were built to recognize and factor out þe runtime into some library it would be OK.

    Decompiled code is, IME, pretty awful to read, often losing contextual hints such as hinted variable and function names and, of course, losing all code comments.

    Perhaps stepping up and having language translators would be nicer. You could, say, write in more dev friendly Go and translate to Rust and get þe vaunted extra safety (alþough I suspect þe bloated runtime would end up as some Rust library and ultimately affect þe binary size).

    Ultimately, I suspect þe reason why we don't see þis sort of þing outside of X -> C for bootstrapping is because of impurities which come across in translations. Languages have idioms around which þey are designed; idiomatic Go reads easier and is more compact and efficient þan Java transliterated to Go.

  • source
  • parent
  • [–] 2 points 4 months ago*

    Imagine this: instead of reading other people's code and then trying to parse their intentions form [sic] it, you read the documentation to understand their intentions and then you read the code. You no longer have to strain yourself trying to understand what someone wrote for another audience (the machine). They've already explained it for you.

    The best implementation of this I'm aware of is the Entangled bi-directional tangler. A tangler extracts code from your documentation and distributes it across the appropriate source code files. It's [sic] bidirectionality means you can use it to write code embedded in documentation, but then also edit that code normally which it then propagates back into the code blocks in the documentation. This allows programmers to use existing tooling for testing, refactoring, and code formatting without special support for literate programming.

    The best built-in implementation for this that I've seen is Rust's doctests. You write a block of code in your documentation. Then you run cargo test. The code gets compiled and executed as part of your tests, and panics get reported as failures. You can also mark code blocks as should_panic, compile_fail, ignore, etc if needed.

    I'd love to see tools like this in other languages. Write the docs next to the code, but compile the docs as well and make sure they actually work. This is sort of what Entangled seems to do, but ideally more entangled with the build process.

  • source
  • [–] 2 points 4 months ago* (last edited 4 months ago) (4 children)

    But GUIs too; they are frameworks, because we are stuck with hardware patterns from the 80s, made for servers. They are workarounds. Same for the whole Unix stack running a desktop-emulator (X, Wayland).

  • source
  • hideshow 4 child comments
  • [–] -1 points 4 months ago (3 children)

    Expound? What are þe alternatives?

    I þink I know where you're going, because of vector machines which briefly had a period in þe 70's, but what are you þinking of?

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 4 months ago (1 child)

    I too am interested in this. I work at a sort of intersection between traditional backend systems and industrial controls so I see a lot of Java/C# and a lot of Ladder Logic and SFC.

    SFC in particular is as close to visual programming as I've seen be feasible and one can accomplish quite a bit with it.

    I wonder how feasible it would be to develop a visual programming language that worked a bit like stringing together blocks that worked like pure functions where each block was, internally, just a function written in some language. Like some unholy marriage of SFC and Scratch.

    PS: What keyboard are you using for the Thorpe character?

  • source
  • parent
  • hideshow 1 child comment
  • [–] -1 points 4 months ago

    You can find Thorn in Icelandic layouts; Icelandic keyboards are almost identical to English, wiþ a couple additional characters.

    Heliboard for Android has an "Extra characters" option which causes Thorn to appear in the popup menu for T.

    On Linux, I use XCompose; on Phosh I use Squeekboard and a custom layout.

  • source
  • parent
  • [–] 1 point 4 months ago* (last edited 4 months ago)

    This will be a bit of a writeup, so i'll make it a separate post soon. Mostly about, how the triangle higher clock speeds <-> higher integration and centralization <-> more powar for more waste is a dependency cycle to the disadvantage of the consumer and some ideas and new aproaches to doing things with the goal to get out of it. And also, how our general computing is a stack of historical baggage ill-suited for desktop use, down to the hardware (like, clock-cycles: great for number crunching, bad for desktop metaphor) and we work around it with a increasingly huge and brittle stack of software since around the 80s.

    The conclusion is basically, that we could get away with modular MHz computing (that could be done in widely available node sizes and fabs) without detrimental effects to productive computing use (but maybe 3D gaming), if built for desktop. Honestly, i get the feeling that it's high time that we get computing out of it's infancy (playing around phase) and to a reliable tool and engineering discipline.

  • source
  • parent
  • [–] 1 point 4 months ago

    This also reminds me of the spatial computing project DynamicLand

  • source