# Programming

## Integer maths in Go using constants with exponential notation

I seem to learn more about the nuances of the Go language every other day. Sometime back, I had looked at how Go untyped constants work during maths operations with typed variables. I just found another significant part of the spec that I had previously glossed over, this one is also about untyped constants - numeric constants in Go live in an unified space with arbitrary precision and a fungible numeric type.

## Go Static Typing 'Magic'

As I understand Go more, some of the concepts tend to make my head hurt. Sometimes, innocent examples in various tutorials hide such deep concepts, that it takes a while for me to decode it all.

Here is an example. In various tutorials, pauses are made using time.Sleep().

The first time I saw an example like the following, it made me stop in my tracks.

package main

import (
"time"
)

func main() {
time.Sleep(100 * time.Millisecond)
}

## Jetbrains Finalizes Name for their Go IDE

Seems like Jetbrains has finally ditched that weird name for their Go IDE and changed it to a more palatable, but not really very inventive version (come on, I think PyCharm is a pretty nice name for a Python editor). Gogland is now GoLand!

## The Borg design pattern

How to have shared state between different instance of a class without a singleton pattern.

The ‘Singleton’ DP is all about ensuring that just one instance of a certain class is ever created. It has a catchy name and is thus enormously popular, but it’s NOT a good idea – it displays different sorts of problems in different object-models. What we should really WANT, typically, is to let as many instances be created as necessary, BUT all with shared state. Who cares about identity – it’s state (and behavior) we care about!

By Alex Martelli at Singleton? We Don’t Need No Stinkin’ Singleton: The Borg Design Pattern.

## Documenting both class and constructor in Sphinx

I lost an hour of my life today trying to figure out why Sphinx would not document a class inside a module specified by :automodule:.

I learnt two things today.

## Using Python to update a required field while performing a transition in Jira

This might be a very esoteric topic for most people, but since I could not find information about this anywhere, I decided to document this in a post.

Here is the problem. I use Jira at work, and today, I needed to close a bunch of tickets based on a search result. Now, searching or doing batch operations is simple enough from the browser, but a small detail made the exercise impossible via the web UI.

## Difference between Python and Ruby when it comes to hashes with default values

Having worked with Python for a while, I am trying to pick up Ruby, especially for some of my work with logstash. While trying out a small program in Ruby, I got stumped with a peculiar trait of Ruby hashes with default values. It made me lose an hour of my life I am not going to get back. :(