Do people say 有能力  or 有  的能力 I've always been a bit confused about the order of using 有能力 and I'm hoping someone can clarify. Do people say "有能力 do something" or "有 do something 的能力"?

For example, could I say "他没有能力写代码？”
Both is correct. Yay!

Think "I'm ABLE to code." and "I HAVE THE ABILITY of coding."