This weekend I released v0.4.1 of https://t.co/KIZhyvzkcY for parsing and comparing semantic version like strings;
[v]MAJOR[.MINOR[.PATCH[-PRERELEASE][+BUILD]]]
Minimalistic and performant, enjoy!
#golang
@vincic Goindex brings it's own cmd/index of Go code only; though the grab tool works on the linebased
FILE FROM TO
format, so tree sitter would be a good candidate to replace cmd/index I guess.
Just released v0.3.0 of https://t.co/ssRvmjV6UW ; package for calculating long durations and formating uptime in years, months, days hours, min and sec. Enjoy!
#golang
Wrote a .ini file parser in Go; https://t.co/fJWnC9V0Co reached 100% coverage and started removing duplicate tests. Then finally changed the design and ended up needing only 1 example test and still have 100% test coverage. Line width < 80 and cyclomatic-complexity < 6 #Golang
I'm looking into the history of software diagrams; starting from late 1960's and early 1970's. Steve Crocker used a flow like diagram in RFC1, https://t.co/E6LvwyVODt . Are there other examples of diagrams that eg. use troff and Brian Kerninghan's pic?
@unclebobmartin@E13Mort Thank you for your response. In your experience which cleanup activity proposition is received with least friction?
"Let's increase test coverage!" has worked better than "Let's shorten line lengths!" even though I believe cleanliness is "quicker" achieved with the latter.
If you had to choose two source code metrics and enforce those on your projects, with the goal of producing clean code, which would you choose? @unclebobmartin
My choice are
+ line width <= 80 chars
+ cyclomatic complexity <= 5
@epragt@unclebobmartin The cyclomatic complexity limit or line length works as a better tool to reach a more clean code in my experience because it's a limit on the code itself. Focus to improve the code first and the test will follow. Don't get me wrong, I'm a 100% test coverage advocate :-)
@epragt@unclebobmartin in my experience it does not. People tend to focus on writing more tests to reach the set limit. I.e. the effect is not quite what I wanted.
@epragt@unclebobmartin It's only better if it leads to clean code; for me <80 is a significant enough constraint that forces me to think about function signatures, number of arguments and shorter names. 90 is a good number as any if it has the same effect.
@epragt@unclebobmartin The idea is not to call it good or bad; the goal is that the metric should lead to changing development habits in such a manner they lead to clean code eventually.
@vitaliykulikov@unclebobmartin Maybe; the width of lines has a lot of positive implications (imho);
1. you are forced to think about naming more carefully
2. number of arguments are limited
3. reviewing files side by side becomes easier
4. editing files side by side becomes easier
5. diffs are easily read