I have been programming for over 15 years now. I consider myself a very good programmer, but I understand (like all of us) there are things that I need to work on. One of these things is code repetition when dealing with conditions. I will give a generic sample:
The post-installation disk footprint hasn't changed much. In version 0.99.1, it was 979 MB. Now, it is 959 MB. That's just 2%. Also, PowerToys fills the disk with logs like crazy. Just look inside "\AppData\Local\Microsoft\PowerToys".
I have not verified if any of the fixes mentioned on the below article actually work.
Why Claude Code Eats All Your RAM (And How to Fix It)
There are at least four separate things that can eat your RAM, and only one of them is your fault.
The Four Culprits
1. Bloated Session Logs (The Silent Killer).
For 2-4 and more inluding the suggested fixes, see link
https://marceloretana.com/blog...aude-code-eats-all-your-ram
One of my PC's is Windows 11 Home Edition... and guess what? it supports Hyper-V Disks and Containers, as well as WSL2... which these desktop tools leverage on an as-needed basis. It does not need to be enabled system-wide; it merely needs to exist.
Furthermore, I tried something yesterday with Hermes Desktop and their "installer" actually builds everything from source as part of its installer toolchain! The installer (and updater as it were) both go through a roughly 19-step process to prep the system for the tool to be used -- and connectivity to local/remote models, local/remote agent configs, and other steps are not included as part of this process (those are all user config steps post-install).
ALSO, the "bug wasn't confirmed to exist" is the weakest argument against a bug. That's literally every flawed product's knee-jerk reaction! Even politicians, lawmakers, murderers, and other violent criminals start with that defense... "I deny everything I'm accused of."
The bug is the (shared) experience. Whether it's truly Claude Code's fault, or user error, or some other software package being the ultimate culprit, is not the point. They are experiencing unpleasant side effects and don't like that.
Question
xWhiplash
Hello,
I have been programming for over 15 years now. I consider myself a very good programmer, but I understand (like all of us) there are things that I need to work on. One of these things is code repetition when dealing with conditions. I will give a generic sample:
if(condition1) { //perform some logic if(condition2) { //perform some logic if(condition3) { //Perform logic } else { //MethodA(param) } } else { //MethodA(param) } } else { //MethodA() }Now, I cannot make it easy by doing the following:
if(condition1 && condition2) { } else { }I cannot do this since I need to perform some logic if condition1 is true and before I test condition2.
Is there a way to structure if...else blocks to where if you need to call a method in each else blocks, you are not repeating yourself?
Link to comment
https://www.neowin.net/forum/topic/1226783-avoid-code-repetition-in-conditions/Share on other sites
80 answers to this question
Recommended Posts