What are you working on, /g/?Previous thread: >>107840984
>>107873347feel free to explain how applying design patterns before any implementation is better, especially in the context where someone is asking about design patterns the first place, which implies they have no experience with them>refectoring is somehow just renaming bunch of functionsdo you think renaming is all an IDE can do?
I implemented a better pruning algorithm for my text generator. I prune the top percentile of contexts by "cost" where cost is (roughly speaking) the ratio of the size of the context to the probability it is to be selected. The issue I'm running into now is sometimes the pruning process fails due to OOM. Pruning is triggered when the process hits its memory limit, but pruning itself requires a small amount of memory (removing a token from a context requires creating a new copy with the token removed, then freeing the old one), I currently work around this by reserving a small amount of memory that can only be used during pruning, but due to fragmentation even this will fail occasionally. I'm not sure how to work around this other than by gradually bumping the memory limit on OOM during the pruning process, but I want to be able to hard-limit the memory usage. Maybe some kind of compactifying allocation scheme could work? Like instead of using pointers to separate context objects, I could use keys in a map, and on OOM I could iterate the map to compactify several contexts together, thereby reducing fragmentation. I think it would work but makes everything more complicated (entries in the map would need to be tracked whether they're part of another allocation, etc.)
>>107877044>shit on runtime, good on memorydon't be stingy with caching or otherwise keeping things in memory, recalculating will always be slowerthis is what ram usage minimalists seem to never get
>>107874369Just got to OOP in the roadmap on the courses I'm followingEveryone kept telling me how scary OOPs but it's fun so farstill kinda new in programming and learning it currently using C++
>>107874369I lost all interest I had for programming. I used to care so much about the language, the editor, the dev environment, algorithms, etc. Now I just do whatever solves a problem with the least effort from me.
>>107877892You've grown to be a good code monkey.
>>107877850OOP doesn't get scary until you have to change something structural in a large-ish object oriented codebase. Or just have to get to know an unfamiliar code base and having to jump around all over the place, to get the details of what's _actually_ happening.
I made this srt translatorhttps://aisrttranslate.vercel.app/you can try uploading any srt and see how the translations come out. I’m curious what you think of the quality, usefulness, and overall experience.tested the translation with english, arabic and french and results aren't that bad, not sure how is the output with the rest of the languages though.
>>107876408>Pruning is triggered when the process hits its memory limit, but pruning itself requires a small amount of memoryAllocate the resources you need for your program to work correctly.>Optimising my program to require less resources is hard!Yes, what'd you expect?
>>107877746>recalculating will always be slowerNot true. Not always. Memory is slow. Processor is fast. Sometimes it can happen that the processor just sits around waiting for data to be read from memory, when it could have recalculated from cache and gotten on with the job a long time ago. It's a difficult and complex topic not suitable for broad generalisations.