5 ms·
Refactoring a critical function that is very large and complex. Yeah, maybe it shouldn't be so large and so complex, but it is and that's the codebase we have.
by walthamstow 2y ago
Refactoring a critical function that is very large and complex. Yeah, maybe it shouldn't be so large and so complex, but it is and that's the codebase we have. I'm sure many other companies do too.
- kamaal 2y agoThats not how apex productivity folks have used any IDE productivity leap including this one. You dont outsource your thinking to the tool, You do the thinking and let the tool type it for you.
- deleted 2y ago[deleted]
- walthamstow 2y agoYou're missing the step where I have to articulate (and type) the prompt in natural language well enough for the tool to understand and execute. Then if I fail, I have to write more natural language. You said just the same in another of your posts: > if you can begin to describe the function well So I have to learn how to describe code rather than just writing it as I've done for years? Like I said, it's good for the small stuff, but bad for the big stuff, for now at least.
- kamaal 2y agoExactly my point, you don't ask the LLM to give you the whole function. That would be too much English work, because that means you need to write down the contract of the function in concrete and/or list(list of lists). You ask it to give you one block at a time. iterate over the above list and remove all strings matching 'apple' open file and write the above list etc etc kind of stuff. Notice how the English here can be interpreted only way, but the LLM is now a good intelligent coding assistant. >>I think in code, I'd rather just write in code. Continue to think, just make the LLM type out the outcome of your ideas.
- walthamstow 2y agoSo you do in fact agree that the tool can only be trusted to do small chunks of basic action and can't be used to do anything heavy.
- kamaal 2y agoIt writes blocks of 50 - 100 lines fairly fast in one go, and I work in such block chunks one at a time. And I keep going as I already have a good enough idea of how a program could look like. I can write some thing like a 10,000(100 such iterations) line Perl script in no time. Like in one/two working day(s). Thats pretty fast. If you are telling me I ask it to write the entire 20,000 line script in one go, that's not how I think. Or how I go about approaching anything in my life, let alone code. To go a far distance, I go in cycles of small distances, and I go a lot of them.
- bluefirebrand 2y ago> It writes blocks of 50 - 100 lines fairly fast in one go, and I work in such block chunks one at a time. How many lines of natural language do you have to write in order to get it to generate these 50-100 lines correctly? I find that by the time I have written the right prompt to get a decently accurate 100 lines of code from these tools, which I then hage to carefully review, I could have easily written the 100 lines of code myself That doesn't make the tool very useful, especially because reviewing the code it generates is much slower than writing it myself Not to mention the fact that even if it generates perfect bug free code (which I want to emphasize: it never ever seems to do) if I want to extend it I still have to read it thoroughly, understand it, and build my own mental model of the code structure
- skydhash 2y agoAnd there’s the value of snippets and old code. Especially for automation and infrastructure tasks. If your old project is modular enough, you can copy paste a lot of the boilerplate.
- 2y ago
- ModernMech 2y ago> So I have to learn how to describe code rather than just writing it as I've done for years? If we keep going down this path, we might end up inventing artificial languages for the purpose of precisely and unambiguously describing a program to a computer.
- kamaal 2y agoYou mean logic programming? https://en.wikipedia.org/wiki/Logic_programming https://en.wikipedia.org/wiki/Logic_programming Its been around for decades. In fact this was the first approach to doing AI. In logic programming you basically write concrete set of test cases and the compiler generates the code for which the test cases hold 'true'. In other words you get a language to 'precisely and unambiguously describe a program', as you said. Compiler writes the code for you.
- deleted 2y ago[deleted]
- cess11 2y agoI've spent a lot of time trying to make Aider and Continue do something useful, mainly with Qwen coder models. In my experience they suck. Maybe they can produce some scaffolding and boilerplate but I already have deterministic tools for that. Recently I've tried to make them figure out an algorithm that can chug through a list of strings and collect certain ones, grouping lines with one pattern under the last one with another pattern in a new list. They consistently fail, and not in ways that are obvious at a glance. Fixing the code manually takes longer than just writing the code. Usually it compiles and runs, but does the wrong thing. Sometimes they screw up recursion and only collect one string. Sometimes they add code for collecting the strings that are supposed to be grouped but don't use it, and as of yet it's consistently wrong. They also insist on generating obtuse and wrong regex, sometimes mixing PCRE with some other scheme in the same expression, unless I make threats. I'm not sure how other people manage to synthesise code they feel good about, maybe that's something only the remote models can do that I for sure won't send my commercial projects to.