First 250 days of software dev - Part 1
16 min read
Day 1
I think I have learned a lot today, or at least I have studied. I can briefly list the topics I have studied in the way I remember them:- Binary-bit-byte-shifting concepts
- Asynchronous programming
- Variables, arrays and object in Javascript
- About Scope
- AST (Abstract Syntax Trees)
- To be able to provide the advantages of a loop without using a loop
- Lastly SEO
Day 2
I can say that most of the day was like a basic programming lesson with Javascript. But I think it added a lot. If I summarize the day quickly:- Javascript
- Variable
- SEO
Day 3
- Today I completed the Iterator and Object topic with examples. I felt that today was a bit less productive because I worked a bit too much yesterday and was sleep deprived. But it was also nice to complete the Beginner-Javascript course at CodeAcademy in two days. Next is to complete the Intermediate part. Of course, I'm trying to be a little fast here because there is a lot of information and I want to learn as much as possible, see how they are used, and even if I forget, when a project comes up or a question comes up, I want to know the algorithm, the code structure, the expressions in the code and their usage.
- I found a Github source related to the topics, projects, examples in the 'Eloquent Javascript' book. When I get more into Javascript - even after each topic - I think I will look at them and reinforce them even more.
- I looked at 'page speed' yesterday, one of the topics you talked about in your office meeting today, and when I overheard that Javascript-related improvements were needed, I actually felt like I was looking in the right place. I didn't look at SEO at all today, but I want to make up for it tomorrow.
- Towards the end of the day, I actually saw the topics discussed in the meeting as brain gymnastics and I listened to them very much. When I heard you talk about artificial intelligence, the basic assumptions on which mathematics is based, I wanted to read 'Gödel, Escher, Bach' even more, but I think I will first watch the lectures about this book at MIT and then read the book.
Day 4
I'm mostly on Javascript again today, so I'll get right to the point:- Object
- Web Compatibility and Transpilation
- Class
- SEO
Summary of the day : When you do something you really love, you lose track of time. This means that I haven't been doing things with love for a long time. I didn't think so, but my logic made me say that now. I mean, it's a bit irrelevant, but it's from Morpheus:
This is your last chance. After this, there is no turning back. You take the blue pill - the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill - you stay in Wonderland and I show you how deep the rabbit-hole goes.I wish to stay in Wonderland, to find out how deep the rabbit hole goes, to continue without saying 'Ignorance is bliss' (actually, why not?).
Day 5
Let me briefly describe today:- I think I commented the code that you asked us to comment today correctly, but of course the shortcoming was that I didn't specify the purpose of the functions. Actually, I wrote the result of the code on paper and tried to calculate it by hand, and because I was wasting some time, I didn't write the comment with the purpose of the function.
- Most of the day was spent revisiting previous topics from the Eloquent Javasscript book, the author's interesting thoughts and thought-provoking explanations about the topics, and making/reviewing the examples there. I looked at 'class' a bit yesterday but not today to tell the truth. Tomorrow I plan to finish the 'class' topic completely, and I will if nothing unexpected happens.
Day 6
Today was all about Javascript.- I completed the missing parts of the 'class'. I learned the inheritance structure and the static method.
-
I learned what a promise object is and why it is used, how to create a promise object, how to use structures like catch(), promise.all(), etc. I analyzed a structure that creates several promise structures in a chain and solved examples on top of it. Here's what I remember from today's work on 'promise':
- They are used in asynchronous programs.
- They are in three states: 'Pending, resolved, or rejected'. There was an example of housekeeping. It said that when you do housework, for example, you don't just vacuum the rooms. You also put the laundry in the machine, you can put the dishes in the machine. When you're done sweeping, you can clean the windows. But instead of doing these things one by one, the machines can work while you are doing your own work. This is where the asynchronous structure comes in. Javascript is actually a single threaded programming language, that is, a programming language that does one by one, but it has the ability to work like multi-thread with the event-loop. I looked a lot about event-loop and call stack today, I learned which operations are prioritized and how the system works. Let's go back to the example. If the washing powder is not put in the machine, the machine gives a warning, this is called rejected. If the machine completes its work, it means resolved. Initially it is in pending status.
- setTimeout (works with the Node API) can be used to delay the execution time. Here it is useful to understand the logic of the event-loop. setTimeout gives a callback function and a delay time as arguments.
- When the promise is resolved, we can call it using .then().
- .then() : 'I have a promise. When it settles, here's what I want it to be'.
- .catch() in case of reject, which is our other handler.
- We can also use Promise.all() to take advantage of concurrency.
- Multiple promises in a chain instead of nested ones are more functional, so we should use them if we have to.
- Understanding the problem in your code today was one of the most enlightening topics of today. It was a great example of the dangers of using global variables and how the code works differently with a very small difference between the two codes. I think I can read the code, I feel like I'm very close to seeing the 'big picture', but I think I'm getting a bit lost in the concepts and code. Since we are in the learning phase, I think it is more important whether we can take logical approaches or whether we can approach things analytically enough to make an effort and understand things, rather than expecting us to read, understand and analyze all the codes at once.
- The most interesting thing about async-await today is that I learned that by using a few await constructs, the code can look and read like synchronous code.
- The purpose of async-await is not to get rid of .then() chains and write short code, but to make it look like synchronous code and thus help the developer to maintain and debug. It is also easier to store.
- Singleton Pattern: It is the general name of a pattern that can be used with a getter structure to access the properties of a class whose constructor is private. In this process, there is only one instance.
Summary of the day: Veni, Vidi..
Day 7
Today was the first time I felt that I was struggling, so I stressed a little bit. I thought that I had to send you a code quickly, and when I found the solution directly on stackoverflow and copy-pasted it, I felt bad and looked at the topic again and wrote it myself. After all, the goal was not to write a code, but to produce something that I wrote myself, even if I was wrong. The reason was to approach with a prejudice and look for the solution when I encountered things related to logic circuits for the first time. But when I got into it, I realized that it could be done. In the code I wrote myself, I found a Half Adder. I couldn't find half of the Full Adder and put the others into code, but it would have happened if I tried a little. I can't use a sentence like I finished this and that today because I didn't. Today I realized the importance of practicing rather than reading something to write code. I adapted your last code to Javascript and got a smooth output. After that, I started commenting from the first function, but it stayed at the beginning. One last thing, after you left, I stayed in the office and worked a little more, but I didn't have any bad intentions, don't misunderstand, I stopped because working in the office is more productive than working at home. I should have informed you about this, but I didn't want to disturb you, sorry.Day 8
Today, until lunchtime, I spent the day analyzing the given php code after it was converted to javascript. Then I looked at what is a design pattern and what are the examples. Especially I researched a lot about the singleton pattern. Actually, it has a simple logic, but I realized that I don't have a full command of the subject yet. When I came to the conclusion that I should make the constructor private in Javascript, I was a bit stunned. But I learned a structure that can behave like private without making the constructor private: Object.freeze (). Tomorrow I'm thinking to solve it on a good example. If I can, I'll try to do async, singleton, privacy with module pattern and factory pattern in one code. If I can't, I'm thinking to write and comment them all separately. Today, while looking at design patterns, I learned that they are actually developed with object-oriented programming. Then I found something called UML (Unified Modelling Language). With UML, object-oriented models designed abstractly can be visualized. Even the simplest issues such as the inheritance relationship between classes can be visualized. In other words, design patterns seem to have been born as a reaction to very similar problems that have accumulated for years in software, and to produce a solution according to this pattern. In this way, the readability and correctability of the code increases. Because you can comprehend the design pattern and logic of the person who wrote that code before you.Day 9
Today, until lunchtime, I tried to complete the assignment given yesterday. I researched Singleton and other constructs a lot and now I think I understand them. I want to learn things slowly, so I like to understand the existence of each construct and the reason for its use, instead of doing it fast and missing a lot of things. When I was doing the homework you gave me today, I realized that some structures need to be used a lot so that they are memorized. Just like learning a foreign language, you don't get much result without exposure. That's why I looked at Singleton, Factory patterns, async...await structure, and some try catch structure today. They were topics I've looked at before, but it was very good to repeat. Towards the end of the day I started to do the homework and most of it is done. Here's what I just need to do: Select the product the buyer wants randomly (or in the order it is found) from the array of unsold products, and then do the following operations. At the end of the day, I have the logic of that part in my head, and tomorrow I will continue where I left off.Day 10
Today went well. While I was doing some parts of the assignment, I thought I couldn't do some parts, but I think I was able to get it done after thinking about it over and over again with a new breath. Although the outputs were not in the desired format, I am a little happy that the right things came out. It was especially nice to 'read' a code with your own labor, to analyze it, to shape it in line with what was desired. Inevitably, there are many places where logic comes into play and this gives you pleasure because you use your intelligence and create something. Yes, let's come to the things I need to write:- Today I learned better how a code using the singleton pattern works. I reinforced how to extract an object from a class and how to do other operations on those objects. I used everything we have learned so far such as .foreach, .map, .push, if statement, for loop, etc. in this example. Adding an object to an array, removing an object from an array (hiding it, more precisely, because of the method I used), using another function as an argument inside a function, in short, objects and arrays were on the agenda today. And I think making this example helped a lot. Most of the day was spent trying to understand the logic of the assignment in different ways and coming up with solutions.
- I learned the concept of module today. We may need to save some code fragments in several different files within the same file and perform operations accordingly. Here, I learned the commands that will act as a bridge between those files. Although they have slightly different names in ES6 and Node Runtime environments, the general logic is the same. The 'module.exports' and 'require()' constructs are basically used for Node to export and import. I looked at a few examples and tried it myself.
-
This is actually a bit of preliminary research and reading for background information. I did some research on HTTP Requests and I came across concepts like 'event loop, heap, stack, event queue' and even 'XML, AJAX'. I did some reading about them and watched some videos to visualize them. In more detail:
- The best feature of Javascript is that it's non-blocking, or asynchronous.
- Websites with a lot of photos, for example, will have a better user experience with this feature. For example, a newspaper website might have large photo files. If you wait for them to load, the user doesn't want to stop or has to wait. But it is possible to read the articles in the meantime.
- Event loop is used for asynchronous function calls in javascript. Function calls are added to the stack. Function requests that have to wait for the server to respond are forced to queue. As soon as the stack is empty, the next ones are executed. The execute order is determined by the first in, first out rule.
- Web developers also use event loops for a better user experience.