Programming thread

i personally don't like suckless because i think compile-time configuration instead of runtime is fucking gay and retarded and stupid
Indeed parsing a configuration file, or even running a scripting language like Lua is unnoticably fast, under 1 ms.

Configuration in C considered harmful, it shouldn't be possible to cause a segmentation fault by changing the configuration. It's not just elitist gatekeeping at that point, it's plain retardation.
Imagine shipping a product to a customer, while knowing that if they use the product as intended there is a 50% change of them destroying it.
 
I have never seen a single project that says: "these are the tradeoffs we made; if this is not what you need, the following are the alternatives".
Autists seem allergic to admitting that something is not the GOAT™©. Great example: Rust.
we need a few more "we did xyz and foo because it has these advantages but didn't do abc because it really doesn't work well with foo and you can patch in foobar if you want foo to go faster but don't need to do sneed with it" in this world instead of "xyz and foo are the best ever"
i'm not as pessimistic as you however, i still think there are a few relative golden hammers out there that should be strived for (and retarded bullshit that should be avoided but people still do it constantly)
Indeed parsing a configuration file, or even running a scripting language like Lua is unnoticably fast, under 1 ms.
"but using a whole open read close call to read it is le bad and then we would need to write more heccin lines of coooode aaaa" - sperg
Configuration in C considered harmful, it shouldn't be possible to cause a segmentation fault by changing the configuration. It's not just elitist gatekeeping at that point, it's plain retardation.
Imagine shipping a product to a customer, while knowing that if they use the product as intended there is a 50% change of them destroying it.
in their defense you can fuck up a text configuration file bad enough that a well-written program will say "dude what the fuck are you doing"
at least such an application can sensibly report the error though
also i assume most suckless configuration is just changing variables in the header so i don't think it's THAT easy to segfault
the main retardation is having to compile the application to configure it because a little config parser is "le wasteful"
 
  • Like
Reactions: ADHD Mate
at least such an application can sensibly report the error though
Sadly, I have spent significantly more time debugging configs because some shitware refused to report errors properly, than recompiling with what I needed.
The compiler yelling at you if you are being really dumb helps slightly; but its more of a pattern of configuration subsystems being shit.

Common faults from the top of my head:
  • not telling you where the log is on crash
  • not applying any configs if one option is faulty
  • silently ignoring errors
  • the above two combined(!)
  • not reporting syntax errors
  • not telling you what the constraints are
  • no indication of 2 options being mutually exclusive
Surely you could name even more.
 
Surely you could name even more.
how about it having a very specific location it looks for configs but the config doesn't exist by default and there is so little documentation that you don't know where to put it
i've had the misfortune of dealing with a program that basically almost does this
 
how about it having a very specific location it looks for configs but the config doesn't exist by default and there is so little documentation that you don't know where to put it
i've had the misfortune of dealing with a program that basically almost does this
This, with its twin brother: creating the config files upon start up, right at your fucking home directory.
 
This, with its twin brother: creating the config files upon start up, right at your fucking home directory.
oh yes i have long given up on the war on 19 page long home directory listing
but what about those amazing programs that shit out a log file in the current directory no matter where you are?
 
  • Like
Reactions: Polyarmory
Configuration files might be the worse place NIH can be applied. Always use some standard format, I don't want to learn a new syntax for every program I use. If I need to figure out what kind of string escaping your silly custom configuration file format supports you've messed up. When you use a good one, the error reporting also usually comes for free, along with syntax highlighting.
 
oh yes i have long given up on the war on 19 page long home directory listing
but what about those amazing programs that shit out a log file in the current directory no matter where you are?
You know, it should be impossible for a file to look smug, but the second that little shit gets into the version control, I swear its doing it.
 
i assume most suckless configuration is just changing variables in the header so i don't think it's THAT easy to segfault
the main retardation is having to compile the application to configure it because a little config parser is "le wasteful"
https://git.suckless.org/dwm/file/config.def.h.html -- config.h just defines a few arrays and structs. No string mangling at all.

It's not that config parsing is wasteful or anything, but the purpose of a config file is for people to change the config; even recompiling the software to include a scrollback buffer hasn't caused me to change my config. I haven't changed my configuration in, what, ten years?

I get that other people have other preferences, but I tell you, on constrained platforms like, say, the RK322x TV-box I love to hack around on, on devices with slow storage, et cetera, DWM versus competitors is quite noticably different. (Could probably substitute in one of DWM's "influences" just fine.

Imagine shipping a product to a customer, while knowing that if they use the product as intended there is a 50% change of them destroying it.
C-language config also works as a barrier-to-entry. Jeets and Low-IQs get filtered very early.

Indeed parsing a configuration file, or even running a scripting language like Lua is unnoticably fast, under 1 ms.
Some of the platforms where I run DWM take several seconds to execute something "trivial" like "yt-dlp --help". This is due to the whole tree of python dependencies the interpreter has to walk through. When running Linux off of a USB, too, you can run into this. Slow storage does weird things.

"these are the tradeoffs we made; if this is not what you need, the following are the alternatives".
2025-06-06-061002_696x400_scrot.webp

Not quite as blunt and to the point as you suggest, but you've got a great point, and I'll improve my own Suckless-style project with this.

You guys would like my project even less. It interfaces with, say, specific USB devices, and my project is designed to work such that there is one executable per device-config combination; in other words, the user chooses device and config by executing a different executable. Works great, though, and transfering state across the different comboes works brilliantly.
 
Last edited:
If the config is something that is unlikely to change after the initial setting then compile time configuration isn't terrible. Why read the same value from a config file every single time? They could be a little more consistent though, some times it is "#defines", others have proper variables, and sometimes values are in an array for some reason? They also seem to be fond of "strlcpy", including their own implementation just in case you don't have one. Sometimes there are instructions to manually modify the makefile if you have your own strlcpy, sometimes there aren't.

I do like that they don't use GitHub though, it seems to be getting slower and slower every day and it's nice to be able to actually browse the code.

I've been looking for a simple, lightweight alternative to GitHub for a while. I couldn't find anything that wasn't a direct GitHub clone so I decided that I would just do it myself. I've got a basic framework going, and now I have just found two projects that I could have used instead!
- https://codemadness.org/git/stagit/
- https://git.zx2c4.com/cgit/

The "philosophy" section is good for a laugh (I like the mention of "inconsistent software"). "programming socks" were worn while writing this.

Philosophy
We are the home of quality software such as dwm, dmenu, st and plenty of other tools, with a focus on simplicity, clarity and frugality. Our philosophy is about keeping things simple, minimal and usable. We believe this should become the mainstream philosophy in the IT sector. Unfortunately, the tendency for complex, error-prone and slow software seems to be prevalent in the present-day software industry. We intend to prove the opposite with our software projects.

Our project focuses on advanced and experienced computer users. In contrast with the usual proprietary software world or many mainstream open source projects that focus more on average and non-technical end users, we think that experienced users are mostly ignored. This is particularly true for user interfaces, such as graphical environments on desktop computers, on mobile devices, and in so-called Web applications. We believe that the market of experienced users is growing continuously, with each user looking for more appropriate solutions for his/her work style.

Designing simple and elegant software is far more difficult than letting ad-hoc or over-ambitious features obscure the code over time. However one has to pay this price to achieve reliability and maintainability. Furthermore, minimalism results in reasonable and attainable goals. We strive to maintain minimalism and clarity to drive development to completion.

Manifest
Many (open source) hackers are proud if they achieve large amounts of code, because they believe the more lines of code they've written, the more progress they have made. The more progress they have made, the more skilled they are. This is simply a delusion.

Most hackers actually don't care much about code quality. Thus, if they get something working which seems to solve a problem, they stick with it. If this kind of software development is applied to the same source code throughout its entire life-cycle, we're left with large amounts of code, a totally screwed code structure, and a flawed system design. This is because of a lack of conceptual clarity and integrity in the development process.

Code complexity is the mother of bloated, hard to use, and totally inconsistent software. With complex code, problems are solved in suboptimal ways, valuable resources are endlessly tied up, performance slows to a halt, and vulnerabilities become a commonplace. The only solution is to scrap the entire project and rewrite it from scratch.

The bad news: quality rewrites rarely happen, because hackers are proud of large amounts of code. They think they understand the complexity in the code, thus there's no need to rewrite it. They think of themselves as masterminds, understanding what others can never hope to grasp. To these types, complex software is the ideal.

Ingenious ideas are simple. Ingenious software is simple. Simplicity is the heart of the Unix philosophy. The more code lines you have removed, the more progress you have made. As the number of lines of code in your software shrinks, the more skilled you have become and the less your software sucks.
 
  • Like
Reactions: Polyarmory
It's not that config parsing is wasteful or anything, but the purpose of a config file is for people to change the config; even recompiling the software to include a scrollback buffer hasn't caused me to change my config. I haven't changed my configuration in, what, ten years?
Including a config file in the executable is awesome. Some programs embed a zip archive in the executable for auxiliary files, for example the LÖVE game engine.
DWM versus competitors is quite noticably different.
The suckless devs are really smart people and know how to make solid, fast software but take their autistic purism too far IMO. I use st because it's the best X11 terminal (for me) that I know of. Not because of their configuration or extension (patches) method, but despite.
C-language config also works as a barrier-to-entry. Jeets and Low-IQs get filtered very early.
And yes that result is a good thing, however it might also be a sign that the solution is overly complex or unfriendly, which I believe it is.
I do like that they don't use GitHub though, it seems to be getting slower and slower every day and it's nice to be able to actually browse the code.
Definitely, more people should host their own git. It's really easy as you can just use any static web server.
 
how about it having a very specific location it looks for configs but the config doesn't exist by default and there is so little documentation that you don't know where to put it
i've had the misfortune of dealing with a program that basically almost does this
Luckily, on Linux at least, you have options. "strings" on the binary, grep for '/' to reduce the output and look for likely candidates. If that doesn't work, there's always "strace" and look for the stat and open calls to see what the hell it's doing.
 
I get that other people have other preferences, but I tell you, on constrained platforms like, say, the RK322x TV-box I love to hack around on, on devices with slow storage, et cetera, DWM versus competitors is quite noticably different. (Could probably substitute in one of DWM's "influences" just fine.
given how often you restart a window manager it probably doesn't really matter whether the config is baked into the application or not
Some of the platforms where I run DWM take several seconds to execute something "trivial" like "yt-dlp --help". This is due to the whole tree of python dependencies the interpreter has to walk through. When running Linux off of a USB, too, you can run into this. Slow storage does weird things.
that is unfortunately a thing but there is also the magic of linux io caching and that it's not too hard to get your hands on a computer that isn't crippled, because even most low-end bullshit these days tend to come with ssds
if you have a really great reason to be using stone tablet based storage, i guess suckless autism might be justified
The "philosophy" section is good for a laugh (I like the mention of "inconsistent software"). "programming socks" were worn while writing this.
they have a golden hammer and it makes no sense (experts crave internally simple software? what? explain emacs)
And yes that result is a good thing, however it might also be a sign that the solution is overly complex or unfriendly, which I believe it is.
my main problem is that i don't want to maintain a whole extra step to use a package (since i am used to the typical workflow, which is to obtain THE binary from my package manager of choice and then use it)
With every update it gets more and more jeetslop. It's retarded that github, proprietary shitware took off as "the git host" to begin with
once upon a time it was sourceforge
Luckily, on Linux at least, you have options. "strings" on the binary, grep for '/' to reduce the output and look for likely candidates. If that doesn't work, there's always "strace" and look for the stat and open calls to see what the hell it's doing.
also rtfs
 
Configuration files are pure niggerware as they are all shitty programing languages with moronic syntax as such suckles config.h approach does have the advantage of avoiding that retardation. Preferably reconfiguration wouldn't require recompilation sadly due to the way that C is designed it doesn't seem to be possible without serious hacks. However the promised land of configuration by programing language already exists in emacs sadly the programing language in this scenario is retarded common lisp.
 
Configuration files are pure niggerware as they are all shitty programing languages with moronic syntax as such suckles config.h approach does have the advantage of avoiding that retardation. Preferably reconfiguration wouldn't require recompilation sadly due to the way that C is designed it doesn't seem to be possible without serious hacks. However the promised land of configuration by programing language already exists in emacs sadly the programing language in this scenario is retarded common lisp.
What's wrong with lisp?
 
  • Like
Reactions: Marvin
What's wrong with lisp?
lisp is one of the most beautiful language families in the world but some of its progeny are ancient and retarded and make a lot of weird assumptions
the most notable case in point being emacs lisp:
With lisp nothing with it's little retarded brother elisp a lot such a lack of proper concurrency
elisp's lack of concurrency is one thing but then there's also the fact that it doesn't do lexically bound variables by default and tons of other weird cruft
shit was designed in the 80s for hardware that sucked even back then and it shows
...and for the sake of not causing holy wars let's not get into function namespace debates.
 
  • Agree
Reactions: Marvin
You need to check the result of an allocation to satisfy basic programming competency. That's a minimum expectation outside of standards compliance.
yes rust shill i know if i induce ub i am a bad programmer but thankfully i can have defined behavior if i ensure my program operates according to the assumptions of the standard, such as by not dereferencing a null pointer returned by malloc
iirc most linux allocators always return valid memory because the alternative is to enjoy OOM killer and your programs don't have the opportunity to handle such an error, but that doesn't mean you should just blindly assume it always hands out good memory, for portability and code quality reasons
if you want to not care about allocation errors in a portable way and are aware of the consequences there is always the option of wrapping malloc in such a way that it aborts your program if it returns a null
 
Back