Published inAbout Me Stories·PinnedMember-onlyAbout Me — Richard BellIf you’ve stumbled across one of my articles and decided to check out my profile, thank you! I’m new to the writing game and I get a thrill of excitement out of every single clap and follow. You’ve clearly clicked this article to find out who I am, so I’ll…About Me3 min readAbout Me3 min read
Published inLevel Up Coding·Feb 27Member-onlyPostgreSQL — dumping, relationships, and moreIn the previous article, we looked at setting up our Postgres docker image and interacting with it using sql files and the interactive terminal psql. …Sql8 min readSql8 min read
Published inLevel Up Coding·Feb 2Member-onlyPostgreSQL — Getting startedPostgreSQL is a relatively popular relational database that uses and extends the SQL language. In this article we’re going to set up a new PostgreSQL database using docker, and look at a few methods we can use to interact with our database with some simple CRUD operations. Setting up our docker PostgreSQL database The easiest way…Sql7 min readSql7 min read
Published inLevel Up Coding·Aug 30, 2022Member-onlyTypeScript Tidbits — Generic Type ParameterOccasionally you may find yourself writing a function that could take a number of different types. Typescript allows you to create a generic type parameter for this purpose. A generic type parameter is a placeholder that we can use to enforce a type-level constraint in multiple places. …Typescript3 min readTypescript3 min read
Aug 10, 2022Member-onlyGolang in sixty seconds — panicWe can use the panic function to cause a runtime error in Golang. This can be useful when paired with the recover function for error handling within our application. We may be tempted to use recover like this: panic("AAAH!") str := recover() fmt.Println(str) However we will never reach the line…Golang1 min readGolang1 min read
Aug 9, 2022Member-onlyGolang in sixty seconds — deferGolang has a special statement called defer which causes the function to be run after the function completes. Let’s look at an example: func one() { fmt.Println("1") } func two() { fmt.Println("2") } func main() { defer two() one() } Calling the main function we would see the following output: …Golang1 min readGolang1 min read
Aug 5, 2022Member-onlyGolang in sixty seconds — return multiple values from functionsIf you’re not familiar with functions, please read this article first. Golang allows you to return multiple values from a function. Typically this is used for error handling, so you might see a function like this: func getSecondItem(items []string) (string, error) { if len(items) < 2 {…Software Development2 min readSoftware Development2 min read
Aug 4, 2022Member-onlyGolang in sixty seconds — function basicsIn any programming language a function can often be thought of as a black box that will perform an action. They can take inputs and return outputs, but they don’t have to do either. They’re most often used to separate code to aid readability and understanding, and to avoid repetition. …Software Development2 min readSoftware Development2 min read
Published inTowards Dev·Aug 3, 2022Member-onlyGolang in sixty seconds — scopeWhere you define a variable is very important depending on where you want to use it. The range of places that you are allowed to use the variable is called the scope of the variable. According to the language specification “Go is lexically scoped using blocks”. For us mere mortals…Software Development2 min readSoftware Development2 min read
Published inTowards Dev·Aug 2, 2022Member-onlyGolang in sixty seconds — variablesTo create a new variable in Go we use the var keyword, followed by the variable name (x) and type (string) and then assign it a value (“Hello”). var x string = “Hello” Assigning value is optional, so we could also write it var x string x = “Hello” Variables…Software Development2 min readSoftware Development2 min read