Posts

Showing posts with the label habbits

ach - why we do not put attention to what we are doing???...

Image
 Ach, humans don't want to be fast, they just CTRL+C and CTRL+V, shit over shit, but it is working so what do you want a...!!! see this snippet: Is there anything suspicious for you? NO??? Yesterday I was reading Aaron Stannard blog entry about DRY and above snippet just jumped at me from the corner of my screen.  DRY DRY DRY. Now: what's wrong with this one? It is not human friendly (formatting) It is not CPU friendly as there are two string interpolations instead of one we could introduce a helper variable to make it nicer to read (and this is a bit of WTF -  see below) So what we can do with this? Firstly use a single interpolation with a proper formatting like {date:MMM-yy} , this will do the job nicely and we don't need to decipher two statements to get the output when reading the code, now we also could format it a bit, so it is not spread on the wide screen edge to edge... So what do you think about this: Looks better? For me this is true, but is...

github time travelling explained (it is not what you are thinking about)

Image
Do you know how much freedom we got by having git? I am always amazed by reviewing pull requests where there is confirmed by a developer only one commit. By confirmed, I mean that I asked a dev if there was more of them, but mostly it is the only one that is pushed to the PR (sometimes there are 2 or 3 as the branch needed to be adjusted with the main/master one). That situation can bring a few issues: There is a risk that all changes will be lost when a device that is in use will have a big boom and there will be  commit/push to the remote/global repo There is no restore point, which is helpful to try/test different solutions, CTRL+Z not always works as a charm  Pushing code, in most cases, means that it will trigger CI/CD pipeline and find any issues early As git is giving us very fast commiting experience (it is not a slow VPN connection to TFS, it is local repo) then you can be as extreme as crazy to commit every 5 seconds. So that means we are recording most actions, espe...

are YOU a garbage collector?

Image
 If I will ask you: "Are you a garbage collector" - I bet I will hear: " NO ", so I ask you: show me your code.... It is unbelievable that so many developers are pushing changes with commented out code, because  there could be a chance to re-use that piece. In fact that time never comes to me and the lines stays there forever. Clean code means no rubbish commented code - we have git to remember that for us. Now, when you need to comment a few lines in a row... there are better solutions, but if someone is lazy and slumsy then we can see diffs on code review like that: Now this is a mystery for me, when I am able to see that this is going to the main branch as the guys who is called code reviewer is there only to click Approve -  I am truly believing that it is not you my reader. I need to admit that, when I was a kid, together with grandma we were collecting garbage as a way to get some $$ for a life and then every piece we found had a material value and were able t...