How to stop asking bad questions

Image for post
Image for post
Photo by Emily Morter on Unsplash.

No matter how experienced you are, everyone eventually has to ask someone else a question at work.

However, not all questions are made equal.

The thing that separates people is how they ask their questions.

By following the tips below, you can ensure that you are being respectful of others’ time and maximizing your chance of getting the answer you need.

1. Research Beforehand

Before asking for help, try to find a solution yourself. …


Zoom fatigue — what it is and how to avoid it

Image for post
Image for post
Photo by Chris Montgomery on Unsplash

It’s that time of the week again — your recurring hour-long Zoom meeting.

As you join, you hear people already in the middle of a conversation. Was it just small talk? Was it work-related? You’ll probably never know.

The meeting officially starts. The person running the meeting unsuccessfully tries to share their screen for the first five minutes, but does eventually manage it, and begins going over the agenda items for the meeting.

Halfway through the meeting, someone finally brings up a topic relevant to your work. You lean in, determined to get something out of this meeting. As the person starts talking, their screen freezes and you can’t hear them talk. Eventually, they unfreeze, but they seem to have finished talking. Did my internet die or did theirs? What did they say? Did other people hear them? …


Tools to help you master Python

Image for post
Image for post
Photo by Max Nelson on Unsplash

1. Multiple Assignment

When you want to give several variables the same values, you will often see code that repeats the assignment statement for each variable.

It may look something like the following code, which uses one separate assignment per variable:

a = 1
b = 1
c = 1

In Python, we can simplify this, and assign to every variable at once.

a = b = c = 1
# a == 1
# b == 1
# c == 1

After doing this, every variable was assigned to the right-most value in the chain. …


How to remove from a list with clear, pop, remove, and del

Image for post
Image for post
Photo by Gary Chan on Unsplash

There are several ways to remove an element from a list in Python.

Let’s look at the four main ones: the clear, pop, andremove methods, and the del operator.

In the following examples, I’ll use a common list to demonstrate each method. For simplicity, let’s assume that the list used is l = [2, 3, 4, 5].

Clear

The clear method removes all elements from the list. This is useful when you no longer need any of the list’s elements and just want to re-use the same list object for new data.

Example

After we call clear , the list is empty — nothing is…


Learn bit manipulation

Image for post
Image for post
Photo by Markus Spiske on Unsplash

How Do Computers Represent Data?

If you’ve ever programmed before, you have almost definitely used some kind of numeric data type, such as an integer.

But have you ever thought about how your computer actually stores these numbers?

Instead of using powers of 10 as we normally would to represent numbers, computers store values using powers of 2.

Binary representation

This means that numbers are represented using only strings of zeros and ones — a binary system. Each digit in that binary string is called a bit, and each group of eight bits is one byte.

Typically, we read these binary strings from right to left in increasing powers of 2. This is just like we would read numbers normally, with the one’s place being the rightmost digit, followed by the ten’s place to its left, and so on. …


Start using optional types in languages like Java

Image for post
Image for post
Photo by Safar Safarov on Unsplash

The Problem

In languages that allow null values in variables, developers must explicitly null-check to prevent runtime errors in their programs.

While null-checking is important, it can become a very tedious process, and oftentimes will hurt readability. It often requires heavily-nested code, and gets in the way of business logic.

Typical null-checking code may look like the following snippet:

In this simple example, we see that a basic method to process the name field from a Person object turns into a convoluted, nested block of code that requires several stages of null-checking.

The business logic of the snippet, which is just to process the person’s name, is hidden by the layers of null-checking that the developer must do to create a resilient program. …


Start following best practices for Git commit messages

Image for post
Image for post
Photo by Yancy Min on Unsplash

We’ve All Seen It…

You’re working on a project and it uses Git for version control.

You’ve just finished making a change, and you want to quickly update your branch.

So, you open up your terminal, and with a few quick commands, you update your remote branch with your changes.

git add .
git commit -m "added new feature"
git push

But then you do a bit of testing and find that you have a bug in your implementation.

No worries — you quickly find a fix and make another commit to fix the problem.

git add . …


In most cases, no, but it can help

Image for post
Image for post
Photo by Roman Mager on Unsplash

What Do Software Engineers Do?

To understand the relationship between math and software engineering, it is first important to understand what the average software engineer actually does.

Most engineers end up working on web or business applications, either on the front end or back end (or both).

Working on these types of projects will require you to be familiar with languages such as Java, JavaScript, Python, C#, and Go, and query languages such as SQL dialects.

Within these languages, you will need to learn to use frameworks and libraries that enable you to quickly develop applications, such as React, Angular, Express, Django, and Spring.

Beyond this, you may need to learn things on the operations side of development, such as containerization products like Docker and Kubernetes, as well as how to use various cloud computing platforms such as Amazon Web Services or Google Cloud Platform. …


Use the Kelly criterion to size your bets when gambling

Image for post
Image for post
Photo by Richard Boyle on Unsplash

Introduction

When betting, people often make the naive mistake of simply trying to pick the winning side each time, without concern for the payout amount or odds.

However, in order to maximize winnings, assuming one has enough money to bet multiple times, it ends up being irrelevant whether or not a particular bet results in a win or loss. Instead, you need to consider the expected value of placing your bet.

There are many cases in which a bet may result in a win, but will have a negative expected value, so in the long run, this behavior will result in a net loss. …


Why ++i is often better than i++ (pre-increment vs. post-increment)

Image for post
Image for post
Photo by Safar Safarov on Unsplash

Introduction

If you’ve written a for-loop before, then you have almost definitely used i++ before to increment your loop variable.

However, have you ever thought about why you choose to do it like that?

Clearly, the end result of i++ is that i is one higher than it was before — which is what we want. But, there are many ways to accomplish this, such as ++i, i++, and even i = i + 1.

In this article, I will cover two methods of adding 1, ++i, and i++, and explain why ++i may be better than i++ in most situations.

Post-Increment (i++)

The i++ method, or post-increment, is the most common way. …

About

Devin Soni 👑

Software engineering / Machine learning

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store