6

Used to think I was a hot shit programmer. Self taught (mostly) and could make all sorts of shit happen. Then I started reading other people's codebases. I got a huge dose of humility. Learned a lot from other codebases in the process. Eventually after a lot of languages and lot of practice I got a programming only job. Started reading through the codebase. Holy shit there are way worse programmers than me. There is some really good code in there too, but 20 year old wtf code too. I assume my perspective comes from seeing what good code can be. I still have a lot to learn though. That is the fun part. You can spend a week on a minute detail of one language or one concept.

So here are a few fun questions:
1. What is the worst code, codebase, or programmer you ever met?
2. What it the best code, codebase, or programmer you ever met?

I have seen a few codebases on github that just told me to walk away. Some of the best code I have found has been in game engines. Probably because I look at a lot of game engine code (sampling bias).

The coolest library I have used has been Construct (Python lib). It is a reversible protocol library. It can deconstruct or construct a data stream.

Leaving the off by 1 or more error in my post.

Comments
  • 3
    Good questions.

    Answers regarding people in real life:

    1. A polish coworker. While I'm in general quite fond of east europe devs, this one was terrible. His source code looked like the file was written by several devs that always patched stuff. That's what he did, patched until it works and moving on. Fact is, he delivered very fast bad quality. He's pure fired by complains of other devs. The employer actually liked him because he was always the one saying "Of course that's possible, give me one hour!". I told my follow up (stopped being lead) that he was impossible and that guy (knew him well) said that i'm probably doing smth wrong regarding him. A few months later that guy was the cause firing him.

    2. A dev in my own neighborhood. He is amazing and drives a skyline. He ran over his laptop with it once. He was always rapping during coding. He wrote very specific code (nothing generic, one purpose) and just delivered hardcore. Velocity and delivering. That's what counts
  • 3
    Answers regarding stuff i've seen online.

    1. Wordpress, it's the biggest security issue i've ever seen. Templates can do SQL queries and it's very common to base on online templates. Peter Kassenaar. The Dutch book author that learned me to make sql injections.

    2. I've learned much from nginx source code and sqlite3. I've investigated sqlite3 recently and god, what can that guy write code! sqlite3 is a one-dev project and he doesn't want source code contributions. It's open source in the way that you're allowed to know the source, not to contribute for it. I do understand it very well - he has a certain set of skills and has a clear vision. With such clear vision of how to do things, it's not comfortable to work with others. Also Guido van Rossum (Dutch python inventor) and ofcourse Torvalds are amazing imho. They're all successful because they're good AND are all nazi's in someway. Believing in yourself is key is what they show. Be self made. Also huge fan of Bob Nystrom.
  • 2
    @retoor this reminds me of ID software releasing their early games as open source. Also reminds me of the Descent devs releasing their code too. They said they want people to see that production code isn't necessarily the best quality code. Which is a really interesting position to take.
  • 2
    Regarding own skills i'm happy, i'm good in the parts that matter to me. That includes professional soft skills regarding ticket administration and project management.

    I have two major down sides tho:

    - I can't visually design anything. Literally. The visual template of my chatbot is GPT generated. People care too much about design to use my own.

    - I can't write nice consistent documentation for some reason while i'm very consistent in coding. I have no idea how it's possible, i can talk unlimited about my work and do understand everything on a deep level. So why can't i document?

    On job interviews where I apply as backend developer I always joke that i've never made smth beautiful (to emphasize i'm backend) and people think it's funny to say such stuff. But it's really true. I did almost every common language professionally in exception of C, C++ and Rust. First one can't find a job in. C++ has too many ways to rome. Rust syntax just doesn't attract me. I love malloc
  • 1
    @Demolishun since you're a professional C dev, please take a look at my (start) of an ORM in C: https://retoor.molodetz.nl/retoor/.... It's in development. Be aware - it's made to have a beautiful easy API that is both usable in C and in Python using shared object. Look the sorm.py to see how I got variadic args implemented in both C and Python.

    Can you tell me if you see some very obvious mistakes? I wrote a lot C, but do not have many C devs in my environment and no professional experience in it because there are no software jobs in it. It's all embedded and PLC-related. But also in PLC world it becomes more bascom and stuff. Mitsubishi and Siemens both prefer other language afaik. I've did automation with Delphi in a factory regarding HUGE recycling processes. Exited that job because the zero fault tolerance was a bit too much for a ~20? ~22? year old. Imagine also that most my age were still students and enjoying life and I was like - wtf i'm doing taking so much shit?
  • 3
    people always say you'll learn so much from reading others' code but that has never happened to me

    I've never found someone's code to be good

    I don't know what's wrong with me

    I can spot when people have a natural talent for coding though. seems either you can code well or you can't, and it's really obvious early on

    I met a guy in screeps I was TREMEDOUSLY fascinated about. still remember his name. mastodon. I don't know who he was. he was in the same block as me, he was a newbie, and he conquered the whole game just about in a month. I saw his codebase's functionality evolve over time, and he must've been a god. then he left because he won everything and probably got bored. I never talked to the guy and I wish I did. the rare times I meet someone impressive I get like, too nervous. wish I saw his code, too

    ---

    most code I encounter I could rewrite in 1/10th the lines and remove all that convoluted logic, so that's for "worst". everything is the worst.
  • 3
    The more you know the more you understand you know nothing.

    That's one big truth that never fails.

    If you think you know, you're too young and inexperienced to know
  • 3
    @Hazarth stages in development:

    - beginner, i don't understand all those libs because i barely know the language and will do it myself instead of using libs. Libs are intimidating.

    - bit experienced, able to learn and use stuff from others. You're not gonna make shit yourself right? Let's glue everything together! Progress!

    - hmm, I need only certain functionality from a lib. let's find out how it works and write my own. And then making it actually better.

    It starts and ends with doing shit yourself. Many devs keep stuck in the middle. Sadly, the one in the middle is kinda the job mostly. During job you can't write your own libs for sake of quality. You're stuck with TTM
  • 2
    @retoor

    > During job you can't write your own libs for sake of quality. You're stuck with TTM

    During job, you can use lower-lever api instead of bringing another dependency for a thing you could write in 10 minutes.
  • 0
    @antigermanist yeah at some workplaces you have to go through legal to use packages

    sounds like a nightmare

    then also if you upgrade a package you have to go through legal. aka nobody is updating them

    at that point it's more comfortable to have internal libraries. at least you can update them
  • 2
    This one is a toughie.

    The worst, not really programmer, but sysadmin, I've met, would clearly be the sysadmin of a previous company.

    He would systematically refuse to either give us access to the dev VMs or set up cloudwatch so we could have some observability on issues. (Namely because he didn't know how to).

    He'd also keep all ssh keys for every VM in the bastion host of the vpc... Because he didn't know about ssh -J...

    He'd also systematically fail to renew every certificate because he didn't know how to set up certbot. (Claimed that he didn't trust certbot, and that he had his own alarms set for it). Curious that they never worked...
  • 2
    The best, I'd have to say one guy that I completely lost track of, that worked with me on wowd/antrix/ascent before we both went on to actually work for the big B itself.

    He could do fucking magic with networking code, and is still the guy I've learned the most from in that aspect.

    With time, I've found out that I only find such gems more and more rarely, and it's too be expected.

    I watch and learn like a sponge, so it was bound to come the time when I'm the one teaching, and not learning, which by all means I still do, but it's harder to do now unless I get into really specialized fields.
  • 2
    Had to think about this rant again. As some of you know, I invest a lot of time writing programming languages myself. It's not a goal to be fastest / having best syntax (because, both i won't win) but the cleanest source code. That's very opinionated, so it is something i can win. But then I discovered the wren language and decided that it was game over, it was exactly written with the quality I had in mind. But wren is dead. But now, I see this fucker: https://github.com/vtereshkov/.... That guy can code! Wtf. If you can make a programming language look that easy has he does in this repository, you're a true dev. That the source isn't impressive is fucking impressive. So far, two projects are made with my quality in mind. So, Wren and Umka. Sqlite3 doesn't apply here because I have no fantasy or even an idea how a database should be designed or what it takes. Can't have opinion about database.

    But damn, the Umka source is nice. It made me touch myself and stuff
  • 1
    @jestdotty if you've never found someone's code good, review this one for a bit: https://github.com/vtereshkov/...
  • 1
    @antigermanist lower api generally costs more time right. But really, I really don't use dependencies anymore. uuid4? I've learned how to write that fucker. Base64? Same situation. How HTTP BasicAuth works and a big part of HTTP/WEBDav protocol? Same. I can write a complete server without dependencies. I know that those are things you would normally never write yourself since it has no benefit but while creating such stuff, I've learned so much stuff that every library is considerable for a rewrite. I'm even doubting a vector database at the moment - have to do more research if it's doable. Sqlite3 and python barely have dependencies. And you know what? Both compile straight out of the box while being huge in source. That's dem dream. Also, that feeling of knowing literally your whole project is so satisfying. A node (frontend, backend is ok) never feels like my own. Its 99.99% someone else his code. It's like you did a small patch to it.
  • 0
    @CoreFusionX Certbot is outdated. Go caddy or go home is the word on the street.

    What does -J has to do with storing ssh keys on a bastion host? I mean, you can do that, but what does it have to do with storing keys there?
  • 0
    @CoreFusionX much respect for people who are advanced in networking. Sockets is my fetish for a decade and I bought a book about the low level C API eventually and read it whole. By that time, I still have learned stuff about network, but not really about the C socket API anymore. If you understand the socket API from C, you understand them automatically in nearly any language.

    But then, a few weeks ago, I was like, wtf is a correct buffer size? I mean, we can't be using 20 years the same values right? Stuff changed. I used for local development values like 1Mb and stuff, just because it's possible and it went faster than 4096. Sure, but it doesn't get harder than 256 or 512. Depends also on the socket option you can set for that. Weirdly enough, NO tutorial and even the book says ANYTHING about setting socket buffer size using an option. NO ONE does this for some reason.

    Were you familiar with setting sock buffer size using an option? I really researched a lot, I didn't
  • 1
    @retoor

    This was in a time certbot was the only option. So not really a choice.

    -J in ssh is shorthand for proxyJump.

    The only point of a bastion host is to bridge resources in a private subnet to a public subnet so they can be accessed.

    But the way to do that, is that people hold the privkey to the bastion *and* to those resources they need to access, and you use ssh -J <bastion> <actual target>, to access, so that you first connect to the bastion, and from there, ssh connects to the resource only reachable from the private subnet.

    If you store all the private keys to all the private resources on the bastion (moreso, on a publicly accessible directory), what's the point of having a bastion at all, you just made it so anyone with access to a single resource has access to them all.
  • 1
    As to socket buffer size, it's really a relic of old times, but can still bite you in the ass.

    The official documentation says (for both BSD and Winsock) that the implementation can withhold recv calls until the recv buffer is full, and withhold sending until enough send calls fill the buffer.

    That's, of course, still true, but it's a relic of a time where CPU cycles were at a premium, and it was in everyone's best interest to just move a whole ram page of socket data into ram or disk.

    Modern solutions in kernels based on kqueue/epoll don't really need to rely on buffer size and if the CPU has the slightest amount of time available on the scheduler, you'll get your recv/send back in no time, no matter how small the payload is.

    By the way, part of our breakthrough work in having antrix support up to hundreds of simultaneous clients without degradation was intimate knowledge of epoll and kqueue.
  • 0
    @retoor umka looks rusty

    right at the code not at the constructed language

    idk if I can judge c code tho

    I'm actually quite familiar with game dev codebases / physics / number or data processing but not much with interpreters / compilers / parsers etc lol
  • 1
    sooo many definitions

    this is like a library book with indexes and pages

    writing all that seems annoying

    but I do notice lower level language people spend a long time just trying to make their functions findable at the right locations I guess

    I mean woo, organization. kind of boring though

    yeah the guy put in a lot of effort. very diligent

    idk 🤷
  • 1
    @jestdotty that's why we use pointers. Everywhere available! WOEIII
  • 1
    @retoor I am fatigued already!

    *proceeds to rewrite a rust interface / trait for the 7th time*
  • 0
    @jestdotty Maybe your knowledge is too mixed from many sources that you're facing some issues. Maybe it's better to try one big book and learn that fully. Else you'll have maybe like i had with learning regex with GPT: issues, issues, issues. I was faster done if I just had've read a book instead of questioning GPT. I've learned with too much missing side info
  • 1
    @retoor I don't like books... more overhead than throughout for me

    no I had brain damage

    something I did recently was amazing for my brain and I can actually think theoretically for once and reduce my code bloat

    seriously, without a working brain you just wander in circles. it's really sad. the difference is absolutely exponential. 2 years in 1 week difference

    since brain came back I should be able to throw shit at the wall and learn from what sticks, which was my learning style before. I can't take reading 5k characters for something I could've just ran and understood in 30 seconds. also my linguistic comprehension skills are ass, I'd have to know how this person wants to describe things and what they mean by their words so it's learning too much irrelevant information. I've always just liked reading the code than people describing it
  • 1
    @jestdotty I know how it is, I had my fair share brain issues too for last 1.5yr. Biggest issue was that had a unresolvible boredom. But now i'm fit again, every day lacks hours, Not a second bored. I have like 17 - 16 hours a day to code almost but still i do not have enough time. Time goes too quick. I have no idea how I ever could've been bored. But it was only that 1.5yr. Before I was like how i'm now kinda. Maybe bit sharper. But i decided to continue with the medication. Especially now i'm on probation :P I can't have another issue or I will go to jail for a month :P
  • 1
    @retoor woo adjustment

    time used to go by much slower for me not as in like bored and torture, but it's like every day is 1/4 the length it should be. before i'd code like 16 hours a day and such but it actually felt like 16 hours. now I get up, make food, and next thing I know it's bed. repeat for like 6 months now (and before the 6 months was worse...)

    want time to go slower again pls. hopefully soon

    at least crypto popped so I'm far less stressed about my existence being possible

    also roomie moved out and I think that helped cuz stress made my issues worse. the other day I got mad and realized I hadn't been mad since he moved out! I didn't even know how taxing it was to be pissed off til I got pissed off again. damn

    Brain power go go go!
  • 0
    @jestdotty You experience life so different than I do, it's insane :P

    Btw, my this was recently the context of my LLM: https://devrant.molodetz.nl/2024-11...

    Holy fuck. Maybe real LLM's have that too in someway.
  • 0
    @jestdotty you're more popular than me btw: https://retoor.molodetz.nl/retoor/...

    You're rank 50, i'm rank 56. It's post / upvote ratio. FIrst an unknown user with highest rank was a guy that only posted once ever, and got six upvotes on that post. Tadaa
  • 1
    @retoor just some regular AI schizophrenia

    devil's in the details
  • 1
    @retoor I cheat. that rank isn't real by the stats. I've had a script forever going that deletes comments under a certain upvote count (script runs every week on gitlab ci/cd, if a comment is 2 weeks old or older and doesn't have 2 up votes it's removed). I do it for some privacy reasons since I say a lot of stuff and especially cuz of the brain issues. couldn't do opsec, people generally don't upvote personal info much. I mean I also did something similar on reddit once but it had to do with characters per upvotes math and I was doing it like a code golf and to do social experiments, but here is not popular like there (and I similarly did it because I was paranoid about opsec lol, what spurred it)

    once I get 6k votes here and get a bean bag chair I'm gonna go through my devrant and sanitize them manually

    plus who wants to keep data around that people didn't appreciate 😝, pay in imaginary points or it's like it never happened~
  • 1
    @jestdotty my stats are only of last 8/9 days so your script doesn't do anything yet I think, but I could watch. See all json files at the bottom in export folder btw. You can paste them in gpt and do all kinds of questions. The mention stats at top says a lot about usage
  • 1
    @retoor oooh ok

    guess my wit still exists somewhere!
  • 0
    @jestdotty do you run servers somewhere? I use a free vps from a friend with 4Gb ram and two cores. It's only a forwarder to my 'server' at home for heavier work. It's connected trough ssh -R. My server and llm's have a 4g connection. A phone Hotspot on my kitchen table. If power goes down, my site will still run for a few hours because my 'server' is a laptop also containing a battery. This laptop is new but is one of the worst I've ever had when it comes to comfort. Opposite of my x270. But I do admit my x270 looks very old next to that one... I should look for a new daily driver. X270 is blazing fast with chrome, vscode and Linux itself but compiling goes slow and I do that a lot. I almost compile all software myself. Recently more than two hours for Linux kernel and then gave error. Good machine can do it in half hour
  • 0
    @jestdotty what AI made based on that json file I provided you: Let's analyze and compare the contributions and engagement metrics for retoor and jestdotty from the provided data (read until the end before you get sad :P):

    1. Contributions

    retoor: 505 contributions.

    jestdotty: 203 contributions.

    retoor has significantly more contributions, approximately 2.5 times that of jestdotty.

    2. Ownership

    retoor: 1.0 (100% ownership, likely the dataset is based on their activity).

    jestdotty: 0.4 (40% ownership).

    retoor dominates in terms of ownership, as they account for the entire dataset's baseline for contributions.

    3. Upvotes

    retoor: 708 total upvotes.

    jestdotty: 304 total upvotes.

    retoor received more than double the upvotes compared to jestdotty.

    4. Upvote Ownership

    retoor: 0.15 (15% of the dataset's upvotes are attributed to them).

    jestdotty: 0.06 (6% of the dataset's upvotes are attributed to them).

    retoor again holds a greater share of the upvotes.
  • 0
    @jestdotty

    5. Upvote Ratio

    retoor: 1.4 (average upvotes per contribution).

    jestdotty: 1.5 (average upvotes per contribution).

    Interestingly, jestdotty has a slightly better upvote-to-contribution ratio than retoor.

    6. Post Length Total

    retoor: 111,037 characters (total length of all posts).

    jestdotty: 69,275 characters.

    retoor has much more content, approximately 1.6 times the total length of jestdotty's posts.

    7. Post Length Average

    retoor: 219 characters per post (on average).

    jestdotty: 341 characters per post (on average).

    Here, jestdotty stands out with more detailed or lengthy individual posts compared to retoor.

    Summary

    retoor excels in terms of quantity (contributions, total post length, upvotes).

    jestdotty performs better in terms of quality (higher upvote ratio, longer posts on average).

    This indicates retoor may focus on a higher volume of shorter posts, while jestdotty leans toward more detailed and focused contributions.
  • 0
    @jestdotty, yeah, you post less amount but longer messages indeed
  • 0
    @retoor I used heroku before but then they banned me

    stole roomie's old laptop he forgot he had and was planning to use for hosting but I need a clean apartment first then I'd find somewhere I'd plug it in and such

    i've been getting around fine without one

    gitlab ci/CD scripts are ok for intermittent tasks

    before I had like chatbots but I don't frequent those places anymore

    and instead of website tools I'm remaking the tools into command line tools

    and otherwise I have too much to do. doing this finance thing, then I wanna do music and make not gay music, then I wanna make some video games. if all goes well this should be the pipeline and I'll be very happy. before I couldn't focus much and was mired in negative feelings because of my money problems but now I'm thinking I might be ok. so I might actually be able to make what I want for once in my life since i was a teenager. work is whore business but doesn't even pay you a whore's income
  • 0
    @retoor I probably should replace the battery pack on this disaster of a laptop I'm using now. it's falling apart left and right even though it was very expensive and it's still new

    but the battery pack is puffy (despite laptop always running cool...). like do I wanna gamble on a bomb going off. should be criminal to sell hardware so "cheap" in build quality

    bet battery packs don't even cost much

    also I still need to root my phone

    and my bf keeps having crisis of us not having met yet. he would rather I flew to him, plus he can't take days off work because work is slavery. he can't even meet his rent increase with their salary but nobody cares. so it's probably best if I have some time free and get to not being stressed and sick all the time and fly to him past TSA scrutinizing me cuz I look like a hippy and don't have a job and then just chill at his place for a month. roommate took my cat so I don't have to worry about someone cat sitting her which is great

    also passports 🤮
  • 0
    @retoor what are contributions and what are ownerships
Add Comment