Searching yarn

Twts matching #coding
Sort by: Newest, Oldest, Most Relevant
In-reply-to » This document is the result of a series of discussions between Robert "Uncle Bob" Martin and John Ousterhout, held between September 2024 and February 2025. The text addresses three main topics: method length, comments, and Test Driven Development (TDD). https://github.com/johnousterhout/aposd-vs-clean-code/blob/main/README.md This is something to read and reflect on for days.

@andros@twtxt.andros.dev Just before the pandemic, we watched Uncle Bob videos once a week in the lunch break. While almost all of my old teammates agreed with his views, I partially found them to be very odd and even counterproductive.

I didn’t come across John Ousterhout or any of his work before, at least not deliberately. So, this document is my first contact.

I only finished the chapter on comments and I totally agree with John so far. This document just manifests to me how weird Bob’s view is on certain subjects.

I always disagreed with the concept of a maximum method length. Sure, generally, shorter functions are probably better, but it always depends. And I’ve certainly seen super short methods that just made the code flow even worse to follow. While “one function should only do one thing” is a nice general rule, I’m 100% in team John with the shown examples. There are cases, where this doesn’t help readability at all. Not even close.

To me, a function always has to justify its existence. Either by reusing it at least at another place or by coming up with dedicated tests for it. But if it is just called once and there are no tests, I almost always decide against it. Personally, I don’t mind longer methods. We just recently had a discussion about that and I lost against two other workmates who are more in Uncle Bob’s camp, they refactored one medium sized method into three very short ones. Luckily, we agree on most other topics.

Lol, what!? The shorter the method, the longer the variables inside? I first thought I misread or the writeup mixed it up. I’ll always do it the other way around.

I’ve been also bitten badly by outdated comments in the past, but Bob must have worked on really terrible projects to end up with such an attitude to dislike comments. Oh well. No doubt, I’ve come across by several orders of magnitude more useless comments, in my experience (autogenerated) JavaDocs fall in the category more frequently than not. So, I know that there are different types of comments. A comment doesn’t automatically mean that it is good and justified.

But I also partially agree with Bob and John and think that a good name has a proper chance to save a comment. Though, when in doubt, I go John’s route and use a shorter name with a comment rather than use a kilometer long identifier. Writing good comments typically takes some time, sometimes much longer than writing the code. It regularly takes me several minutes. It’s a hard art.

I perhaps should read up on John’s work. He seems to be more reasonable and likeminded. :-) Let me continue to complete this document.

​ Read More

I read a lot about Clean Code, SOLID, TDD, DDD
 now I’m discovering «A Philosophy of Software Design»  but nobody talks about the importance of the project architecture. Do we depend on the framework to do the work for us?
You know I’m a big fan of Clean Architecture, but I feel alone when I share my thoughts on social media or at work.
You have to think outside the framework.

​ Read More

The DOS 3.3 SYS.COM bug hunt!
Last year somebody reported a problem with the DOS 3.3 SYS.COM command when used with NetDrive. They started with a valid FAT12 image, ran SYS.COM to make it bootable, and then they were not able to mount the image using NetDrive again. Running SYS.COM against the image had broken something. Besides copying the operating system’s hidden files to the target drive letter, SYS.COM also copies some boot code into the first sector of the disk. In general it does not make sense 
 ⌘ Read more

​ Read More

1972 UNIX V2 “beta” resurrected from old tapes
There’s a number of backups of old DECtapes from Dennis Ritchie, which he gave to Warren Toomey in 1997. The tapes were eventually uploaded, and through analysis performed by Yufeng Gao, a lot of additional details, code, and software were recovered from them. A few days ago, Gao came back with the results from their analys of two more tapes, and on it, they found something quite special. Getting this recovered version to run was a bit of a 
 ⌘ Read more

​ Read More
In-reply-to » @arne Well, just for my understanding. The command: echo "Lorem ipsum" | openssl enc -aes-256-cbc -pbkdf2 -iter 100000 -out message.enc -pass file:shared_key.bin will take the input string from echo to openssl. It then will

@arne@uplegger.eu With the OpenSSL option -p one can get an output of salt, key and iv. My stupid PHP-code can get everything right from the encrypted data (from OpenSSL) - except the iv! Damn “evpKDF” 😔

​ Read More

ArcaOS 5.1.1 released
It’s been two years since the release of ArcaOS 5.1, which was a hugely important release because it brought UEFI support to this continuation of IBM’s OS/2, ensuring longevity for the project for years to come. Since I don’t think much is known about what, exactly, Arca Noae, and eComStation before it, has access to within the licensing agreement with IBM, it’s difficult to ascertain just how much room they actually have to make changes to the code at the core of the old OS/2. Regardles 
 ⌘ Read more

​ Read More
In-reply-to » Have you ever had to refactor a project that was not documented? Any suggestions?

@andros@twtxt.andros.dev I suggest to not touch it and work on a different project instead. :-D

No, in all seriousness, that’s a tough one. Try to figure out the requirements and write tests to cover them. In my experience, if there is no good documention, tests might also be lacking. It goes without saying that you have to understand the code segments first before you can begin to refactor them. Commit even earlier and more often than usual, this will help you bisecting potentially introduced bugs later on. Basically baby steps.

But it also depends on the amount of refactoring required. Maybe just scrap it entirely and start from scratch. This might not be feasible due to e.g. the overall project size, though.

​ Read More

Redox’ relibc becomes a stable ABI
The Redox project has posted its usual monthly update, and this time, we’ve got a major milestone creeping within reach. Thanks to Anhad Singh for his amazing work on Dynamic Linking! In this southern-hemisphere-Redox-Summer-of-Code project, Anhad has implemented dynamic linking as the default build method for many recipes, and all new porting can use dynamic linking with relatively little effort. This is a huge step forward for Redox, because relibc can now beco 
 ⌘ Read more

​ Read More
In-reply-to » @bender @prologic I can reproduce this locally, too. But it doesn't matter if I follow the feed or not. With JS enabled, hitting "Reply" opens a textarea with @<url>. Submitting this writes @<domain url> instead of @<nick url> in the feed.

hmm interesting work here.. ill give it a look.. @lyse@lyse.isobeef.org do you know if it is even storing the url into the AST object? afair the code to parse tags url should be the same as the mention url.

​ Read More

UnixWare in 2025: still actively developed and maintained
It kind of goes by under the radar, but aside from HP-UX, Solaris, and AIX, there’s another traditional classic UNIX still in active development today: UnixWare (and its sibling, OpenServer). Owned and developed by Xinuos, UnixWare and other related code and IP was acquired by them when the much-hated SCO crashed and burned about 15 years ago or so, and they’ve been maintaining it ever since. About a year ago, Xinuos 
 ⌘ Read more

​ Read More
In-reply-to » So what are some good alternatives to GitHub, that are not based in USA? I like the minimal feel of sourcehut but it seem you have to pay if you want your, not just submit patches to others repos. But they also got IRC bouncer and mailing-lists included. Codeberg also looks appealing being based in Germany.

@sorenpeter@darch.dk It depends on your requirements. If you just want to put your code somewhere for yourself, simply push it over SSH on a server and call it good. That’s what I do with lots of repos. If you want an additional web UI for read access for the public, cgit comes to mind (a mate uses that). Prologic runs Gitea, which offers heaps more functionality like merge requests.

​ Read More
In-reply-to » @arne Ohjemine, TYPO3! O_o Lass mich schreiend davonlaufen!

@lyse@lyse.isobeef.org Es ist immer noch so Ă€hnlich. Da kommen so viele verschiedene Ebenen innerhalb und außerhalb der TYPO3-Umgebung zusammen, dass man sich wundert.

Und die TYPO3-Core-Entwickler nehmen gefĂŒhlt jeden fancy Shice mit, den sie gerade finden. Das reißt dann immer wieder Prozesse ein oder es muss ein gigantischer Aufwand betrieben werden, damit “grundlegende” Funktionen wieder hergestellt werden.
In den Kommentaren ist dann immer nur zu lesen “Tja, Pech. Gibt’s nicht mehr. Sei froh, dass wir ‘ne undokumentierte Schnittstelle dazu im Code versteckt haben. Bau’s dir selbst.”
Und der OpenSource-Gedanke ist bei einigen Erweiterungen (die als Quasi-Standard gelten) auch nur noch zu erahnen. Da mĂŒssen teilweise Abos abgeschlossen werden, damit einige Funktionen genutzt werden können.

Es wird auf jeden Fall nie langweilig.

​ Read More
In-reply-to » Heute fahren wir auffe Arbeit ein großen Update fĂŒr das CMS der zentralen Webseiten. Hoffentlich geht das alles gut. đŸ˜±

@arne@uplegger.eu Ohjemine, TYPO3! O_o Lass mich schreiend davonlaufen!

Mit dieser absoluten Katastrophensoftware vor dem Herrn haben wir mal ein Studienprojekt gemacht. Die hat alle Vorurteile komplett ĂŒbererfĂŒllt. Angefangen von Fehlerseiten, die statt 4xx oder dergleichen immer mit HTTP 200 ausgeliefert wurden oder auch, dass das generierte HTML leider einfach ungĂŒltig war. Über die Implementierung von Löschen durch einen Deleted-Schalter in der Datenbank, das Speichern von Passwörtern im Klartext bis hin zu völlig umstĂ€ndlichen Bedienungskonzepten. Alles hat immer brutal viele Schritte gebraucht. Das Zeilennummernrumgeeier im TYPO-Script erinnerte eher an Basic. Uns kam es auch so vor, als ob man damit nicht ernsthaft was sinnvolles machen könnte.

Zu allem Überfluss hatte irgendwer noch ein ganz hundsmiserables Buch ausgegraben, das als Vorbereitung dienen sollte. Ich kann mich zum GlĂŒck weder an den Titel noch den Autor erinnern, aber ich weiß noch, wie das komplett inkonsistent geschrieben war. Anfangs gabs mehrere Seiten zu Unicode und UTF-8 wurde angepriesen, aber alle Beispiele haben dann auf ISO-8859-1 gesetzt. Gezeigter Beispielcode war hĂ€ufig unterste Schublade. Selten hab ich so merkwĂŒrdige ErklĂ€rungen gelesen: „Wenn Sie die Sicherheitswarnhinweise stören, kommentieren Sie doch bitte im Quelltext die die()-Funktion in $ZEILE aus.“ Oder ein anderer Klassiker: „Ausgeschrieben wĂŒrde der Code wohl folgendes tun
“. War sich der Autor also nicht ganz sicher, ob sein Codeschnipsel vllt. doch in Wahrheit was ganz anderes tut.

Seit diesem gigantischen Trauma (das hat mich wirklich sehr nachhaltig geprÀgt, wie man Dinge nicht machen sollte) hab ich erfolgreich einen Bogen um das TYPO3-Universum gemacht.

Ich kann nur hoffen, dass es zwischenzeitlich ein wenig besser geworden ist. Aber Deinem Kurzbericht zufolge scheint da ja immer noch der Wurm drin zu sein. Mein Beileid! :-(

​ Read More
In-reply-to » I want to propose my own counter-proposal to the discussion that's ongoing with Go and error handling.

If people just wrote error free code to begin with, there would be no need for error handling! :-P

No, honestly, I don’t think that there is anything wrong with the current approach. I don’t see any wins of any of the proposals I’ve come across.

​ Read More

For many years I have found Flask to be too basic a tool for modern development. But since I create APIs using Flask with Pydantic to validate the input data, some middlewares for parsing and Blueprint to separate the code into modules
 I must admit that I am super comfortable, fast and easy to test.
#flask #python #pydantic

​ Read More
In-reply-to » I share a simple API template with Clean Architecture using #flask and #fastapi https://git.andros.dev/andros/api-template-with-clean-architecture #cleancode #cleanarchitecture

What is clean architecture? That’s a good question.

You think of a pattern for ordering code with good decisions isolating technologies (you can change the web framework or database without break the business logic), easy to test (you only test interfaces and use cases), sharing code between frameworks (entities and use cases), scalability, modulations and standardizing names. Clean architecture is not perfect, it has a learning curve and some abstraction in each technology. You can even find rejection with yours colleagues.
I have a good article on this topic.
https://programadorwebvalencia.com/implementando-arquitectura-limpia-en-python/
#python

​ Read More
In-reply-to » this is epic https://lmnt.me/blog/how-to-make-a-damn-website.html

@kat@yarn.girlonthemoon.xyz I approve! That’s how I learned HTML (version 4 at the time and XHTML shortly after) and making websites, too. Some of them are still made like this to this day. Hand-written HTML. Hardly any <div> and class nonsense. I can’t remember with which editor I started out with, but I upgraded to Webweaver (later renamed to Webcraft) quickly. Yeah, this were the times when there was just a single computer for the whole family.

Free hosting on Arcor, Freenet and I don’t know anymore how they were all called. Like this author, I uploaded everything via FTP. Oh dear, when was the last time I used that? And I had registered plenty of free .de.vu domains.

Being on Windows at the time, everything was ISO-8859-1 for me. No UTF-8, I don’t think I’ve heard about it back then.

Later, I wrote my own CMSes in PHP. Man, were they bad in retrospect. :-D Of course, MySQL databases were used as backends. I still exactly know the moment I read the first time about SQL injections. I tried it on my own CMS login and was shocked when I could just break in. The very next thing I did was to lock down everything with an .htaccess until I actually fixed my broken PHP code. Hahaha, good memories.

I swear by Atom or RSS feeds. Many of my sites offer them. I daily consume feeds, they’re just great.

​ Read More
In-reply-to » Another infrastructure apocalypse day at work. Linux and Windows users were unable to reach M$ services. No Outlook, no Teams, no intranet (Sharepoint), no Azure, etc. Mac users were lucky, though. Took whoever the whole day to resolve that. Shortly before I called it quits, it worked again. I haven't read any e-mail today, used Teams mostly on the company phone, but it's the plague.

@movq@www.uninformativ.de Yes, exactly that. It’s awful! And it’s getting worse from my perspective. Nobody in charge is ever gonna learn anything. I figure we just fully deserve this M$ crap, every single bit. :-(

Luckily, the most important development platform still worked for me, so I could actually do something, review code, pull and push, etc. But the calls with the screenshares were nightmares. Can’t see shit on such a tiny display with today’s extreme monitor sizes people use. Looking at logs, hahahahahahaaa


​ Read More

I’m refactoring (mangling four lines of of code with assignments into one function call) and man, do I love vim macros! Such a bloody amazing invention. Saves me heaps of manual labor.

​ Read More
In-reply-to » @kat To improve you shell programming skills, I highly recommend to check out shellcheck: https://github.com/koalaman/shellcheck It points out common errors and gives some suggestions on how to improve the code. Some details in shell scripting are very tricky to get right at first. Even after decades of shell programming, I run into "corner cases" every now and then.

PSA: Yarnd operators might want to define code { white-space: pre } in their CSS themes to render things as they’re supposed to look like.

​ Read More
In-reply-to » been playing with making fun scripts using charm CLI's gum library :P

@kat@yarn.girlonthemoon.xyz To improve you shell programming skills, I highly recommend to check out shellcheck: https://github.com/koalaman/shellcheck It points out common errors and gives some suggestions on how to improve the code. Some details in shell scripting are very tricky to get right at first. Even after decades of shell programming, I run into “corner cases” every now and then.

E.g. in getlyr’s line 7 it warns:

echo -e $(gum style --italic --foreground "#f4b8e4" "'$artist', '$song'")
        ^-- SC2046: Quote this to prevent word splitting.

For more information:
  https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt...

Most likely not all that problematic in this application, but it’s good to know about this underlying concept. Word splitting is basically splitting tokens on whitespace, this can lead to interesting consequences as illustrated by this little code:

$ echo $(echo "Hello   World")
Hello World

$ echo "$(echo "Hello   World")" 
Hello   World

In the first case the shells sees two whitespace-separated tokens or arguments for the echo command. This basically becomes echo Hello World. So, echo joins them by a single space. In the second one it sees one argument for the echo command, so echo simply echos this single argument that contains three spaces.

​ Read More

The editor can launch a new shell now:

https://movq.de/v/6ec68b50dd/los86-edit-shell.mp4

Trivial to implement but super useful. It allows for simple but meaningful dev cycles: Edit source code, run/test it, back to editor. That’s what I do in the video.

(The Brainfuck program is silly, but I got nothing else at the moment.)

The I/O cache is also getting better. All that back and forth doesn’t hit the disk at all, once cached.

This whole thing is much more fun and interesting when you run it from a real floppy disk. It’s a 5.25” floppy in the video (so it’s actually floppy 😅). Disk seek times can be catastrophic and you don’t notice any of this on modern disks.

​ Read More
In-reply-to » I'm still making progress with the Emacs client. I'm proud to say that the code that is responsible for reading the feeds is almost finished, including: Twt Hash Extension, Twt Subject Extension, Multiline Extension and Metadata Extension. I'm fine-tuning some tests and will soon do the first buffer that displays the twts.

Thanks 😀! @aelaraji@aelaraji.com I am working on a fork now because the new version will break the current code. Therefore, I will upgrade the current repository (https://codeberg.org/deadblackclover/twtxt-el). The original author is helping me with reviews. I am sorry for my long development, I am working in my free time and it is scarce. I will report back to you all. 😋

​ Read More

StackExchange/dnscontrol: Infrastructure as code for DNS! 👈👈 Now this looks might interesting
 I might look into this for managing my own domains and DNS. I note that my current registrar isn’t on the list of supported registrars, oh well, I don’t like OnlyDomainsℱ much anyway. Anyone familiar with these regisrars?

  • AWS Route 53
  • CSC Global
  • CentralNic Reseller (formerly RRPProxy)
  • DNSOVERHTTPS
  • Dzynadot
  • easyname
  • Gandi
  • HEXONET
  • hosting.de
  • Internet.bs
  • INWX
  • Namecheap
  • Name.com
  • OpenSRS
  • OVH
  • Realtime Register

​ Read More

I’m still making progress with the Emacs client. I’m proud to say that the code that is responsible for reading the feeds is almost finished, including: Twt Hash Extension, Twt Subject Extension, Multiline Extension and Metadata Extension. I’m fine-tuning some tests and will soon do the first buffer that displays the twts.

​ Read More
In-reply-to » just spent like half an hour finding a terminal based color picker that would just. turn the cursor into a cross hair and let me pick from the screen. in linux fashion this was somehow difficult

@kat@yarn.girlonthemoon.xyz i wound up with xcolor AND pastel at the same time, because xcolor does exactly what i want while pastel and its picker subcommand does the same thing, relying on xcolor, but brings up a nice graphic of the picked color and related colors, plus more than just the hex code. neat.

​ Read More
In-reply-to » Any idea What's this "twtxtfeevalidator/0.0.1" UA about? I thought I could ask before throwing a 1000GB file at it đŸȘ€ could it be the same 'xt' thing @lyse was talking about the other day?

I cobbled that together yesterday, @aelaraji@aelaraji.com. Since I was too lazy to write some tests, I simply hit your feed as I knew it contains two invalid lines right now. Sorry mate! :-( Next thing is to actually write some proper tests, improve the messages, etc.

Here’s the code: https://git.mills.io/yarnsocial/validator

Looking forward to that, @prologic@twtxt.net. :-)

​ Read More

How in da fuq do you actually make these fucking useless AI bots go way?

proxy-1:~# jq '. | select(.request.remote_ip=="4.227.36.76")' /var/log/caddy/access/mills.io.log | jq -s '. | last' | caddy-log-formatter -
4.227.36.76 - [2025-01-05 04:05:43.971 +0000] "GET /external?aff-QNAXWV=&f=mediaonly&f=noreplies&nick=g1n&uri=https%3A%2F%2Fmy-hero-ultra-impact-codes.linegames.org HTTP/2.0" 0 0
proxy-1:~# date
Sun Jan  5 04:05:49 UTC 2025

đŸ˜±

​ Read More
In-reply-to » @movq How about now? 🙏

@movq@www.uninformativ.de That’s so damn cool mate! I went through the code, but this lowlevel stuff is really not my favorite cup of tea. Having said that, it was actually really nice to see the abstractions and APIs work together and how things are getting indeed very readable in the userland programs. That’s easy to track in this extremely tiny OS implementation. Excellent work, keep on hacking!

Now, you just have to quickly add a network stack and then can write a twtxt client for it! ]:->

​ Read More

i’ve transitioned text editors from nano (yeah i know) to micro and god micro is just so much better i did not know there was a CLI text editor i could use with sensible keyboard shortcuts that did not leave me feeling like i’m typing nuclear codes to do simple tasks like saving and editing

​ Read More

Okay, this is pretty cool. My 8086 toy OS running on my old Pentium from an actual floppy disk. 😍 I just love that sound and the feeling of using floppies. This brings back so many memories from my early DOS days.

The cp-unopt program copies a file and intentionally uses small unaligned reads/writes (hopefully triggers more bugs).

The I/O cache works “okay-ish”, I guess. When sha1 runs, it has to do a few reads for the first file and basically none for the second one. Both could have been served entirely from the cache, theoretically. (But even just having an I/O cache in the first place speeds up things dramatically.)

Notice how there’s an EA file. That’s a left-over from OS/2, because I copied some files to the floppy using OS/2. In other words, my FAT12 implementation survives OS/2 writing to it. đŸ„ł (But I guess it should show up as EA DATA.SF. My current code starts at the left and stops at the first space.)

https://movq.de/v/d4d50d3c74/los86-on-p133-from-floppy-small2.mp4

​ Read More

I’ve been making a little toy operating system for the 8086 in the last few days. Now that was a lot of fun!

I don’t plan on making that code public. This is purely a learning project for myself. I think going for real-mode 8086 + BIOS is a good idea as a first step. I am well aware that this isn’t going anywhere – but now I’ve gained some experience and learned a ton of stuff, so maybe 32 bit or even 64 bit mode might be doable in the future? We’ll see.

It provides a syscall interface, can launch processes, read/write files (in a very simple filesystem).

Here’s a video where I run it natively on my old Dell Inspiron 6400 laptop (and Warp 3 later in the video, because why not):

https://movq.de/v/893daaa548/los86-p133-warp3.mp4

(Sorry for the skewed video. It’s a glossy display and super hard to film this.)

It starts with the laptop’s boot menu and then boots into the kernel and launches a shell as PID 1. From there, I can launch other processes (anything I enter is a new process, except for the exit at the end) and they return the shell afterwards.

And a screenshot running in QEMU:

Image

​ Read More
In-reply-to » Yeah, @eapl.me, I kinda like file extensions in some situations. What do you think of twtxt.exe, @bender? ]:->

haha, that’s gold xD.

#randomMemory I remember when I was starting to code, like 30 years ago, not understanding why my Basic file didn’t run when I renamed it to .exe

And nowadays, I’ve seen a few Go apps in a single executable, so twtxt.exe could be a thing, he!

​ Read More
In-reply-to » Finally, the message rendering in my tt Go rewrite produces some colors. There is definitely a lot more tweaking necessary. But this is a first step in the right direction.

Thank you @bender@twtxt.net and @movq@www.uninformativ.de!

I partially fixed the code block rendering. With some terrible hacks, though. :-( I see that empty lines in code block still need some more work. There are also some other cases around line continuation where the result looks ugly. I have to refactor some parts to make this go more smoothly and do this properly. No way around that.

Image

Turns out, my current message text parser does not even parse plain links. That’s next on the agenda.

Oh, I also noticed that this thing crashes when there is not enough space to actually draw stuff. No shortage of work. Anyway, time is up, good night. :-)

​ Read More