Actually curious. Does anybody adhere to everything put in the UE coding standart? What are the consequences If let’s say one ignores some/all of them
The professional (unlike the armature) knows when it’s the right time to break the rules. So, I guess it’s just like with any other coding standard: if you do not see the point in it and can’t estimate what the violation will cost you - you better follow it blindly or be ready to suffer down the road (more or less). And if you (more or less) understand what’s the point of all these rules and how they can help you - you can safely violate them if the need arises.
Epic coding standard is generally fine and undemanding, so you need some descent reason to use another in its stead. And coding with no standards is by no means a good idea.
Personally, I dropped this “public/private” folders logic for the core project code (still stick to in in most plugins, thou). And I use lots of stuff on top – like strict naming conventions etc. Works fine for me.
If you are new to coding, and new to Unreal, it will not be possible to follow all of the Coding Standard unless you have a senior correcting your code and enforcing it on you. That being said, you should read the standard and absorb its rules and follow the ones that you understand. After a year, you should review the standard. Lots of things you would not be able to understand from the standard now make sense to you. And you can then start following the standard regarding this new understanding, once you internalize the logic of it.
Breaking the standard intentionally is mostly fine - intentionally meaning that you just have a different opinion and your team and colleagues are fine with the house rule standard. For example, GribUser mentioned not following public/private foldering scheme. I am also quilty of this - I simply started a large project and was not prepared to understand the build system, modules, repos, libraries, and why this public/private folder scheme would have merit over lumping .cpp and .h files in the same folder. So I chose to create “topics” for Folders like Actors, Databases, etc. and those just have the .cpp and .h for each code file, and this works and so far there is no large drawbacks. For the next project, if I have extra time, I will look at YouTube and try to internalize the public/private folderization idea better and then enforce it. IDE expects it and it will become easier to follow once I understand the benefit. There are other areas where I failed to understand and follow the standard, and it has caused raised eyebrows as other coders joined the project even sometimes outsource workers and the first things they see is some non-standard coding practices. It’s no biggie, I would just explain it to them and let them know I was hasty and unaware and that’s the reason why I deviated.
Then there are things where I won’t propably care enough to start following some small part of the standard or I make some house rules. One is the “one liner” if blocks, I think other may be excessive use of ternaries. I will always write dumb lazy code in one line combining not only if (stuff) otherstuff(cacheSet ? cache : newParam()). I will create some macros which faciliate and make me work with smoothness and effortlessness, for debug purposes. It’s effective and works for me, so all I need is to convice the team that the benefit of the deviation is higher than the cost. Usually no one is too ■■■■ about the standard, but many can have irritations and pet peeves which are a bit different for most. That’s why we SHOULD just follow the standard, so we don’t need to fight and argue which peeves are important and which are not… But you certainly aren’t in any coding jail regarding it. Standard is just a template that Epic themselves uses, and likely the majority of UE devs in general, following Epics suit in the ecosystem.