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.
Before asking for help, try to find a solution yourself. …
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? …
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. …
There are several ways to remove an element from a list in Python.
Let’s look at the four main ones: the
remove methods, and the
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 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.
After we call
clear , the list is empty — nothing is…
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.
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. …
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. …
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"
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 . …
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).
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. …
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. …
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++, and even
i = i + 1.
In this article, I will cover two methods of adding 1,
i++, and explain why
++i may be better than
i++ in most situations.
i++ method, or post-increment, is the most common way. …