The idea that code that doesn't compile is not worth partial credit is wrong in academics. In the real world the code needs to compile first, of course, then run. However if your professors cannot look at your code that doesn't compiler and decide how much partial it is worth there is a problem.
That said, getting code to compile is a trivial part of the problem.