Yes, it can both help you write it but also, if you start with the documentation, e.g. the comment describing what function does, AI becomes orders of magnitude better and actually helping write the function, so it actually forces developers to better document their code!