I've just finished my second year of university and feel comfortable with basic programming concepts. I can usually understand a problem, choose a data structure, and describe an approach in pseudocode, but I struggle when I have to turn that plan into working code. Sometimes I understand the solution but get stuck on the exact syntax, especially when examples use language features I haven't seen before. I mainly practice in Java, although I've also used Python for small projects. How did you improve at writing programs from scratch and becoming familiar with new syntax?
5 Answers
Don’t wait until the entire program is written before checking it. Implement one small piece, print or inspect the values, and test a few simple cases. Small sanity checks make it much easier to find whether the issue is your algorithm, a variable update, or a syntax mistake. Keeping the code modular also lets you test individual parts instead of debugging everything at once.
LeetCode can help with algorithmic thinking, but it shouldn’t be your only practice. Try building small projects in Java that use one concept at a time, such as a command-line tracker, a text-based game, a file organizer, or a simple API client. Projects give you practice with program structure, debugging, and connecting multiple pieces of code, while focused exercises can help you strengthen one data structure or technique at a time.
Make sure your pseudocode is detailed enough to describe an actual solution, not just restate the problem. Write each operation step by step, including the loops, conditions, variables, and updates. If you can follow those steps manually and get the right result, translating them into Java becomes much more straightforward. If you cannot, spend some time practicing the basics—variables, methods, arrays, loops, and conditionals—before tackling harder algorithm problems.
Syntax mostly becomes familiar through repetition. Try solving a problem yourself first, then study the solution and identify the language features you didn’t know. Afterward, rewrite the solution in your own style and create a small variation of the problem to solve without copying. Looking up syntax is completely normal; the important part is understanding what the code does instead of pasting it blindly.
I’ve been trying not to rely on solutions or AI too quickly because it makes me feel like I’m not improving. I’ll focus more on studying the unfamiliar parts and then rewriting them myself.
A useful workflow is to write the whole plan as comments inside the file. Start with the requirements and edge cases, then list the high-level approach. Expand each step with more detail until you can place the actual code underneath it. Leave the comments in place as a map while you implement the solution. It takes longer at first, but it helps prevent the empty-file paralysis and gives you a clear path from the idea to Java code.
I like this approach because I work better when everything is structured. Even if it takes longer, having the outline there would make starting much less intimidating.

That makes sense. I think I sometimes call a description of the problem pseudocode when it isn’t detailed enough. I’ll try breaking each solution down much further.