Reddit Programming
208 subscribers
1.22K photos
124K links
I will send you newest post from subreddit /r/programming
Download Telegram
I lost my commits in Git and then I discovered about git reflog
https://www.reddit.com/r/programming/comments/1onh6o9/i_lost_my_commits_in_git_and_then_i_discovered/

<!-- SC_OFF -->I checked out an old commit to test something and ended up in a detached HEAD.
Made changes, committed, switched back, and suddenly my commits were gone. That’s when I discovered git reflog.
It quietly tracks every move, even the ones you think you’ve lost. wrote about the full recovery process in a short here -> https://medium.com/stackademic/what-is-detached-state-in-git-and-how-do-you-recover-from-it-eff10834e41f?sk=5f15731679de4a76209af7f419b57678 <!-- SC_ON --> submitted by /u/sshetty03 (https://www.reddit.com/user/sshetty03)
[link] (https://medium.com/stackademic/what-is-detached-state-in-git-and-how-do-you-recover-from-it-eff10834e41f?sk=5f15731679de4a76209af7f419b57678) [comments] (https://www.reddit.com/r/programming/comments/1onh6o9/i_lost_my_commits_in_git_and_then_i_discovered/)
From user to implementer: My journey understanding coding agents
https://www.reddit.com/r/programming/comments/1onybbv/from_user_to_implementer_my_journey_understanding/

<!-- SC_OFF -->My Coding Agent Learning Journey: From User to Implementer Hey everyone, I wanted to share my experience trying to understand how coding agents actually work over the past few months. It's been kinda frustrating but also really rewarding, going from just using these tools to actually getting how they're built. The Starting Point: From Confusion to Curiosity So I started out using Cursor everyday, you know, just like everyone else. Then I heard about Claude Code and thought I'd give it a shot. But the more I used these tools, the more I realized - they're basically magic to me. I had no clue what was happening under the hood. That's when I got really curious. I didn't want to just be another user anymore, I actually wanted to understand the principles behind how coding agents work. The Learning Path: Struggling Between Two Extremes So I started looking for resources to learn, and I found this weird gap in what's available. It's like everything is either super basic or ridiculously complex. On the basic side: - I found tutorials like "Building an Agent" (ampcode.com) which were actually pretty good to get started - But they're basically just demos, you know? Like they show you the basics but you're still missing the bigger picture - After finishing them, I was like "ok, but how do you actually build something real with this?" On the complex side: - I dove into open-source projects like reverse-engineered Claude Code, Gemini CLI, Crush, Neovate Code - These are the real deal - production tools that people actually use - But holy crap, the codebases are massive (we're talking tens of thousands of lines) and the architecture is just overwhelming - For someone trying to learn, it's almost impossible to figure out what's actually important vs what's just implementation details I felt really stuck. I wanted to understand how these things actually work, but everything was either too simple to be useful or too complex to learn from. The Turning Point: The Answer Was to Build It Myself After being stuck for a while, I had this thought - what if I just built one myself? I wasn't trying to create the next big thing or compete with existing tools. I just wanted to: - Build something that was complete but not overwhelmingly complex - Actually understand what each part does and how they connect - Get the core patterns without all the extra production complexity What I Actually Learned from Building It Honestly, implementing this myself was when things finally clicked for me. LLM and Tool Integration - Figuring out how to actually make LLMs call tools reliably - What to do with tool results and how to handle errors - When to run things in parallel vs when to do them one by one Why MCP Actually Matters - Before I thought MCP was just more complexity, but then I got why we need standard ways for tools to talk to each other - How to make different services work together without going crazy - Why extensibility is actually important even in small projects Human-in-the-Loop Stuff - When you actually need to ask the user for input vs when you can just do things automatically - How to make confirmation flows that don't annoy people - The balance between automation and keeping humans in control Putting It All Together - Configuration management, permissions, sessions - all the boring but necessary stuff - Error handling (so much error handling...) - Making both a CLI and an interactive UI that actually work together What Actually Clicked for Me The biggest things I realized: Complexity comes in layers - you can't really understand this stuff until you see all the different levels and why each one exists Actually building it is way better than reading about it - I learned more from a few weeks of coding than months of reading tutorials The sweet spot is balance - you
need something complete enough to be real, but simple enough to actually understand If You're Trying to Learn This Stuff Too For anyone else going down this rabbit hole, here's what worked for me: Don't just use the tools - try to understand what's actually happening The middle ground is hard to find - most stuff is either "hello world" or production-scale complexity Build your own version, even if it's simple - you'll learn SO much Focus on the "why" more than the "how" - the architectural decisions are more important than the specific code This whole experience didn't just teach me how coding agents work - it actually changed how I think about building complex systems in general. Anyway, if anyone's interested in seeing what a middle-ground implementation looks like, I put my project up on GitHub: https://github.com/minmaxflow/mini-kode It's basically my attempt to create something that fills that gap between simple demos and crazy complex production systems. It's around 14K lines of code - enough to be useful and complete, but not so much that your brain explodes trying to understand it. More of an educational thing than anything else. <!-- SC_ON --> submitted by /u/Sweaty-Smile-2342 (https://www.reddit.com/user/Sweaty-Smile-2342)
[link] (https://github.com/minmaxflow/mini-kode) [comments] (https://www.reddit.com/r/programming/comments/1onybbv/from_user_to_implementer_my_journey_understanding/)
Application architecture design template
https://www.reddit.com/r/programming/comments/1onzmja/application_architecture_design_template/

<!-- SC_OFF -->New to the subreddit and a novice engineer self studying to build software using AI tools. I've been largely focusing on application architecture design as I've come to realize that AI coding tools are becoming quite capable. In doing so, I've been wrestling with developing a standard application architecture design (AAD) template that I can use for my app. It's a software asset management tool and is based on the following design: modular monolith, domain driven design with hexagonal layers (ports and adapters). The AAD template is spec'd for a single bounded context and I tweak it each time I move on to building a new bounded context. I've attached the template for reference in case you're interested in seeing what I have. My question is - is there a standard template that is widely used for modular monoliths / DDD based apps? My sense based on reading and research so far is that there is no formulaic template that I can pull off the shelf and each AAD can vary depending on who is creating it. Is this roughly right? Link to AAD / ADR template below: https://docs.google.com/document/d/1cZLOP2nFr_--nuvvuvy1mUd-xflMyFNhRo3dwtEkYE0/edit?tab=t.0 <!-- SC_ON --> submitted by /u/peterk550 (https://www.reddit.com/user/peterk550)
[link] (https://docs.google.com/document/d/1cZLOP2nFr_--nuvvuvy1mUd-xflMyFNhRo3dwtEkYE0/edit?tab=t.0) [comments] (https://www.reddit.com/r/programming/comments/1onzmja/application_architecture_design_template/)
i can not create docker image of my spring boot file can some body help me
https://www.reddit.com/r/programming/comments/1ooqkpy/i_can_not_create_docker_image_of_my_spring_boot/

<!-- SC_OFF -->Hello, I'm trying to build a Docker image for my Spring Boot project using the command ./mvnw clean spring-boot:build-image, but my build keeps failing during the test phase. It fails when trying to connect to the PostgreSQL database with this error: Caused by: org.postgresql.util.PSQLException: FATAL: invalid value for parameter "TimeZone": "Asia/Calcutta" Here is what I have already tried to fix this, without success: Searched Project: I have searched my entire project directory (including src/main/resources and src/test/resources) for the string "Asia/Calcutta". It is not in any of my source code. The only place it appears is in the error logs inside the target/ folder. Checked Test Config: I do not have a src/test/resources/application.properties file that could be overriding my main config. Forced Timezone in pom.xml: I tried forcing the correct timezone by adding this to the section of my pom.xml, but I still get the same error <!-- SC_ON --> submitted by /u/SentenceLivid6246 (https://www.reddit.com/user/SentenceLivid6246)
[link] (https://github.com/Premkumar-Ingale/glowing-enigma) [comments] (https://www.reddit.com/r/programming/comments/1ooqkpy/i_can_not_create_docker_image_of_my_spring_boot/)
Optimizing filtered vector queries from tens of seconds to single-digit milliseconds in PostgreSQL
https://www.reddit.com/r/programming/comments/1ooxsov/optimizing_filtered_vector_queries_from_tens_of/

<!-- SC_OFF -->We actively use pgvector in a production setting for maintaining and querying HNSW vector indexes used to power our recommendation algorithms. A couple of weeks ago, however, as we were adding many more candidates into our database, we suddenly noticed our query times increasing linearly with the number of profiles, which turned out to be a result of incorrectly structured and overly complicated SQL queries. Turns out that I hadn't fully internalized how filtering vector queries really worked. I knew vector indexes were fundamentally different from B-trees, hash maps, GIN indexes, etc., but I had not understood that they were essentially incompatible with more standard filtering approaches in the way that they are typically executed. I searched through google until page 10 and beyond with various different searches, but struggled to find thorough examples addressing the issues I was facing in real production scenarios that I could use to ground my expectations and guide my implementation. Now, I wrote a blog post about some of the best practices I learned for filtering vector queries using pgvector with PostgreSQL based on all the information I could find, thoroughly tried and tested, and currently in deployed in production use. In it I try to provide: - Reference points to target when optimizing vector queries' performance
- Clarity about your options for different approaches, such as pre-filtering, post-filtering and integrated filtering with pgvector
- Examples of optimized query structures using both Python + SQLAlchemy and raw SQL, as well as approaches to dynamically building more complex queries using SQLAlchemy
- Tips and tricks for constructing both indexes and queries as well as for understanding them
- Directions for even further optimizations and learning Hopefully it helps, whether you're building standard RAG systems, fully agentic AI applications or good old semantic search! https://www.clarvo.ai/blog/optimizing-filtered-vector-queries-from-tens-of-seconds-to-single-digit-milliseconds-in-postgresql Let me know if there is anything I missed or if you have come up with better strategies! <!-- SC_ON --> submitted by /u/m1r0k3 (https://www.reddit.com/user/m1r0k3)
[link] (https://www.clarvo.ai/blog/optimizing-filtered-vector-queries-from-tens-of-seconds-to-single-digit-milliseconds-in-postgresql) [comments] (https://www.reddit.com/r/programming/comments/1ooxsov/optimizing_filtered_vector_queries_from_tens_of/)