Technology
Tech and Tips Thursday: Writing Better Code, Taking Screenshots, Antimanagement
This is the fourth edition of our Tech and Tips Thursday series. Today we will be talking about the Go language, and how to get started quickly, learning how to take screenshots on a Mac and exploring the idea of how to write better code.
Welcome to the fourth edition of the Tech and Tips Thursday series. Today we will be talking about Go language and how to get started quickly, learning how to take screenshots on a Mac, and exploring the idea of how to write better code.
About T&T Thursday
Tech and Tips Thursday (or T&T Thursday for short) is a biweekly technology and tips article on various software development, technology and productivity topics. Topics that we are interested in have some experience with and topics that we find interesting outside of technology.
T&T Thursday article follows a standard format. It consists of three sections:
- One Coding Example
- One Useful App or Tool
- One Interesting Idea or Thought
One Coding Example
Go is a programming language developed by Google. It is open-sourced. Golang, as it is known, is designed to make it easy to build simple, reliable and fast software. It is a statically typed language similar to the C programming language but with memory management and garbage collection.
What types of apps can you build with Go?
Because of its flexibility, Go can solve a lot of different problems. You can use Go for system programming, analytics applications, financial tools, big data, machine learning, audio and video editing, and more. Its main claim to fame comes from its multithreading and concurrency capabilities.
Go Example
Here's a simple example of how to write a hello world program in Go.
package main import "fmt" func main() { fmt.Println("Hello World!") }
Put into a file called hello.go and run it with the go command:
go run hello.go
This is a pretty simple example. Here's another example of Go to give you more of a taste for the language:
package main import "fmt" var i, j int = 1, 2 func main() { var c, python, java = true, false, "no!" fmt.Println(i, j, c, python, java) }
Here is a list of awesome go libraries and frameworks that you could use in your Go project.
Learn more about Go at Golang.org
One Useful App
If you are using a mac, you might be familiar with shortcut keys to take screenshots. One of the most used ones is cmd-shift-4. This shortcut allows you to take a screenshot of a section of the screen.
The screenshot functionality of OS X comes from the little-known application buried in the Other folder of your applications. This application is called Screenshot.
Screenshot allows you to take screenshots, just like using the shortcut keys. It can take a screenshot of the app window, the whole screen, or a selection.
It also allows you to record videos of your screen. There are options for setting a timer (when to begin the recording), hiding or showing the mouse cursor and saving those screenshots.
It is one of those hidden gems that you will start using all the time once you know about it.
One Interesting Idea or Thought
How to write better code? That is the ultimate question all programmers have asked themselves at some point in their life. There are articles and books written on this subject. There are courses for all levels that claim to make you a better programmer in one way or another. There are gurus proclaiming the use of this framework, that language or these techniques.
In reality, all of these answers are right. Because there isn't one way to write better code. There are many ways to write better code.
Perhaps many people know the primary reason behind Jerry Seinfeld's success. Here it is: Jerry Seinfeld writes one joke per day, every day. He has been doing that for decades now. It's not only Seinfeld. Babe Ruth used to practice swinging in his basement every day. Kobe Bryant was known not to go to sleep until he had the opportunity to take a few shots on the basketball net. Famous writers like Stephen King write every day, even if it's just one line. Advertising people create one ad each day for any product they see.
The list goes on.
So how do you write better code? While there are many right answers. There is only one useful answer. To write better code, you have to code every day.
Until next time.
If you liked this installment of Tech and Tips Thursday, please be sure to subscribe and share it with your friends and colleagues on your favourite platform.