How to Find Code in Your Project

Need to find something in a large codebase?

Use search.

How to Find Code in Your Project

Depending on your IDE, you can search for:

  • File names
  • Classes
  • Methods
  • Symbols
  • Text
  • References

For text on the current page, Ctrl + F is often a good starting point.

For larger searches, use your IDE's project or solution search.

Searching is usually faster than opening every file manually.

How to Avoid an Infinite Loop

Does your loop never stop?

Give it a condition that eventually becomes false.

How to Avoid an Infinite Loop

Things to check:

  • Make sure the condition changes
  • Increment your counter
  • Update variables used by the condition
  • Use break when appropriate
  • Avoid accidental while (true) loops

A loop continues while its condition evaluates to true.

If the condition stays true forever, the loop also runs forever.

How to Sort Data in SQL

Need your SQL results in a specific order?

Use ORDER BY.

How to Sort Data in SQL

Common options:

  • ASC sorts values in ascending order
  • DESC sorts values in descending order
  • Sort by one column
  • Sort by multiple columns
  • Combine sorting with WHERE

Without ORDER BY, the database does not guarantee the order of returned rows.

If order matters, ask the database to order the results.

How to Delete Data from SQL

Need to remove data from a database?

Use DELETE.

How to Delete Data from SQL

Common examples:

  • DELETE removes rows
  • WHERE specifies which rows
  • No WHERE means all rows
  • Transactions help protect changes
  • ROLLBACK helps when something goes wrong

Before executing a DELETE, make sure your WHERE condition selects the rows you want to remove.

Stack Overflow Introduces Premium Feature That Automatically Closes Your Question Before You Post It

Stack Overflow Introduces Premium Feature That Automatically Closes Your Question Before You Post It

Stack Overflow unveiled a new premium feature called Predictive Closure™, designed to improve efficiency for both moderators and developers.

Instead of waiting for the community to close a question as a duplicate, unclear, or opinion-based, the platform now performs the action instantly.

"We've reduced the average time to closure from 14 minutes to 0.2 seconds," a spokesperson said.

The feature also displays the traditional response:

"This question has already been asked."

When users click the suggested duplicate, they are redirected to a post from 2013 discussing a completely different programming language.

Early adopters praised the feature.

"Now I know my question was wrong before I even finish typing it."

Stack Overflow says the next release will automatically recommend asking ChatGPT instead, saving everyone even more time. 😄

How to Create a Background Job

Need to execute work outside an HTTP request?

Use a background service.

How to Create a Background Job

Common options:

  • BackgroundService
  • IHostedService
  • Worker Service
  • Hangfire
  • Quartz.NET

Background services are useful for scheduled tasks, message processing, and long-running operations.

How to Read Configuration in ASP.NET Core

Need to access application settings?

Use IConfiguration

Common configuration sources:

  • appsettings.json
  • Environment variables
  • User Secrets
  • Azure Key Vault
  • Command-line arguments

ASP.NET Core automatically combines multiple configuration providers into a single configuration object.

How to Read Configuration in ASP.NET Core

How to Handle Errors in ASP.NET Core

Need to return a proper response when something goes wrong?

Use exception handling middleware.

How to Handle Errors in ASP.NET Core

Common approaches:

  • UseExceptionHandler()
  • Custom exception middleware
  • Return appropriate HTTP status codes
  • Log unexpected exceptions
  • Avoid exposing internal details

Centralized exception handling helps keep API responses consistent across your application.

How to Improve Code Quality

Common techniques:

  • Remove unused code
  • Use better names
  • Reduce duplication
  • Simplify logic
  • Fix bugs

Code quality often improves after these changes.

How to Build a SQL Query

Need to retrieve data from a database?

A typical SQL query consists of these clauses:

  • SELECT to choose columns
  • FROM to specify the table
  • JOIN to combine related tables
  • WHERE to filter rows
  • GROUP BY to group results
  • HAVING to filter groups
  • ORDER BY to sort data
  • OFFSET / FETCH or LIMIT to paginate

Not every query needs every clause, but this is the structure you'll see in most SQL statements.

How to Build a SQL Query

Understanding what each clause does makes reading and writing SQL much easier.