Friday, November 20, 2020

Productivity Tips for Software Engineers

 If you are not following Scott Hanselman's youtube channel, you should. You will get to learn new things among them some productivity tips as well. Here is his recent video. 



Some comments under his videos which gives some more insights. 



"Programming is hard"  

Some people will give you the impression that it's easy, I guarantee they have struggled at some point. Don't worry if you're not as good as the people you watch on you tube or at work. You will get there if you stick at it. The difference between a beginner and the coding gurus? 10000 hours practice.  

"Break things down"  

When I am tackling a complex issue, I have to break it down into small pieces, then I just try to get one part working. Success in solving a small part of it gives you enthusiasm for having a go at the rest of the problem/feature you're working on. Break it down into the smallest part you can and just get that bit working.  

"Automate all the things"

If you are working on a product or website and notice you are repeating actions on your computer, see if you can automate it with a script. I have scripts that move files around, build the solution, clear the database down or whatever I need them to do to make me not only move faster but also eliminate the boring stuff allowing me to do the enjoyable work. Also, writing scripts is wonderful because you actually solve a real problem that you have and you see the benefit from your code.  

"Continue to learn" 

Even after doing programming for 15 years, I am still watching pluralsight courses, watching you tube, reading books on a wide array of languages and ways of working. I may never need the language or technique I learned but knowing what is out there and what these tools/languages are capable of is a massive win.  

"Don't be afraid to ask for help" 

Even people like Scott Hanselman have to ask for help sometimes. Don't worry what people think of you if you have to ask for assistance, it's all about learning and knowing when you're really stuck and need help from a friend or online source. Having a chat about the issue and explaining it to someone works wonders for your own understanding and often you see the answer while you're trying to explain it to someone else. Hope this helps someone. 

Happy coding.

 

Things I think about:  

- It's not just me. Videos like this prove that everyone feels this way at some point and there are things we can do to help each other. 

 - Go for a walk / have a bath. I don't have a rubber duck to talk to (maybe I should) but sitting away from the PC and sounding out what the problem is normally helps me to find the solution quicker. 

 - Environment. Especially with us working from home at the moment, make sure there is a place you work and your family know that, if you're there, you're working and you can't really be disturbed. 

 - Give it up for the day. Some days we just can't do it, our mind isn't right, something else is eating at us and we just have to think "It's not happening, come back tomorrow" and do one of those jobs around the house you've been putting off for ages or sit and watch that box-set for a bit. You can't force it to happen; 

 - Most importantly, IT'S NOT JUST YOU.! I know I'm repeating myself but it's worth repeating. Everyone feels this way from time to time, some more than others. You've not failed if you feel this way, it's part of what we do As Scott says, this job is hard, it's a lot of concentration sat in the same place for a long period of time. Give yourself a break!

 

This is such an interesting and multifaceted question. There are so many different types of overwhelm and I think each one has its own cause and own solution. In the most general sense, I find the following have really helped me. 1. Try not to compare yourself to others. Only compare yourself to who you were, and don’t be afraid to give yourself some credit. 2. Look to learn from others and adopt there good habits. You’re positive attitude will not only help your team but will foster a healthy learning mindset on your technical journey. 3. Take a breath and realize that you don’t become a coding ninja, guru, whatever overnight. These things take time. You build up your skills incrementally, and soon you will be vastly superior to where you were before. 4. Realize everyone has struggles, self doubt and frustration when working. These things are completely natural. The greatest minds in the world have struggled with these issues. You can draw confidence from this, as you share this experience with some of the greatest people who have ever existed. Worries do not show something is wrong with you, they show you are on the right path. 5. Cover your basic health needs as best you can. Sleep, nutrition, breaks, conversation, training, relaxation. These are all pillars of your health and will affect your performance. 6. Sometimes when I’m overwhelmed I try to remember why exactly I’m doing this. Not the shallow reason (my boss told me to/for a pay-check), but because I love technology and what it enables. The innocent pursuit of what you love is a great reminder of what really matters. Let all other pressures decrease, and you may find your performance increases when you are at ease.

 

 

 

Wednesday, November 04, 2020

Setting up your Windows Terminal (powerline)

As more and more developers adopt the terminal, it becomes important to bit improvise the experience. 

Scott Hansleman don't need introduction to many programmers. Recently I came across his blog post on beautifying the Windows Terminal. 

 Here I am posting the steps for quick reference. Install Windows Terminal and Git for windows.

For Windows Terminal

 1. Download Cascadia Code font from https://github.com/microsoft/cascadia-code/releases

2. Using Windows Powershell Install Posh and Oh my posh.

Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
 

3. Install PSReadline

 Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck

4.  Open your PowerShell profile

$ notepad $PROFILE

5.  Add the following lines to your Powershell profile at the end of the file

Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox

6. Set Cascadia Code PL as PowerLine font, by editing Windows Terminal Settings and add 'fontFace' and it looks like this

{
    // Make changes here to the powershell.exe profile.
    "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "name": "Windows PowerShell",
    "commandline": "powershell.exe",
    "fontFace": "Cascadia Code PL",
    "hidden": false
},

7. For Visual Studio Code terminal, Go to File > Preferences > Settings and search for 'Terminal integrated Font Family' and set it to 'Cascadia Code PL'.

For Ubuntu on WSL2

1. Open Ubuntu in Windows Terminal WSL

2. Run the following commands

sudo apt install golang-go
go get -u github.com/justjanne/powerline-go

3.  Open ~/.bashrc using nano and then add this to end of the file and save it.

GOPATH=$HOME/go
function _update_ps1() {
    PS1="$($GOPATH/bin/powerline-go -colorize-hostname -error $?)"
}
if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then
    PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
fi

 Remember not to add white space around "PS1=". 


For more detailed explanations you can read his blog here : https://www.hanselman.com/blog/how-to-make-a-pretty-prompt-in-windows-terminal-with-powerline-nerd-fonts-cascadia-code-wsl-and-ohmyposh . You can also follow this tutorial from microsoft website from here: https://docs.microsoft.com/en-us/windows/terminal/tutorials/powerline-setup

 He also has a nice youtube video explaining how to set it up. 

 

Also use this link to read about setting up Ubuntu prompt : https://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html

This will definitely improve experience  working with the Terminal in windows. Other thing to note is that Oh my Posh V3 beta is here https://github.com/JanDeDobbeleer/oh-my-posh?WT.mc_id=-blog-scottha#themes , keep an eye on the developments of this and adopt the V3 when it is releases.


Sunday, November 01, 2020

Some Useful webbased tools

1. https://squircley.app/

2. https://codepen.io CodePen Editor

3.  DartPad.dev.

Ages of JavaScript

 Recently I came across a nice handwritten infographic showing different ages of JavaScript. JavaScript and associated frameworks have evolved since 1997 and this infographic clasified it in 2 ages of 10 year each duration. What do you guys think what lies ahead this decade?

 

Source: https://twitter.com/swyx/status/1263123032328925186