Settings

Theme

I cannot turn my solutions into code

2 points by mintsuku a year ago · 3 comments · 1 min read


I have a interesting but not so unique issue: I am great at problem solving, and when I do program my solutions I come up with rapidly do in fact work, however I have an unreal amount of difficulty making my solution into syntax. I don’t know how to get better at that. It’s incredibly frustrating when I have an amazing solution and it’s taking me forever to imagine it in syntax, I do have a good and clear idea of how the data will be stored and what functions it’ll move in and a lot of different parts of it are held in my brain but then language syntax trips me up and it becomes “how do I do this in this language?”.

PaulHoule a year ago

Taking your statement at face value I'd be tempted to say it's fair to ask an LLM how to do small things at the "few lines of code" level. For instance if you're not sure how to get the length of a string in language X or don't know off the top of your head how to use CSS to move an object a few px higher up without changing the layout of everything else it might be quicker than asking Google, looking at the docs. I do it a lot these days.

My first instinct though is that struggling people often have poor insight into their problem. When I was teaching physics I heard "I understand the concepts but can't solve the problem" a lot. Invariably when I'd help the student debug the problem solving process I found that they didn't understand the concepts.

  • mintsukuOP a year ago

    This is very interesting and I appreciate your insights. Perhaps for a moment I can share to you the problem I am trying to solve, and do this sort of debugging you mention. I will try my best to make it as language agnostic as possible.

    I have an array of bytes (u8’s) (let’s just say integers for now). The first 8 bytes is the signature of that particular sequence of bytes. I compare and check that signature (if it’s not there or doesn’t match the signature I am comparing it too) then we exit the reading operation.

    The array of bytes / integers insist to communicate information through 4 byte sequences. So after reading the signature, I would collect the next 4 bytes. I take those bytes and read them, these 4 bytes indicate the length of the upcoming data segment, the next 4 bytes after that contain the data segment type. I read this to determine the type of data segment I am dealing with.

    The next read operation is preformed using the length I gathered early. Let’s assume the length said 15, so after reading the data segment type, I read +15 bytes, and store them in some data structure (A Vector). After this, the next 4 bytes mark the end of the data segment. Rinse and Repeat.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection