How to get better at writing syntax?

Hello everyone, I hope you’re doing good.

So I’ve been dealing with this problem a lot, where I know how to make this stuffs work, but don’t know how to put it on code, x

P.S. sorry for bad english
P.S. Been diving into code for about 8 months but also lack of discipline when practice code, sometime I learn to 6 hours, sometime I do nothing.

And my case, for example, CMIIW:

I know how to make modal with bootstrap. You need this API called show to become true by passing the state on onClick so API fired up. You can put this onClick anywhere, button, div, etc…

I know what is .map , it is a syntax to call all the array data, you pass an argument called data for example, and you can call it with data.something.myData

The problem is, I don’t know the syntax, I just know the basic one. I don’t know the advance or improved one. For example:

"Oh, I need this dropdown to contain all the data from array? Easy, first I use { => (<div> <Dropdown>{data.myData.dropdownList}</Dropdown></div>)} done!

or "I need to console.log inside this div HTML element. Since bracket is a wrapper, I just need to wrap console.log() inside bracket so it’ll become {console.log(something)}"

and “If I just write {myFunc()} the code won’t wait, I need to write {() => myFunc()} so the code will wait another data before it execute”

I always envy with my friend who can write and improve the code by just looking at “that” floating box on VSCode when you type a code.

Please give me some advice with my problem.

Thanks a lot

Two things:

  1. It gets better with practice.
  2. You will never remember everything. Google is a developer’s best friend. I have to google things at least 10 times a day.

So, don’t worry about it so much - just code and keep getting better.

1 Like

What kind of practice if I may ask? Coding challenge or build something? I already build a web app couple time (I know it isn’t good), but since mostly it is almost same (Login, Register, Download, etc…) it feels repetitive unless I improve mine like, let’s say login and register using Formik and Yup validation.

Yes, this is absolutely a must.

Guess you’re right, practice, practice, and practice and I’ll be better :smiley:

I mean practice just in terms of doing it. Just follow the course work, build things, etc. If you feel there is something you keep forgetting, write it down and test yourself. But don’t worry about it too much.

1 Like