2024-11-156 min readCareer

From Physics to Code: My Journey into Software Development

How studying physics at one of Iran's top universities led me to discover my passion for software development and AI engineering.

CareerLearningStory
From Physics to Code: My Journey into Software Development
My path to becoming a software developer wasn't conventional. I started at Sharif University of Technology studying Physics, one of the most prestigious programs in Iran. But along the way, I discovered that my true passion lay not in understanding the universe's physical laws, but in creating digital systems that solve real-world problems. This is the story of my transition from theoretical physics to practical software engineering—a journey that taught me more about problem-solving, resilience, and finding your true calling than I ever expected. ## The Beginning: Sharif University and Physics When I entered Sharif University of Technology in 2020, I was excited about physics. The prospect of understanding quantum mechanics, relativity, and the fundamental nature of reality was exhilarating. Sharif has produced numerous accomplished physicists, and I was proud to be part of that legacy. The first year was intense. We dove into: - Classical Mechanics and Thermodynamics - Calculus and Linear Algebra - Experimental Physics labs - Mathematical Methods for Physics The rigor was challenging but rewarding. I learned to think critically, approach problems methodically, and never give up on difficult concepts. Little did I know these skills would become the foundation of my future career in a completely different field. ## The Unexpected Discovery During my second year, I took a required course: Introduction to Computer Programming. It was meant to be a tool—a way for physicists to perform calculations and simulations. For most of my classmates, it was just another class to pass. For me, it was a revelation. I remember the first time I wrote a Python script to simulate particle motion. Watching those particles move across the screen based on equations I had written was magical. It wasn't theoretical—it was immediate, visual, and I had created it. The more I learned about programming, the more fascinated I became: - **The instant feedback**: Write code, run it, see results immediately - **The creative freedom**: Build anything you can imagine - **The practical impact**: Software solves real problems for real people - **The endless learning**: There's always something new to discover I started spending more time coding than studying physics. I'd stay up late building small projects—a calculator, a game, a data visualization tool. My grades in physics courses remained good, but my heart wasn't in it anymore. ## The Internal Struggle Making the decision to switch wasn't easy. I grappled with several concerns: **Prestigious Institution**: Sharif University is incredibly competitive. Walking away from that felt like abandoning an opportunity many would dream of. **Family Expectations**: My family was proud of my acceptance to Sharif. How would they react to me switching paths? **Time Investment**: I had already invested two years in physics. Starting over felt daunting. **Fear of Uncertainty**: What if programming was just a phase? What if I struggled with computer science? But the pull toward software development was too strong to ignore. Every time I wrote code, I felt alive. Every time I solved a programming challenge, I felt fulfilled in a way physics problems never made me feel. ## Making the Switch In 2023, I made the decision: I would leave Sharif and enroll in Computer Engineering at Islamic Azad University. It wasn't an easy transition. ### The Learning Curve While I had some programming experience, computer science required mastering entirely new concepts: **Data Structures & Algorithms**: Understanding trees, graphs, dynamic programming, and complexity analysis was initially overwhelming. **Software Engineering**: Learning about design patterns, version control, testing, and clean code principles. **Systems Programming**: Diving into how computers actually work at a lower level—memory management, operating systems, networks. **Web Development**: Both frontend and backend technologies, which became my specialization. I attacked this learning curve with the same intensity I had brought to physics. Late nights studying became late nights coding. Problem sets became coding challenges on LeetCode and HackerRank. ### Bridging Two Worlds What surprised me most was how much my physics background helped: **Mathematical Foundation**: The calculus and linear algebra I learned weren't wasted. They became crucial for understanding machine learning algorithms. **Problem-Solving Methodology**: Physics taught me to break complex problems into smaller, manageable pieces—exactly what you do in programming. **Analytical Thinking**: Debugging code is remarkably similar to solving physics problems: observe the behavior, form hypotheses, test them, iterate. **Persistence**: Physics problems can take hours or days to solve. The same patience and persistence apply to tracking down bugs or implementing complex features. ## Finding My Niche: Full Stack Development and AI As I progressed through my computer engineering studies, I discovered my strengths: ### Frontend Development I loved the immediate visual feedback and the creative aspects of building user interfaces. Learning React, Next.js, and modern CSS frameworks felt natural. ### Backend Development The systematic, logical nature of backend development appealed to my analytical mindset. Designing APIs, optimizing database queries, and architecting scalable systems became my forte. ### AI and Machine Learning This is where physics and computer science truly merged. The mathematical foundations from physics made understanding neural networks, gradient descent, and statistical learning theory much more intuitive. ## Real-World Application: My First Job In February 2025, I landed my first professional role as a Backend Developer at Sav. This was validation that my career switch was the right choice. At Sav, I: - Built and maintained RESTful APIs using Laravel and MySQL - Optimized database performance for high-traffic applications - Contributed to CI/CD pipelines using Docker and Git - Collaborated with frontend developers on full-stack features The experience taught me that software development isn't just about writing code—it's about solving business problems, working in teams, and continuously learning new technologies. ## Lessons Learned from the Transition ### 1. It's Never Too Late to Change Course I was 23 when I switched fields. Some people change careers at 30, 40, or 50. What matters is finding work that fulfills you. ### 2. Previous Knowledge Is Never Wasted The analytical thinking, mathematical foundation, and problem-solving skills from physics directly benefit my software development work, especially in AI/ML. ### 3. Follow Your Energy Pay attention to what activities give you energy versus drain it. I felt energized writing code and drained studying certain physics concepts. That was my signal. ### 4. The Learning Never Stops Whether it's physics or software development, both fields require continuous learning. The difference is I genuinely enjoy learning about new frameworks, languages, and technologies. ### 5. Credentials Matter Less Than Skills While my Sharif degree would have looked impressive, my portfolio of projects, GitHub contributions, and practical skills have been more valuable in landing opportunities. ## Looking Forward: The Unique Advantage Now, as a Full Stack Developer and AI Engineer, I see my physics background as a unique advantage: **In Machine Learning**: Understanding the mathematical foundations of neural networks, optimization algorithms, and statistical learning comes naturally. **In Problem Solving**: Complex system design feels similar to modeling physical systems—breaking them into components, understanding interactions, predicting behavior. **In Communication**: I can bridge technical and non-technical audiences, explaining complex concepts in accessible ways. **In AI Research**: As AI becomes more sophisticated, understanding the underlying mathematics and physics (especially in areas like computer vision and simulation) becomes increasingly valuable. ## Advice for Others Considering a Career Switch If you're considering switching careers, here's my advice: **1. Experiment First**: Before making a big decision, spend time learning the new field. Take online courses, build projects, see if you genuinely enjoy it. **2. Don't Rush**: Take time to make the decision. But once you decide, commit fully. **3. Leverage Your Background**: Your previous experience isn't wasted. Find ways to apply it in your new field. **4. Build a Portfolio**: In tech, what you can build matters more than credentials. Create projects that showcase your skills. **5. Connect with Others**: Join communities, attend meetups, find mentors who've made similar transitions. **6. Be Patient with Yourself**: You're essentially starting over in some ways. Give yourself grace as you learn. ## Conclusion Switching from physics to software development was one of the best decisions I've ever made. It wasn't the easiest path, and there were moments of doubt along the way. But finding work that genuinely excites you, where you lose track of time because you're so engaged—that's worth any difficulty. My physics background didn't disappear when I became a developer. Instead, it became a unique lens through which I approach problems, understand systems, and contribute to projects. The analytical thinking, mathematical foundation, and problem-solving skills I developed studying physics now make me a better software engineer. If you're at a crossroads in your career, wondering whether it's too late to change or too risky to pursue what truly interests you, I hope my story gives you courage. It's never too late to find your calling. And often, the unconventional path is the one that leads to the most fulfilling destination. The universe is vast and complex—but so is the world of software. And in software, we get to create our own universes, one line of code at a time. --- **Currently**: Backend Developer at Sav | Computer Engineering Student at Islamic Azad University **Connect**: [LinkedIn](https://linkedin.com/in/MNakhaeiR) | [GitHub](https://github.com/MNakhaeiR) | [Email](mailto:m.nakhaei.r3@gmail.com)
MN

Mohammad Nakhaei

Full Stack Developer & AI Engineer based in Tehran, Iran. Building intelligent and responsive web applications.