Reddit Programming
199 subscribers
1.22K photos
127K links
I will send you newest post from subreddit /r/programming
Download Telegram
Opening a cloned repo is no longer safe
https://www.reddit.com/r/programming/comments/1u00xhc/opening_a_cloned_repo_is_no_longer_safe/

<!-- SC_OFF -->Solid breakdown of the Miasma worm — one commit, same dropper wired into 7 config files across VS Code, Claude Code, Gemini, Cursor, npm, Composer, and Bundler. No malicious dep needed, just clone + open. Nobody reviews these files in PRs. https://safedep.io/config-files-that-run-code/ Anyone actually treating dotfile diffs as code? <!-- SC_ON --> submitted by /u/No_Plan_3442 (https://www.reddit.com/user/No_Plan_3442)
[link] (https://safedep.io/config-files-that-run-code/) [comments] (https://www.reddit.com/r/programming/comments/1u00xhc/opening_a_cloned_repo_is_no_longer_safe/)
Hot path optimization. When float division beats integer division
https://www.reddit.com/r/programming/comments/1u06itn/hot_path_optimization_when_float_division_beats/

<!-- SC_OFF -->I've started a series of short blog posts about hot path optimizations. This first one covers a counterintuitive optimization: replacing integer division (IDIVQ) with floating-point division (DIVSD). <!-- SC_ON --> submitted by /u/watman12 (https://www.reddit.com/user/watman12)
[link] (https://blog.andr2i.com/posts/2026-06-08-optimization-catalog-when-float-division-beats-integer-division) [comments] (https://www.reddit.com/r/programming/comments/1u06itn/hot_path_optimization_when_float_division_beats/)
System Dynamics Course | Chapter 16: Discrete-Time and Sampled-Data System Dynamics
https://www.reddit.com/r/programming/comments/1u06nad/system_dynamics_course_chapter_16_discretetime/

<!-- SC_OFF -->Used 5 different programming language for this course. GitHub repository link: https://github.com/mohammadijoo/Control_and_Robotics_Tutorials <!-- SC_ON --> submitted by /u/abolfazl1363 (https://www.reddit.com/user/abolfazl1363)
[link] (https://youtu.be/yQ0oKvK3Db8) [comments] (https://www.reddit.com/r/programming/comments/1u06nad/system_dynamics_course_chapter_16_discretetime/)
I analyzed 26 major open source repositories. Every one had at least one bus-factor-1 module
https://www.reddit.com/r/programming/comments/1u0va69/i_analyzed_26_major_open_source_repositories/

<!-- SC_OFF -->I built a CLI called git-archaeologist to analyze ownership concentration, bus factor, coupling, and change history from git repositories. To validate it, I benchmarked 26 major open source projects including Kubernetes, React, VS Code, TensorFlow, PostgreSQL, Spring Boot, and Node.js. The report includes methodology, limitations, repository snapshots, raw JSON outputs, and benchmark data. Happy to hear where the methodology is wrong or what could be improved. <!-- SC_ON --> submitted by /u/Some_Scientist5385 (https://www.reddit.com/user/Some_Scientist5385)
[link] (https://sushantverma7969.github.io/git-archaeologist/) [comments] (https://www.reddit.com/r/programming/comments/1u0va69/i_analyzed_26_major_open_source_repositories/)
Why I chose AOT code-gen over JSON/INI parsing for C configuration files (cfgsafe)
https://www.reddit.com/r/programming/comments/1u1ghlg/why_i_chose_aot_codegen_over_jsonini_parsing_for/

<!-- SC_OFF -->Hey everyone, I got tired of the usual configuration mess in C—manually writing tedious boilerplate to traverse generic JSON/YAML nodes, casting strings to integers, and writing a dozen if statements to handle out-of-range ports or missing environment variables. Worse yet, managing string lifetimes across nested configuration objects. To fix this, I built cfgsafe, an Ahead-of-Time (AOT) schema-driven configuration engine for C99. Instead of processing raw files at runtime, it takes a simple schema file and generates a type-safe, single-header library. I wrote a deep-dive engineering breakdown detailing the philosophy, memory model, and design choices behind it here: Type-Safe Configs in C99: Why I Prefer Code-Gen over Parsing And the github repo: CfgSafe How it works: Define a Schema: You use a simple DSL to declare fields, defaults, constraints (ranges, regex patterns), and sources (Env, CLI flags). Generate: The cfg-gen tool outputs a native C struct with matching validation primitives built straight in. Load Atomically: At startup, you make one call to Config_load. If a field is invalid or missing, it fails fast before your application's hot path even executes. A few specific architectural choices I made: Atomic Memory Pool: To prevent fragmented heap allocations and memory leaks, the generator bundles all incoming string/array values into a single contiguous memory block. Freeing the entire config is reduced to a single call to Config_free(). Zero Overhead Lookups: Because it compiles down to a native C struct, looking up a setting is just a basic memory offset rather than an $O(\log N)$ hash-map lookups or string comparisons. Compile-Time Safety & IDE Autocomplete: If you typo cfg.db.prt instead of cfg.db.port, the compiler refuses to build the app, and your editor knows exactly what fields exist and their data types. Strict Layering & Security: It bakes a strict precedence chain (CLI Arguments > Environment Variables > INI File > Schema Defaults) right into the generated code, and automatically redacts fields marked as secret from auto-generated logs. I would love to hear your thoughts on taking an AOT code-gen approach to application configurations vs. traditional runtime parsers like libconfig or json-c! <!-- SC_ON --> submitted by /u/Creative-Cup-6326 (https://www.reddit.com/user/Creative-Cup-6326)
[link] (https://aikoschurmann.com/blog/type-safe-configs-c99) [comments] (https://www.reddit.com/r/programming/comments/1u1ghlg/why_i_chose_aot_codegen_over_jsonini_parsing_for/)
To handle performance issues, Integrate Redis with Spring Boot instead of scaling servers
https://www.reddit.com/r/programming/comments/1u2xzzk/to_handle_performance_issues_integrate_redis_with/

<!-- SC_OFF -->A lot of developers rely on scaling servers to handle performance issues, but often, the real bottleneck is just fetching the exact same data from the database over and over again. If you are dealing with read-heavy APIs and want to reduce redundant database queries, Integrate Redis caching into a Spring Boot application using Spring Data Redis. A lot of developers manually manage cache states, but Spring’s cache abstraction makes it incredibly simple to handle with just a few annotations on your service layer. If you want to see the full implementation including the application properties configuration, the Redis Cache Manager setup, and the complete REST controller code, you can check out the full write-up here: Implementing Redis Caching in Spring Boot (https://javatechonline.com/spring-boot-redis-cache-example/). <!-- SC_ON --> submitted by /u/erdsingh24 (https://www.reddit.com/user/erdsingh24)
[link] (https://javatechonline.com/spring-boot-redis-cache-example/) [comments] (https://www.reddit.com/r/programming/comments/1u2xzzk/to_handle_performance_issues_integrate_redis_with/)