I have paid for Anthropic Claude, and I'm bloody sick of it, I regret it.<p>I have been learning C in my spare time, doing the NandToTetris course and implementing my solutions in C. This has been great for learning.<p>I got stuck on a regex problem and <i>JUST</i> wanted to know how to do a particular regex for interpreting an expression. I struggled to find resources on C-style regex.<p>Heres exactly what I asked Claude<p><pre><code> Can you write a C language regex, using regex.h, just to split the following structure on "=" or ";"
<DEST>=<COMP>;<JUMP>
Only comp is mandatory so you could get any of these combinations:
dest=comp
comp;jump
dest=comp;jump
</code></pre>
Claude then proceeds to solve the entire assignment for me using the context to realise I'm talking about a NandToTetris assignment.<p>This really pisses me off, these fucking AI tools assume you want a full solution every time. I'm not here to maximise productivity, I'm here to LEARN! I just wanted a concise regex, nothing else. Pisses me off so much that I've cancelled my subscription.<p>I hope all this AI shit fucking fails and we go back to human-led programming.<p>Imagine a lecturer that did your homework for you.
Why not tell it, "I only want the regex, don't give me the entire solution. I'm doing this to learn, please don't spoil the assignment for me." Anyway, if you want to learn regex there are many interactive regex tools online that you can use to iterate on.
Yeah, you're prompting it wrong.<p>This was on the frontpage yesterday, and it's very true:<p>> <a href="https://simonwillison.net/2024/Dec/31/llms-in-2024/#llms-somehow-got-even-harder-to-use" rel="nofollow">https://simonwillison.net/2024/Dec/31/llms-in-2024/#llms-som...</a><p>You have to be very careful about how you prompt them. As others have said, if you want results that are limited in a certain way, or in a certain format, you need to add that instruction to your prompt. LLMs like Claude are amazingly versatile and powerful tools, and they're also very flexible in response to your input, so tell them exactly what you need.
I've come to prompt in this format and its working well for me. I once had your issue on another subject and it was indeed annoying.<p>"Claude - Im learning to program C - I wan't you to help me learn"<p>"I'm unsure what Im doing so can you walk me through the problem 1 step at a time? We can decide when to move to the next step but I want to be sure I understand each step as we go"<p>"Ok - I get it so far - Im ready for the next small step so we can discuss it"<p>You said:
Can you write a C language regex, using regex.h, just to split the following structure on "=" or ";"<p>I mean, it did exactly PRECISELY what you asked it to do - you asked it to write a program and it did! Never mind anything, how cool is that??