what is a good code? · what is a good code? about me bartek kuczyński aka koziołek...
TRANSCRIPT
![Page 1: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/1.jpg)
What is a Good Code?
![Page 2: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/2.jpg)
About me
Bartek Kuczyński aka Koziołek
Koziolekweb.pl
4programmers.net
Wrocław JUG
![Page 3: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/3.jpg)
How to define good code?
![Page 4: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/4.jpg)
Context
![Page 5: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/5.jpg)
They will pay for it
![Page 6: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/6.jpg)
It works
![Page 7: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/7.jpg)
Definition of work
![Page 8: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/8.jpg)
Code meets requirements
![Page 9: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/9.jpg)
Process(Scrum, Agile, RUP)
![Page 10: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/10.jpg)
Never ever realise crap
![Page 11: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/11.jpg)
Will thank you for it
![Page 12: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/12.jpg)
If you do code reviews?
![Page 13: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/13.jpg)
GerritCrucible
Code Brag
Github
![Page 14: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/14.jpg)
Pick good tools
![Page 15: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/15.jpg)
Learn new things everyday
![Page 16: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/16.jpg)
Lone wolves dies first
![Page 17: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/17.jpg)
public void writeFileToConsole(String path) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(path));
String line = null;while ((line = br.readLine()) != null) {
System.out.println(line);}
}
![Page 18: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/18.jpg)
public void writeFileToConsole(String path) throws IOException {
List<String> lines = Files.readAllLines(
FileSystems.getDefault().getPath("/", path));
for(String line : lines){System.out.println(line);
}}
![Page 19: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/19.jpg)
public void writeFileToConsole(String path) throws IOException {
lines(getDefault().getPath("/", path))
.forEach(out::println);}
![Page 20: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/20.jpg)
When you do it in bad way?
![Page 21: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/21.jpg)
Then you realise crap
![Page 22: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/22.jpg)
They will blesses you for it
![Page 23: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/23.jpg)
End of development
![Page 24: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/24.jpg)
Maintenance
![Page 25: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/25.jpg)
Good tests
![Page 26: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/26.jpg)
public void doSth(A param1, B param2){checkNotNull(param1);checkNotNull(param2);R resp1 = outService.askfor(param1);if(resp1.isValid()){
inServiceDao.save(new BDTO(param2));}
}
![Page 27: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/27.jpg)
What tests we need here?
![Page 28: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/28.jpg)
Flood of Unit tests
![Page 29: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/29.jpg)
Myth of 100% coverage
![Page 30: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/30.jpg)
Tests should tell a story
![Page 31: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/31.jpg)
Good documentation
![Page 32: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/32.jpg)
Easy to understand
![Page 33: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/33.jpg)
Sum up
![Page 34: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/34.jpg)
It works
![Page 35: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/35.jpg)
Technically good
![Page 36: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/36.jpg)
Has good tests
![Page 37: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/37.jpg)
Has good documentation
![Page 38: What is a Good Code? · What is a Good Code? About me Bartek Kuczyński aka Koziołek Koziolekweb.pl 4programmers.net Wrocław JUG. How to define good code? Context. They will pay](https://reader034.vdocuments.mx/reader034/viewer/2022042222/5ec80b66a5a558332b33db3b/html5/thumbnails/38.jpg)
Questions?