You are viewing archived messages.
Go here to search the history.

Medet Ahmetson 2025-05-21 16:47:30

📝 Idea: Make a Recipe from the code comments. Code recipes is a view mode… | Medet Atabayev

Idea: Make a Recipe from the code comments.

Code recipes is a view mode in your editor to read it.

In code recipe mode, instead seeing a programming language grammar words, we see the comment line for each programming language command. For example, can you understand what does following piece of code do?

But, in code editor mode, I would read the code piece as the bullet points: - Convert source code into ontological json data. Ontological json data is called 'contents'. // ...this.identifyContent(... - content is created, lets create its restful api // ...PageLevel.rest... - Re-identify page-rest if extensions ask for. // ...extension.afterPageRestCreation(.. - to make CSS Selector 'module > .page-content', so lets find module in reflect object tree // ...rest.get(..moduleURL...)... - make the branch as a sub-branch of the reflect. // pageRest.setRootNode(moduleNode) - keep alive the page rest object, so that reflect rest could refer to it. // _pageRests[moduleURL] = pageRest

In above list, instead the code, we see the comment lines. And instead comments we see highlighted pieces in the code line. The comment with the highlighted code pieces should be in grey, although I didn't know how to change font colour in LinkedIn. And that code is interactive, clicking on the highlighted codes will expand it or redirect the user to the whole line.

This mode is now possible with the LLMs. I as a developer write the comments on the complex parts, or in necessary parts. Often intentionally not putting comments on the code lines that I think are self explanatory, there comments are actually distracting and irritating. But now, LLMs could do really well about describing the command lines. You could highlight for the AI the parts, that are the main focus of the code piece. And for the readers as well. :)

I also think, maybe add some emojis or smileys next to the recipe code views, so its easier and enjoyable to do the most hated thing: to read someone else's code.

The code recipe isn't good when debugging code errors, when you need to optimize or write the code piece itself. But if you want to understand the code at the architectural, business flow level through the code, for refactoring or for modification, then code recipe is another nice-to-use way. :) I would be glad to see it.

Angus Mitchell 2025-05-21 18:05:52

This is cool. I used to be a diehard Refactoring/Martin Fowler fan, but then a friend pointed out that what qualifies as "well-written code" depends on the audience/situation. They broke it down into a few situations:

  • Debugging - Temp variables and print statements are good here. Sometimes, long functions without too many subroutines can be easier to reason about.
  • Refactoring - Temp variables are bad since they created dependencies throughout code. Long functions generally bad. DRY.
  • Writing code - You're pushing paint around on the canvas and you probably should be copy/pasting and duplicating things while you figure out what's going to work.
  • Reading code - Comments, clear variable names, etc.
  • Production runtime - Performance > readability

It will be cool if AI will adapt the code to whatever context we're in

Konrad Hinsen 2025-05-22 11:19:05

📝 Lu Wilson on Art of Creative Coding by The Orthogonal Bet

In this episode of The Orthogonal Bet, host Samuel Arbesman speaks with Lu Wilson, a programmer and creative coder who also works as a software engineer at tldraw, a Lux Capital portfolio company. Lu’s creative work is broad, strange, and delightful in all the best ways—perhaps best exemplified by the Todepond videos, a mindbending series that reimagines computing through playful, experimental lenses.Together, Samuel and Lu explore the world of Todepond, the ethos of creative coding, and Lu’s unconventional path through education. Their conversation spans topics like cellular automata, the programming language Logo, the history of computing, and the evolving role of artificial intelligence. They also dive into Lu’s work at tldraw, collaborative software, and the importance of cultivating community in tech.

Paul Tarvydas 2025-05-22 11:50:21

This might be of interest to anyone with a hardware bent. One of the comments below it is: "... The animated explanation of the tv lines and timing are the best i have ever seen. ..."

ESP32 Composite Video

🕰️ 2025-04-29 12:08:02

...

Beni Cherniavsky-Paskin 2025-05-24 22:00:14

I've read the central paper on Algot: "Bridging the Syntax-Semantics Gap of Programming". Salient points [my opinions bracketed]:

It's PBDemonstration, where user conveys intent by actions, and not PBExample where intent is inferred from before/after or input/output pairs. They attack the gap during program construction , admit it's weak for later comprehension.

State is graph with nodes containing numbers (to be extended in future). Graph for pedagogical reasons — covers structures they want to teach + visualization is universally understood .

[Target audience not explicitly stated; seems to be for beginning CS students? I'm personally more interested in PBD for end-user programming; but then I wouldn't teach them linked lists or binary search trees...]

It's showing concrete data when directly-manipulating top-level state. 🍰

But when demonstrating a procedure ("helper"), in Input stage you denote parameters (+ pattern matching) by adding "abstract" nodes. IIUC new nodes created during your hepler are also abstract? Unlike concrete state nodes, you won't see abstracts' value at Action stage 🙈, only their label letter. (Also, not all nodes will exist in all executions ⌥)

[This is serious unsolved gap! Inherent question of how PBD can be parametrized — you don't see actual semantics, but some ≈symbolic approximation.]

They aspire to improve this in future by letting you pick example inputs and see actual values [they cite arxiv.org/abs/1902.00549 which is good read and wonderfully-motivated title]

They believe nested conditionals and loops to be confusing for beginners.

=> No loops, only recursion.

=> Boolean checks can only be made in Query stage before procedure starts (pro: order doesn't matter), and then Action stage code is flat , with optional predication — each step may be conditioned on each query being true/false/don't care. [Heresy #1 🤔 Personally I'm skeptical flatness scales well to complex codebases?]

Con: if you need checks and/or pattern matching depending on prior checks, you'll want to extract a 2nd procedure. Each procedure has Input+Query stages, so not really as flat as it sounds! (technically they reduce the need by allowing empty-set pattern matches [?] but they admit guard-before-access is mentally clearer.)

[Most interesting heresy 👏😮 #2, emphasis mine:]

4.1 State Should Be Relatable, Visible and Editable

... Conventional imperative languages such as C, Java, and C#, also separate state into local variables on the stack and objects living on the heap. This separation can be confusing and lead to misunderstandings.

... Even systems designed for beginners like Scratch tend to scatter state by maintaining variables, position for individual objects, or drawings on screen. > We believe that a scattered state leads to additional cognitive overhead and instead intend to maintain a single central state. Algot avoids variables as separate entities from other state.

  • Instead of local variables, one is supposed to insert a new (disconnected) node to the global graph, mutate/grow connections, and remove it from the graph when done. (you do bind a local name to it, but that's immutable — the state lives in node's content and connections, and cosmetic — you don't really reference by name, you click it)
  • They didn't 100% banish scattered stack state: Procedure parameters get bound (by ref.) to concrete nodes given as arguments — so there are hidden activation records somewhere.
  • The recursive examples given do materialize in global state parts of what'd usually be implicit in stack 👍. E.g. fibonacci works with explicit linked list of prior results. Is this purely stylistic? No, it's encouraged by IIUC not having return values! [interesting heresy #3! 😮] Procedures can "return" results by mutating the global state graph (possibly via output parameter pointing there). Even builtins like "add" take assembly-like src1, src2, dest.

[All in all, my first instinct was to protest, but the goals are interesting and the choices nicely provocative 🤔]