Open EloiStree opened 5 years ago
Watch a very good resume of it: https://youtu.be/HZJxjlvBbVA
https://youtu.be/RN40pTHyuQw?list=PLH1fn6y2samt0xfBGC26-1M3pzPImN3p2
A clean code is a code that is so good that people don't need to access it
If you use the LOD of Unity, you will observe that it is so well design and simple. That it can't but and is easy to understand. For this, no body will go in the code to check what is behind it except by curiosity or re-engineering.
One day a support phone had 10, then 100, then 1000 of call per day... And after weeks that the team did try to fixed the issue by hiring more and work on the workflow to filter the client problem. At the end someone propose to fix the problem... And since then, no call anymore.
Wiki: EN
// Access Input Data
// Verify Input Data
// ComputerThe[Object]Position
// Apply Offset to the Input
// Flush And Close Created Object
AccessInputData(...);
VerifyInputData(...);
ComputerThe[Object]Position(...);
ApplyOffsetToTheInput(...);
FlushAndCloseCreatedObject(...);
Find some state machine tool:
https://assetstore.unity.com/?q=state%20machine&orderBy=5
Tutorial on how to use Bolt and Play Maker
To be trustful, I don't know what is the point of view of an artiste on a clean asset. Here are some clues. But in resume. Care of the asset and how it will be use by other.
The method is simple. Put some soft porn in the scene you are working in. It guaranty the scene to not be published without last checking from the team.
Add "Weird Easter eggs" in full sight and some water mark ("InDevelopment") over textures
Instead of hiding problem or try to corrected when you should not. Just send throw new System.NotImplemetedException("Don't publish without finish this code part");
Or send a DebugSound.PlayWindowXPSound();
Add some Unit Test that are blocking in development and automatically removed in build versions: Asset.CheckSomething()
Don't fear them. you are doom to make the same mistake that your elders.
Tutorials and link on design pattern
You can find a draft check list here of some patterns to learn
In the old day. They were not debugger. And when coder were introduce to the concept. They did not understood the meaning of it. Because code should not be improvise or bad in the first place !
If you want to feel what they means by code should not be bad in the first place. Try to make a game in Unity without the editor and/or by waiting 10 minutes between each build... !
Or try to compile with Oculus Integreation or Hololens UWP Applicatoin 😅
"The art of computer science is too lose a huge amount of time to help other in winning countless small amount of time." (#Mom, Christine Louette)
For me a "clean code" is also a code that will allow you to scope in short amount of time where is a specific bug and correct it easily without have a fear of breaking every thing. (PS: I love "event"... But they are the worst! Just because they don't have stack to follow form where they come)
PIANo TV is a tester tool to not make lose the time to programmers by taking time to understand fully the bug you want to notify to the developers Play, Identify, Amplify, Notify... optionally test and verify.
About the job: https://youtu.be/JIYTR_zZv_w?t=69
How to acces the job: https://youtu.be/ek9ZRPHRRtk
Look at: Cucumber, Selenium, TDD, BDD, Unity Test...
https://youtu.be/RbSlW8jZFe8
“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live” ― John Woods
One main reason of learning to write clean code is simple: Bad code kill companies !
> It is my point of view not the true< Try to understand this line without looking at the code: Utility.Orange.IsPress = true; vs Utility.orange.SetPress(4);
// I JUST SAID DON t LOOK THE CODE ;)
public class Utility {
public Orange { get; set; };
}
public class Orange {
public bool IsPress { get; set; };
}
var vehiculeFound = GetVehiculeFound();
//vs
VehiculeWithWhell vehiculeFound = GetVehiculeFound();
// Don't be fucking lazy... Or go do some PHP / Javascript 🙄.
//PS: I know it is a bad example as GetVehiculeFound() should be more expressive in its intent.
// But I read this shit too much... to not notify it.
Clean code and efficient code is not the same, but take in mind that it is important to most of us.
I love this one. But it is more hard that is seem To Do: Try to explain it in more detail.
1. Avoid messy spaghetti code 2. Push developer to create asset reusable from project to project 3. Avoid people to mess around your code but let's them watch
Every package should at least have this basic structure or something like this. It is not a rule but it helps your users to understand how to use your tool without documentation
Download my tool: Remidner Critere d'évaluation d'ergonomie.pdf
Negative cycle of rushing features and deathlines
Long live to SCRUM on this one If you find yourself coding the weekend to fit a need on the application. The scope is to big and the planning not well setup. The accumulation of the work, the sleep depth and the rush will automatically lead to dirty code.
Inheritance and Composition has same goal to assist in reusing tried and tested goal their choice brings different challenges. Composition provides better way to reuse code and same time protect the class you are reusing from any of its client Sometime though Inheritance is necessary, mainly when you are creating class from same family
If you are asking yourself this question:
This post is just a reminder of subjects that can be learn to improve your skills in writing "clean code". And it is just some clue based on my point of view.
Good learning to you. And may the code be with you.
For me clean code is not something that can't be "teach". It is something we practice by failing.... Failing a lot... And then failing more.
And at some points, you will be able to smell bad code and avoid it instinctively.
At that point only, you will be able to learn or to be taught how to write good code. Because you will be ready to listen and you will have fail enough to see what the walls to avoid are.
When you are going to be in this situation, you will be interested to read those books:
Just a remind for the young developer don't be affair to write shit.
You will always find dinosaur that have 20+ years of experience in coding.
That why they can write "Clean code". Don't try to compete, just have fun 😅.
Good luck.