Wednesday, 9 July 2025

From Go Tour to Go by Example: My Real Journey Into Golang

Go Programming Update: From Go Tour to Go by Example

Hello again! How’s it going out there?

Here’s another update just for you.

✅ What’s Next After “A Tour of Go”?

After completing the Go Tour, I moved on to the next learning resource — Go by Example. It’s a practical, snippet-based guide that teaches Go through annotated code examples.

But before diving deep, I had to set up an IDE for actual development.

๐Ÿ’ป Choosing an IDE: LiteIDE vs VSCode

There are many editors out there, but I narrowed it down to two major options:

  • Go LiteIDE
  • VS Code with Go extensions

I decided to start with Go LiteIDE to get a more native experience.

⚙️ Installing Go LiteIDE Wasn't So Easy

Installing LiteIDE wasn’t as straightforward as I expected. It took me several minutes and a few web searches to get it right.

I had to follow multiple setup steps, but eventually, it worked.
๐Ÿ“Œ Spoiler alert: I’ll be writing a separate post on how to install and set up LiteIDE for Go.

๐Ÿง  My Observations So Far

1. Go Strings Use Double Quotes Only

Unlike languages like JavaScript and Python, where both ' and " work, in Go, strings must be in double quotes (").
Single quotes (') are for runes, not strings.

2. if/else Syntax Must Be Properly Aligned

Go is strict about how you write if/else.
This will not work:

if 1 == 1 {
    // do something
}
else {
    // error: unexpected else
}

This is the correct way:

if 1 == 1 {
    // do something
} else {
    // now it's valid
}

3. Still No Section About Comments or String Concatenation

So far, I haven’t seen an example of how to:

  • Add comments
  • Concatenate strings

This suggests that Go expects some prior programming experience from its users. It’s not hand-holding like beginner-friendly languages.

4. Arrays vs Slices in Go

Here’s a simple example to show the difference:

array := [3]string{"j", "d", "d"}     // Array
slice := []string{"j", "d", "d"}      // Slice

An array has a fixed size specified inside the square brackets.
A slice doesn’t specify the size and is more flexible.
They look similar but behave differently.

๐Ÿงต Final Thoughts (For Today)

Go continues to be an outstanding language — clean, powerful, and strict.
It forces you to think like a low-level systems developer, even while giving you modern conveniences.

I’m still getting used to the syntax and structure, but every day I learn something new that surprises me.

Until the next update — keep learning, and stay curious. ๐Ÿ‘‹๐Ÿฝ

Thursday, 3 July 2025

Learning Go: My Honest Thoughts After Completing the Go Tour in 2 Days

Go Programming Update: Day 2 – The Weird, the Wonderful, and the “Why Though?”

Hello again, and thank you for taking a moment to read through.

I understand your time is valuable, so I’ll keep this brief going forward.

๐Ÿง  Yesterday Was... Interesting.

Yesterday was another opportunity to experience something brilliantly human: a programming language created by man — Go.

Now, here are a few things I’ve learned that made me pause and go, “Wait, what?”

"In Go, it's common to write methods that gracefully handle being called with a nil receiver."

But… look at this code:

package main

import "fmt"

type I interface {
    M()
}

type T struct {
    S string
}

func (t *T) M() {
    if t == nil {
        fmt.Println("<nil>")
        return
    }
    fmt.Println(t.S)
}

func main() {
    var i I

    var t *T
    t.S = ""
    i = t
    describe(i)
    i.M()

    i = &T{"hello"}
    describe(i)
    i.M()
}

func describe(i I) {
    fmt.Printf("(%v, %T)\n", i, i)
}

Output:

panic: runtime error: invalid memory address or nil pointer dereference

There's nothing “graceful” about that! ๐Ÿ˜…

But honestly, if I had seen this code a week ago, I could only understand maybe 30% of it. Go code feels more like advanced programming—almost in the league of low-level languages.

๐Ÿงฑ Constructors and NewSomething

Then I stumbled on this: image.NewRGBA.

That threw me off completely at first. Coming from PHP or JavaScript, I assumed New was part of the method name.

Turns out, New is a convention, not a keyword. The actual type is image.RGBA. Go uses NewTypeName() to return an initialized instance — like a constructor function.

๐ŸŸฐ nil Instead of null

Go doesn’t use null — it uses nil.

๐Ÿšซ The Underscore _ Is Not Just a Placeholder

for _, v := range arr {
    // Do something with v only
}

_, ok := someFunc()

The underscore isn’t decorative — it literally means: “Ignore this.”

๐Ÿ’ก Keep an Open Mind

If this is your first time learning Go, please… don’t get your hopes too high in the first few days.

You're going to say “Hmm, this is weird” more than once.

  • No shorthand if statements — braces {} are required.
  • No class keyword — methods are tied to types via receivers.
  • No inheritance — Go favors composition.
  • Go forces unused imports and variables to be removed — and that's a good thing.

๐Ÿงฌ Go Method Syntax

func (receiver Type) MethodName(arg ArgType) ReturnType {
    // ...
}

If you don’t have a receiver, it's just a function. With a receiver, it becomes a method.

๐Ÿ”  Naming Conventions

Go uses PascalCase like this: ErrNegativeSqrt.

I’m used to camelCase and snake_case, so this is another learning curve.

๐Ÿง  Old Habits Die Hard

I still find myself:

  • Using () in if statements
  • Ending lines with ;
  • Trying to destructure like it’s JavaScript ๐Ÿ˜…

But that’s okay — it’s part of the learning curve.

๐ŸŽ‰ I Completed the Tour of Go!

In just 2 days, I finished the official Go Tour tutorials! ๐ŸŽ‰

I’m proud of this progress. It’s a strong start, and I’m beginning to appreciate the beauty and simplicity Go aims for — even if it’s not always obvious at first.

๐Ÿ’™ Onward and Deeper

Next, I’ll dive into more advanced Go concepts: goroutines, channels, error handling, map, struct, slice and possibly building an API.

Until my next update, stay safe and stay healthy.

Wednesday, 2 July 2025

Learning Go Programming as a Web Developer: My First Impressions and 4-Week Plan

So I Started Learning Go

I recently began learning the Go programming language after putting it off for years, considering it unimportant on my to-do list.

My First Look: A Tour of Go

Go is a simple and clean programming language that experienced web developers can pick up fairly quickly.

My goal is to learn Go in under 4 weeks with an aggressive approach.

As developers, many of us get bored when we spend too long learning a new language. We often abandon it and move on to something more exciting. That’s exactly why I’ve set a strict deadline—to stay focused and committed.

The Go syntax reminds me of TypeScript, Python, and maybe even Java—they share some similarities.

Go doesn't care about semicolons (;), and I see now why it's better suited for developers with some programming experience.

Go may not be the best choice for absolute beginners. It has a few advanced concepts that take time to grasp. But honestly, with discipline and determination, anyone can learn it.

One thing I find impressive is how Go handles imports. You can import packages that aren’t even on your server—pretty neat!

Oh yes, if you've used Java before, you’ll recognize the use of main. In Go, everything starts with:

package main

import "fmt"

func main() {
    fmt.Println("Hello, world!")
}

The way Go defines variables is also cool. You can use the var keyword, or a shorthand := for quick declarations.

Constants are declared using the const keyword, and you can define typed or untyped constants.

Go also has something called slices, which are like advanced arrays. To be honest, I initially found them a bit confusing. Why not just improve arrays? Why introduce slices? Maybe it’s just the tutorial that didn’t explain it well.

One thing I do appreciate is how Go handles loops. It's clean—no unnecessary complications. Just a simple for loop. I wish arrays were that straightforward too.

Unlike other languages like PHP, JavaScript, Node.js, Java, Kotlin, or TypeScript, Go keeps looping simple. There’s no for-in, foreach, while, do-while, or any of that mess. Just for. ๐Ÿ˜

Final Thoughts

So far, Go isn’t as fast as I expected—but maybe I haven’t dug deep enough yet. I’m still exploring and plan to share more updates soon.

Stay tuned...

Friday, 27 September 2019

Simplest way to remove and uninstall react-native module or package

Hi guys, I recently ran into an issue while working with react-native. I installed a package for storage but the package didn't work as I had expected and it was causing significant error in the mobile app. I had to install a different package.
So, i went ahead to remove the previous package by doing normal npm uninstall --save
The above code only had effect in my package.json file, and caused the app to start showing white blank screen.
After several hours battling with the app and codes, I discovered that decided to try using react-native command rather than npm.
Show I did react-native uninstall which worked and everything began to work in the app again. The effect of this code is that it not only uninstall the packages the right way, it also unlinks them if they are linked.

Thank you for read, happy coding.


Follow me on twitter: http://www.twitter.com/_josiah_king Join me on Google+: https://www.plus.google.com/u/0/113541005774136102412/posts/p/pub?cfem=1

Sunday, 19 August 2018

My Portfilio Prior to this Day

Hello, below you can find some of my most inspiring and complex projects i have worked on:

Payvalue.ng

Ereg.nepcservices.com.ng

Nibsaconference.org

Amlsnconference.org

Moodle.africaglobalexportmarket.com

Africaglobalexportmarket.com

Scholarshipdraw.com

Fortereg.com

Demeterexports.com

Bruudaarchitects.com

 NDE Smartfarmer Project (offline)

And lots more which are still offline.

Follow me on twitter: http://www.twitter.com/_josiah_king Join me on Google+: https://www.plus.google.com/u/0/113541005774136102412/posts/p/pub?cfem=1

Tuesday, 20 June 2017

Jquery Circular Countdown-up Wordpress Plugin

Follow me on twitter: http://www.twitter.com/_josiah_king Join me on Google+: https://www.plus.google.com/u/0/113541005774136102412/posts/p/pub?cfem=1

Monday, 1 February 2016

Ultra-light and simple Accordion With Jquery

Hello,
remember to include jQuery library before the javascript code below.
here is the code:
JS/Jquery:
if($('.faq-post').length){
        var self = $('.faq-body');
        $('.faq-body .faq-answer').hide();
        $('.faq-question').on('click',function(e){
            $('.faq-answer').hide();
            $(this).next().show();
            e.preventDefault();
            return false;
        });
    }
HTML:
<article class="col-xs-12">
<div class="faq-body">
<h5 class="faq-question"><a href="#" title="">Topic heading </a></h5>
<div class='faq-answer'>Content</div>
</div>
</article>
You can add you style as you wish.
Enjoy!!!

Follow me on twitter: http://www.twitter.com/_josiah_king Join me on Google+: https://www.plus.google.com/u/0/113541005774136102412/posts/p/pub?cfem=1

Tuesday, 26 January 2016

CSS3: Using vw and vh units

VW simply means viewport width while VH is viewport height.

So, you've heard about px, pt, em, and the fancy new rem. Let's look at a couple more: vw and vh.
Often times, there are certain elements within our design that we'd like to ensure can fit into the viewport in their entirety. Normally, we'd have to use JavaScript to do this. Check the size of the viewport and then resize any elements on the page accordingly. If the user resizes the browser then the script runs again to resize the elements on the page.

With vw/vh, we can size elements to be relative to the size of the viewport. The vw/vh units are interesting in that 1 unit reflects 1/100th the width of the viewport. To make an element the full width of the viewport, for example, you'd set it to width:100vw.

Putting it to good use

Lightboxes seem like a great candidate for using vw and vh units, since the lightbox is normally positioned in relation to the viewport. For elements positioned in relation to the viewport, however, I find using fixed positioning with top, bottom, left, and right values to be an easier approach—completely forgoing the need to specify height and width at all.
A good use case for these new units would be for content that sits within a normal document flow. For example, scrolling this page, I could include a number of screenshots. For those screenshots, I don't want them to exceed the height of the viewport. In this case, I can set a maximum height on my images.
img { max-height:95vh; }
In this case, I set the height to 95 to give the element a little bit of breathing room while on the page.

Browser Support

This feature is supported by all major browsers including internet explorer 9.


Follow me on twitter: http://www.twitter.com/_josiah_king Join me on Google+: https://www.plus.google.com/u/0/113541005774136102412/posts/p/pub?cfem=1

Monday, 18 January 2016

Developing a web base fingerprint/biometric software using PHP and Javascript

Hello, i got some request few days ago on how to use fingerprint with php. Here are some useful links to check out if you are considering developing a web base fingerprint app.

http://jayakody2000lk.blogspot.com.ng/2009/07/phphd-server-side-hardware-port-access.html
https://github.com/Valve/fingerprintjs2
https://www.npmjs.com/browse/keyword/fingerprint
http://www.bayometric.com/web-based-biometrics/

And yes, it is possible with todays technologies, but not directly. I am yet to develop a fingerprint software of any platform, so i have not test any of the above solutions.

Follow me on twitter: http://www.twitter.com/_josiah_king Join me on Google+: https://www.plus.google.com/u/0/113541005774136102412/posts/p/pub?cfem=1

Thursday, 14 January 2016

Detect if file is not empty before upload in PHP

I was working with a script developed by something else and i got hooked because i could not post content due to some logical issue with the programming of the script.
The script was design to upload file whether empty or not and this was causing problem for me because i am not attaching a file to the post.
Here is the code to here detect if the file upload is not empty:
if(!$_FILES["file"]['error'] == 4){ //process upload }

That solves the issue, i could now post without upload a file.


Follow me on twitter: http://www.twitter.com/_josiah_king Join me on Google+: https://www.plus.google.com/u/0/113541005774136102412/posts/p/pub?cfem=1