@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.
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.
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.
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
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
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â đ
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
Added support for uploading images to to #Timeline
Right now you need to copy the markdown code yourself, but next up would be to lean some JS or use HTMX to make the process more smooth.
@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.
@prologic@twtxt.net the code block is the cause of https://txt.sour.is/twt/zn2kg7q
and the second? i get POST errors when i try to submit the webform.
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
@<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.
One of the things I love about Plan 9 is how the interfaces make this possible: add snapshots to any block storage, at the kernel level, in less than 700 lines of code. http://9p.io/sources/contrib/blstuart/snap/devsnap.c
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
@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.
@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.
@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! :-(
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.
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
?
operator in Go đ No. For so many reasons.
@lyse@lyse.isobeef.org one time i saw that operator when working with ruby on rails and i was so confused by it that i got stuck on the same code involving it for 9 hours straight
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
thinking about l-systems again, maybe a morse beacon #coding #sound #radio #halfbaked
@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.
@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âŠ
@kat@yarn.girlonthemoon.xyz Wrrrrrmmmmm, wrrrrmmm, have fun! I think I played that about 15 years ago last time or so. I never was much of a gamer, always loved to code useless stuff instead. :-D
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.
i missed web design but i did not miss coding
Your code apparently works just fine. Until it @doesnm@doesnm.p.psf.ltât. ;-) The shell languages are weird and having some strange properties that one is just not used to when coming from other languages.
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.
@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.
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.
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. đ
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
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.
Meh, I hit an import cycle while writing tests. Now I have to relocate some code. What do we conclude from that: donât write tests. ;-)
@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.
"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. :-)
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
đ±
@movq@www.uninformativ.de this is why people like me canât code this is boring eyes glazing over kinda stuff lol
@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! ]:->
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
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
@prologic@twtxt.net That also has the downside of fitting right in the write-only code category. :-D
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:
People doing Advent of Code in this language is the craziest thing Iâve seen: https://www.uiua.org/
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!
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.
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. :-)
Added TwtHash hashes to every message on my personal Twtxt HTML renderer. Code is not yet ready for prime-time. Need to work out some kinks still.
did it work? I tried loading the file from /twtxt.txt, /twtAgent.php and /twtAgent2.php
Also reading the code, I see it creates two files, but Iâm not sure which you are using now:
http://darch.dk/twtAgent.log <- 403 Forbidden
and
http://darch.dk/twtAgent.csv <- Not found here
My twtAgent.php
was turned off, so try again now. I have uploaded the code to: https://github.com/sorenpeter/twtAgent