unigraphique.com

Avoiding Common Coding Pitfalls During My Amazon Internship

Written on

Identifying Key Coding Mistakes

Last year, I had the opportunity to intern as a Software Engineer in the Business Division at Amazon. It was my first experience in a tech company, which made me eager to learn as much as possible. While I’ll share the full story another time, today I’d like to focus on the coding habits I found challenging to overcome during my internship.

Coding mistakes during internship

Understanding Code Abbreviation

One recurring issue I faced was my tendency to abbreviate code, which I didn’t realize was causing confusion. My team’s senior engineer frequently pointed out this habit during code reviews, advising me to avoid abbreviating variable and class names.

For instance, I would use shorthand like:

  • “res” or “resp” for Response
  • “sesh” for Session
  • “conn” for Connection
  • “err” for Error
  • “prod” for Product
  • “ctx” for Context

This highlighted the importance of clarity in coding. In a diverse team like ours, assumptions about what is obvious can vary widely. While it might only take a moment to decipher an abbreviation, ensuring clarity is crucial for team collaboration. Now, I strive to make my code as readable as possible.

Don't Make Assumptions

Assumptions can lead to misunderstandings. At Amazon, our team comprised individuals from various countries, each with their own coding styles. This experience taught me that even what seems clear to one person may not be so to another.

Diverse coding practices

The Pitfalls of Excessive Commenting

Surprisingly, my team pointed out that I was overusing comments in my code. Initially, I thought that providing detailed comments was a good practice, but I learned that code should be self-explanatory. While it’s beneficial to include a brief comment for classes, excessive commenting can detract from code clarity.

Importance of clear code

Avoiding Overloaded Functions

Another mistake I frequently made was cramming too many tasks into a single function, violating the Single Responsibility Principle. This often led to the need for numerous comments. I learned that breaking responsibilities into smaller, manageable functions significantly enhances readability and eases debugging.

Single Responsibility Principle

The Role of Design Patterns

When I started, I wasn’t familiar with design patterns, which posed a challenge. After some research and guidance from my lead engineer, I explored "Head First Design Patterns," which helped me understand when to apply various patterns effectively.

Learning design patterns

Cautions Against Overusing Patterns

Excited by my newfound knowledge, I sometimes overused design patterns, even when they weren’t necessary. This can lead to reduced flexibility and unnecessary complexity in code. I learned that while design patterns are valuable tools, they should be applied judiciously.

Caution with design patterns

Reflecting on Coding Habits

What coding habits have you struggled to overcome? I'd love to hear your experiences in the comments!

The video, "How I got an Amazon Internship (after 6 months of failure)," shares insights on overcoming challenges during the internship journey.

Share the page:

Twitter Facebook Reddit LinkIn

-----------------------

Recent Post:

Creating a Utopian Dream: A Journey to Finding Paradise

Discover the quest for a personal utopia, exploring the journey through life changes, and the dream of a perfect environment.

Enhance Your Python Skills for Data Science with These Tips

Discover five essential tips to improve your Python coding for data science and boost your confidence in tackling complex projects.

Harnessing the Socratic Method for Inspired Writing

Discover how to leverage the Socratic Method to enhance your writing process and overcome creative blocks.

Exploring the Remarkable Similarities of TRAPPIST-1's Seven Planets

Discover the striking similarities among the seven planets of the TRAPPIST-1 system and what they reveal about exoplanets.

Navigating the Fear of Advancing My Career: A Personal Journey

A reflection on the fears surrounding career advancement and the insights gained through self-exploration.

Finding the Balance: Knowing When to Step Back for Better Productivity

Discover how to recognize when you're overexerting yourself and the importance of taking breaks for sustained productivity.

Exploring Business Acquisition for Passive Income Success

Discover how to buy a business for passive income, including key strategies and considerations for success.

Understanding SQL Data Engineer Salaries: A Comprehensive Guide

Explore the salary landscape for SQL Data Engineers, their roles, and the demand for SQL skills in the tech industry.