Professional code
Hello, I am a self-taught front-end developer for my day job but also have been working on personal game projects for about 5 years on and off. I have a dream of starting my own game studio one day.
So far the few game companies I have applied to rejected my applications saying that my code is not at the level they are looking for. I can find no feedback or any professional-grade code so I can study how it should be. I want to get better and working tirelessly towards that but where I am, I feel like I am flying blindly.
I have been learning about OOP, architecture, design patterns. Also I have been trying to structure and organize my code, decoupling as best as I know how to, trying to stick to SOLID principles. I have even started watching online Computer Science classes from Stanford Uni. etc. to eliminate the possibility that I am missing some perspective taught in college (I have an electronics & communication engineering bachelor, not too far from CS like civil engineering etc.)
I really want to know how "very high-quality code" looks and gets coded. Do you have any advice, pointers, resources regarding this problem?
Edit: I am adding my code as well, if you want to comment on it please don't hold back any punches #roastme I just wanna get better.
https://github.com/basaranb/interview-project
Edited 16 Apr 2021. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 2 · 100% up
- Kind
- Text
- ID
- ms1op4
18 comments
It's difficult to answer this, as it sounds like they didn't give you enough information about what they're looking for. Next time perhaps ask for more details.
However, as an interviewer reviewing code for "professionalness" I'd be looking for a consistent style (eg naming conventions, indentation, commenting), self-documenting APIs, reasonable use of the standard library where appropriate, not overly duplicating code.
Perhaps if you can share some of your portfolio examples here, someone can give you a quick review and some more useful feedback.
I am asking for details all the time. You know how interviews are. If you are not useful for them, they usually don't even answer your emails.
I wasn't too careful about the indentation, commenting, naming, etc. Those are the things I can easily fix with a little bit of time.
I am more concerned about the structural, architectural aspects. Things like is it decoupled enough? Is it against the SOLID principles? Did I use a public variable while I should have used a private variable + property?
I looked at your GitHub repos and most of them seem to be learning projects or empty. You have some python projects but even some of them seem like tutorials that you have gone through. If your goal is to do unity game development it appears like you only have about one project and it looks like that is a tutorial as well. I'm not sure about this but if it is they can you have to display your work. I wouldn't even have the tutorials on your public GitHub at all. I believe it would help if you add more unity projects to your portfolio as of now it looks like you have the one only.
Thank you for your comment. I don't pay too much attention to my Github actually. I have around 50 repos but all the professional projects are either private or located in the private company repos, Bitbucket or Gitlab. You are right cleaning up the tutorials and adding my game projects there might be better.
Feel free to post some of your code for critique, perhaps on Github or similar.
I notice you've not mentioned which languages you used, or which technologies. Using the right ones is non-negotiable if trying to get into games.
Thank you for your answer. I am working with unity using C#
Of course, here is my code. Please don't hold back any punches #roastme
https://github.com/basaranb/interview-project
Okay, I'll give a quick rundown of the problems I see here:
private.Ball.durationAnimis private but you don't declare that. Below there you haveBall.rigidbodywhich does explicitly declare it. Be consistent (and ideally, explicit).StopSpwning. Spell-check everything. Attention to detail is crucial in game development.FindObjectOfType- again, many games companies will do this, but they know it's bad, because it's slow, and will get slower as the scene gets bigger. Ideally you would 'wire up' these references in the scene ahead of time.Utilities.RandomizeArraycan only take aColor[], even though there is nothing in there that is specific to Color. That is a clear example where a generic function would be better. And I forget whether C# arrays derive from IList or not, but if not, it would be good to have an overload for generic ILists as well.child.GetComponent<Rigidbody>once to see if it exists, then you call it again to execute a method on the return value. What if GetComponent is a slow operation? Store results like this in a variable, partly so that you're not writing out long expressions repeatedly, but also so that you're not executing the same expression twice unnecessarily.Are you applying to studios using Unity? You imply several applications, and well there aren't that many studios that use unity/C#. Most AA and AAA is C++.
This might be the case for the very top end of the market, but there's a very long tail of smaller studios, indies and mobile developers using Unity - a lot more of them than Unreal I would think.
I go for mobile studios. Enterprise culture is not for me. AAA work culture seems quite toxic to me with crunches, poor deadlines and burnouts.
Indie studios have all of the above as well, so be warned! And AAA is not as bad as it used to be. It varies on a case by case basis. Read Glassdoor reviews to get a feel for a place before applying.