Introduction
I was quite excited to start on the 3rd phase in my bootcamp classes because we are about to learn Python. Python is the first language that I learned at the start of my journey. It lured me into this software engineering world. It feels like reuniting with an old friend. I may not have learned a lot when I first stepped foot into the Python world, to be honest I only learned until if else statements before I started this bootcamp.
Learning a new programming language one after another can be quite tricky, especially when it shares some similarities but also has key differences from languages I already know. I have learned JavaScript in Phase 1 and React.js in Phase 2. While I recognize familiar concepts like variables, loops, and functions, the syntax or behavior of certain features confuses me to this day. For example, a function that works one way in Python might behave differently in JavaScript or React, which leads to moments of confusion. The challenge lies in unlearning old habits and adjusting to new ways of thinking about problems. However, I think having to learn different sorts of languages in programming will help me grow and be more adaptable in the future and helps me expand my toolbox.
Python's syntax for me is cleaner and simple, making it easier to grasp concepts like variables, loops, and functions without getting overwhelmed by complex syntax rules. In contrast, JavaScript introduced more complexity with concepts like asynchronous programming and the intricacies of the DOM, while React added a whole new layer with the use of components, state management, and routing. Although Python is often used for backend development, JavaScript and React require a deeper understanding of web development frameworks, which makes the learning curve steeper in those areas. However, each language has its strengths, and I appreciate Python's versatility in everything like data analysis.
I have also learned SQL hand in hand with Python on this Phase 3. When I first saw the syllabus, I was a little bit overwhelmed to learn 2 languages at the same time. I wanted to devour python. I felt like learning it in combination with SQL was quite disappointing for me. But at the end of the phase, I was actually happy to learn SQL. I do love my spreadsheet and data.
Here are some of the things I have learned in this Phase:
Python
Python is an object-oriented programming language developed by Guido Van Rossen. Python has a pretty straightforward process in interpreting and executing code. A developer will write some code on any text editor (the most commonly used is Visual Studio Code) that consists of statements, functions, classes and many more. One of the most important tools for any python programmer is the Python Interpreter.
Python Interpreter basically reads and executes the code written by the programmer on a text editor line by line. Why do we need it? Because the interpreter reads the code and then converts it into bytecode. Bytecode is a compiled version of your code. The PVM then interprets bytecode to a binary language in which only the computer can interpret into something useful. The hardware runs the binary language which turns into an output. In summary python code cannot run or function or it will be just a block of text that does nothing if we do not have an interpreter.
Here is a summary flow:
Creating a virtual environment to run your python code:
Virtual environment is an environment that allows users to install all python dependencies. Why do we need it? It allows the user to work on a project without directly affecting the global python and other projects in your system. It’s basically putting one project in a room and the user being able to work on the one room without affecting the whole house or other rooms. Think of it like an isolated environment to prevent infection of a contagious disease.
The user can type “pipenv install” in their terminal to install all the dependencies and create the virtual environment initially. That means that the room was just built waiting for the isolation to happen. The user only needs to do this once per project. The dependencies are installed or built at the same time. That doesn't mean that the user is in an isolated room yet. The user then needs to type “pipenv shell” to get inside that functioning isolated room to work. This means the user now has the key to enter that isolated room and cannot infect other rooms or the house with the disease.
Sources:
python.org
wikipedia
Phase 3 lecture
Top comments (0)