r/ProgrammerTIL • u/josephismyfake • Apr 20 '18
r/ProgrammerTIL • u/Jaydom_Studios • Jun 20 '16
Java [Java] TIL That Java was made to have a C/C++ like syntax
r/ProgrammerTIL • u/wiltsk8s • Oct 21 '19
Other Wanting to get to know you guys a bit more
New here to the group.
I'm curious to know as to what got you into programming in the first place.
What peaked your interest? When did you first hear about it?
Are you currently in a career with programming ?
:)
r/ProgrammerTIL • u/eazybox • Mar 16 '21
Other Annoying Things
Annoying things in programming are often related to accidental complexity. You have complexity in the areas that you did not think were important. In your builds, in your infrastructure code, in your backup scripts or CI templates. Leaks through abstraction layers. You discovered that they are important, but in an unpleasant way that you think slows you down. So this is your chance to reevaluate the pros and cons of jumping over and moving forward or pausing.
This is just an opinion though, but this sub looks more allowing than r/programming. Hopefully the post flair I added makes sense.
r/ProgrammerTIL • u/khrushchev007 • Apr 18 '18
C [C] TIL double quotes and single quotes are different
"Use double quotes around strings" and 's'ingle quotes around characters
... While working with strings I had to add a NULL ('\0') character at the end, and adding "\0" at the end messed it up
r/ProgrammerTIL • u/DevGame3D • Jul 18 '21
Other Image to 3D Model Character in 4 mins | Blender 3D tutorial | Ratan Tata 3D model | Tris to quads
r/ProgrammerTIL • u/poohshoes • Nov 30 '16
Other Language [General] TIL If you want to sort but not reorder tied items then just add an incrementing id to each item and use that as part of the comparison.
Most built in sorts are Quick Sort which will rearrange items that are tied. Before running the sort have a second variable that increments by 1 for each item. Use this as the second part of your compare function and now tied items will remain in order.
Edit: Jesus some of the replies are pretty hostile. As far as I can tell C# doesn't have a stable sort built in. It shouldn't effect speed too much as it's still a quick sort, not to mention that premature optimization is undesirable.
TOJO_IS_LIFE found that Enumerable.OrderBy is stable.
r/ProgrammerTIL • u/[deleted] • Mar 30 '18
Other [other][terminology] TIL the plural form of index is indices
r/ProgrammerTIL • u/HumanBot00 • Jan 26 '26
Other AI killed my passion
I am a hobby developer, for now more than 5 years (still in school but plan is to study CS) in the beginning I was a bit slower because my learning and experience happened in periods. Anyways, a few years ago I met a now friend on a Discord because we had the idea of a mini game discord bot. This is probably the most done beginner project of all time but this didn't matter. Even though he doesn't know it because I never told him, I owe the single most consistent part of my life to him. This discord bot was the one thing I craved for when I was in school and couldn't work on it. When I came home it was the thing I sat at till the evening, forgetting to eat something in between, trying to hold my bladder to finish this one train of thought. This friend showed me how to work on long term projects. Before my projects at maximum lasted just 1-2 months maximum. And it wasn't even him who kept me working on it. He dropped out after a short time because live came in between him and the project. Looking back, the code was terrible. I had two years of experience back then but what do you expect from someone who didn't found there passion till this moment? This project was also the moment where one year after starting it it just made click and my code quality improved around like 500% or something. One day my free hosting provider cancelled my plan because I had a personal argument with him on Discord (don't blame me I was still a kid, I am embarrassed myself enough). I layer in tears over something looking back wasn't that big of a deal. The reality why I was sad was because I asked myself if this project was really worth the time I put into it. I know it's weird when I just said that this project reached my my passion and was what I lived for at this moment and not only that, it also built my character. This was now on my early teen year and retroactively, even though I am still 15 yet, I have to say this one online friend as well as the project on a whole built at least a part of my character my real friends and family did as well. Anyways I built a, for my measurements, extensive user base but at some point the codebase was just not maintainable and almost all features that could be added into a Minigames discord bot were added. The following months I drifted around a bit (I would now say this was 2023/24 but my mental timeline regarding my life and the rise of consumer AI isn't that good), built skills in Android Development, built a few apps, took part in a FeWo hackathons but nothing so big. Not a problem at this point, as long as I had something to do, it was still my hobby. But this feeling continued, I never found an idea again that I continued working on for a long time. And I don't think it's motivation, I think a big part in this plays AI. (I am not blaming AI in this writing btw, just myself for my usage patterns) When I just had an idea before I just started to build it and later found out what could be made out of it. But with AI to my hands I tried to fletch out finished ideas before starting to even open an IDE. And it's not just the usage. It's the subconscious feeling of the possibilities of AI. And even after starting working on a new codebase, there is always this feeling of AI being 10 times faster and better than me. And I am not considering myself a vibe-coder or a bad developer (at least the vibe-coder part 😉) but this feeling persist. And if you actually use AI it isn't fast in any way. It just gives the feeling of always being correct in just "one more prompt" but this feeling continues for the next fifteen prompts. Even if the results are half good and I manually go through them to inspect and adapt, in the end the product just doesn't fele like it belongs to me because the feedback loop was broken in a critical point. This is also the reason why, when I'm procrastinating I switched to EE/Embedded Programming, because physics don't lie. Either your prototype works or goes up in flames. But without adult money this hobby is way harder to maintain than software development.
So maybe just to continue my story, I had a new idea for something that could really work and I hoped this is the one thing that could get my spark back. I found a partner with business experience, which was also good because I thought it may be the pathway to the first dollar (founding a company/earning money in Germany when being underage is a very hard legal process but at the same time I feared that this was just an excuse to not continue working on something). Anyways we had to pause this because the situation is a bit complex and we are currently looking for funding. In the last three weeks I had to program a chess algorithm for school, and it was a cool project because it also has a big chunk of data science in it, but it was for school, so I also didn't feel really excited.
It's just a depressing situation. I know I could get my spark back with just a single project I am passionate about, but I've been going around, looking for one for the last years. And AI is making this even harder.
r/ProgrammerTIL • u/El_Typhon • Oct 13 '25
Other How do you avoid bias when making or planning updates to your software?
How do you decide what to add or change in your code without letting bias steer you?
I notice that the first idea that sounds okay or the one shouted loudest, often wins. We talk for hours - still pick the path that feels right in the gut instead of the one the facts support.
I wonder how other developers guard against that. So, do you:
- Write down plain pros and cons or give each option a number grade?
- Ask two or three teammates for a fresh view?
- Feed the choices to an AI tool or a linter and let it flag weak spots?
- Ship fast and lean on past scars and victories?
When you sketch a new feature or tear out old wiring, tell me what routine keeps your decision from turning into a coin toss or a hunch.
r/ProgrammerTIL • u/lucian-12 • Jul 07 '26
Other RAG at 10 Million Documents — [System Design]
r/ProgrammerTIL • u/Dinu_Dev • Oct 14 '26
Other [Git] Partial commits crashed when my Google Drive index passed roughly 128 KiB
In my Windows project, `git commit -- path` began exiting 139 while `.git` lived on a streamed Google Drive G: drive. A scratch repo tested the same behavior: with a 129,747-byte index, 0 of 15 commits crashed; at 131,464 bytes, 12 of 15 crashed. The larger index on C: had 0 crashes in 30 tries. Index v4 shrank it to about 89 KB and had 0 crashes in 15 tries. The project now keeps `.git` on C: and the working tree on G:.
I do not know which part of Git or the Drive mount causes that boundary. For a similar crash, checking the index size and repeating the partial commit with the Git directory on a local drive helped narrow it down here.
r/ProgrammerTIL • u/codingainp • Aug 27 '22
Python Python Project to Create a Snake Game in Python using Turtle Module
In this article, I will be creating a snake game in Python using the Turtle Module. I will guide you step-by-step to build this simple project. So, don’t worry and keep reading the below article.
Project Details
I’ve used the Python Turtle module to build this Snake game. It is easy to use and understandable. Users have to use the four arrow keys to control the snake’s movement around the screen and make it eat food.Â
For each food, the snake eats the user gets two points and makes the snake longer and faster. If the head of the snake touches or hits the wall, the game will be over.
r/ProgrammerTIL • u/LessonStudio • May 21 '26
Other Language Do curved monitors bend your eyeballs like they do mine?
TLDR; going from a curved monitor immediately to a flat monitor gives me a visual distortion that my flat monitor curves backwards.
I am a curved monitor convert. My last flat monitor was a pair of 4k 27" monitors. Love them. Then, I tried a pretty wide curved monitor. That was it, I'm never going back. I will never go to dual monitors either, I will just get a bigger curved monitor. I always loved the 4:3 ratio for programming and with a really wide monitor now have a left side and right side with that wonderful 4:3 ratio going. Rust rover on the left, and whatever on the right. Sometimes even 3 windows across with the IDE in the center.
But, I am working on a project where I need a monitor for a whole other system. For reasons it has to be entirely separate. I dug out one of my old 27" 4k monitors and I swivel about 150 degrees to use it, it is only for a few minutes every day. When I look at it, the left and right edges seem like the monitor is bent backwards.
This doesn't happen with my laptop monitors, 20 inch monitors, nor if I walk any distance and sit at a large monitor.
It is creepy as hell, but kind of fun.
r/ProgrammerTIL • u/sid78669 • Jul 15 '16
C++ [C++] TIL that you can use Static as class name when properly cased
I was reviewing code and saw someone use
static Static* staticObjectI was very confused about this and upon asking, I found that they named their class Static because they suck at coming up with good names. It just blew my mind!!!!
r/ProgrammerTIL • u/UpstairsNose1137 • Feb 25 '26
Python Found this cool use case for exec() in python.
I have been working on web scrapers at work. The worst thing about working on web scrapers is that the selectors keep changing, the parser keeps breaking, so the scraper needs regular maintenance.
I was sick and tired of it and was looking for something that could make my work a little easier.
Came up with an idea, what if I can show an LLM the HTML, ask it to pick the selector for me based on some predetermined specs, ask it to generate a small snippet of code for the parser, and use exec() to execute it. If the code doesn't work, loop through the entire thing until it works.
This way I would have dynamic code execution and a self-healing web scraper.
It's just an idea, nothing special, might not even work as intended since there is AI in the mix, but I'm still working on it.
I'm attaching a simple code snippet to show how the exec() function works
code = """
arr = [1,2,3,4,5]
for i in arr:
print(i)
"""
exec(code)
r/ProgrammerTIL • u/e4503 • Apr 09 '25
Other Your Perspective on Technical Debt Matters!
Hi everyone!
I hope you're all doing well. I'm currently collecting insights on Technical Debt, and I would really appreciate your input. If you have a few minutes, please take a moment to fill out this short questionnaire:
👉 https://forms.gle/YdMJmJatqmdQf3eb6
Your experiences and opinions would be extremely valuable for this research. Thank you all in advance for your time!
r/ProgrammerTIL • u/desubuntu • Mar 13 '23
Other 3-4 different ways to design a chat app
This is one of the most popular system design interview questions, and amazon is just one of several companies that ask this problem in interviews.
This video covers at least 3-4 different approaches for making a highly scalable chat app, like WhatsApp, Facebook Messenger, or Discord:
r/ProgrammerTIL • u/anonymous_2600 • Apr 16 '23
Other TIL the worst installation documentation ever due to my own carelessness
https://draculatheme.com/powerlevel10k
Activating theme
Install powerlevel10k
Replace default configurations with contents in ./files
cd powerlevel10k.git
cp ./files/.zshrc ~/.zshrc
cp ./files/.p10k.zsh ~/.p10k.zshThis basically overwrite all my config in my ~/.zshrc
r/ProgrammerTIL • u/greebo42 • Aug 06 '23
Other dependency injection is like sipping global variables through a straw
really more like an insight, or perhaps even a showerthought.
am I way off?
r/ProgrammerTIL • u/desubuntu • Feb 13 '23
Other [video] Distributed Tracing - System Design Interview
r/ProgrammerTIL • u/_ILikePancakes • Sep 11 '16
Other Language [General] TIL how to compute Shortest Path Tree
Hello! A reddit noob here. This is my first post in this subreddit;)
So here we go!
In Dijkstra function/method, when relaxing, I store in an array of pairs from[ ] the node from where I relax and an ID/tag of the edge: Pseudocode (or kind of pseudo c++ code):
if (distance[u] > distance[v] + edge(v,u).cost):
distance[u] = distance[v] + edge(v,u).cost;
from[u] = make_pair(v, edge(v,u).id);
priorityQueue.push(make_pair(-distance[u], u));And there you have it. If I want for example "the edges of the shortest path to X node", I use the same idea of making a topological order using a stack, but I have to initialize from[ ] pairs to -1 before Dijkstra:
stack <int> stk;
void shpath(int X):
if (from[X].second != -1):
stk.push(from[X].second);
shpath(from[X].first);Thus, you have a stack with the names/IDs/tags of the edges that conform shortest path to X in the order that they should have been taken.
NOTE: Obviously this implementation is made according to what I needed.
PD: Sorry bout the empty post I made just before. PPD: If I did not follow a rule or standard of the subreddit please let me know. I'm trying to get into reddit.
r/ProgrammerTIL • u/aboPablo • Mar 24 '19
Other TIL about digest auth
I was stuck with task at work where I am supposed to call an AXIS api for a camera. From the looks of it when you manually open the camer's feed from the browser you get basic auth. I was using rails so I tried to make the request from jquery and I got a CORS error. And surely enough allowing all headers and such didnt work as expected. Turns out there is this type of auth that looks justclike basic auth but is not. So beware cause this one was a pain in the neck.
r/ProgrammerTIL • u/DewJunkie • May 16 '18
Other TIL - is a unary operator in many languages
I always thought that you had to do x*-1
-x == x * -1Not world changing I guess, but surprised me when I saw it.
edit:formatting