News: Lightbringer raises $10 million in Series A funding

Can I patent code directly?

No, the literal source code you write is protected automatically by copyright, not patent; a patent instead protects the underlying novel technical process or method the code implements. The two protections work together: copyright stops someone copying your code, a patent stops someone implementing the same process in different code.