<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.5">Jekyll</generator><link href="https://kristofk.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://kristofk.com/" rel="alternate" type="text/html" /><updated>2019-10-07T13:04:46+00:00</updated><id>https://kristofk.com/feed.xml</id><title type="html">Kristof Kocsis</title><subtitle>iOS Developer
</subtitle><author><name>Kristof Kocsis</name><email>kristof@kristofk.com</email></author><entry><title type="html">Survival guide to School 42 Piscine in Silicon Valley</title><link href="https://kristofk.com/posts/s42-survival-guide" rel="alternate" type="text/html" title="Survival guide to School 42 Piscine in Silicon Valley" /><published>2019-09-06T00:00:00+00:00</published><updated>2019-09-06T00:00:00+00:00</updated><id>https://kristofk.com/posts/s42-survival-guide</id><content type="html" xml:base="https://kristofk.com/posts/s42-survival-guide">&lt;p class=&quot;info&quot;&gt;I intend to keep this post up to date. If you notice anything missing or incorrect then please send me an email at &lt;a href=&quot;mailto:hello@kristofk.com&quot;&gt;hello@kristofk.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This article isn’t a “What I learned at the piscine” or a “Top tips for the piscine”. This article is a handbook, a manual… a survival guide to the Piscine. Because the piscine is the survival of the fittest (where the “fittest” is undefined). This article will arm you with the knowledge for an explosive headstart compared to others (who haven’t read this article). By the time people figure out how to start the first project, you’ll be polishing your finished work. If that sounds good to you then let’s get started.&lt;/p&gt;

&lt;p&gt;This article is meant to be a guide and a reference too. I recommend reading it once fully and then only coming back to parts relevant to you.&lt;/p&gt;

&lt;p&gt;If you are reading this post then I take it you know what 42 is and you are already decided on taking part in it. Its good to know that in Silicon Valley, everyone is immediately accepted to the Piscine, but this is not the case in other countries.&lt;/p&gt;

&lt;p&gt;I attended School 42’s Piscine in Silicon Valley and it was a unique experience. It is more like an endurance test rather than a knowledge test. I reason I’m writing this article is to help you prepare mentally and save you the trouble of figuring out the thing that you should be told about. Arguably figuring out these things is part of the process… but here is this article anyway.&lt;/p&gt;

&lt;h1 id=&quot;general-knowledge&quot;&gt;General knowledge&lt;/h1&gt;

&lt;p&gt;Generally, you need to know that the piscine is mostly automated. This means that computers and programs run everything and humans have to adapt to that. So everything is always on time, for example, presentations happen in the exact second they are supposed to. Your work is mostly corrected by a computer and a combination of multiple programs meaning that there isn’t any room for negotiation.&lt;/p&gt;

&lt;p&gt;The one thing that really bothered me was the french naming scheme, e.g. bocal, piscine, moulinette… but if you get used to it, its actually fine.
There is also an inside joke that everything is 42: the start and end times, points, punishments… hilarious.&lt;/p&gt;

&lt;p&gt;If god forbid you fail on the piscine then don’t worry, as you can try again unlimited times. As a result, there are usually people in the piscine who failed it previously. These people are the most knowledgeable and so if you happen to find one, be friendly to them as they can give you a lot of insight.&lt;/p&gt;

&lt;h1 id=&quot;area-and-housing-before-42&quot;&gt;Area and housing before 42&lt;/h1&gt;

&lt;p&gt;School 42 Silicon Valley is located in Fremont. Fremont is a chill city in the Bay Area. There aren’t many distractions so you can focus on your studies. The good thing is that you can easily go to San Francisco or visit companies in Silicon Valley.&lt;/p&gt;

&lt;h2 id=&quot;housing-before-42&quot;&gt;Housing before 42&lt;/h2&gt;

&lt;p&gt;There is a Slack channel called #need-a-room where you can coordinate with other people to rent rooms. I recommend you take an Airbnb in the area. But since Fremont is not a big place it doesn’t have that many options as big urban cities would. So book early for the best deals.&lt;/p&gt;

&lt;h2 id=&quot;position-of-the-campus&quot;&gt;Position of the campus&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://res.cloudinary.com/kristofk-com/image/upload/v1567770386/kristofk-com/posts/2019-09-06-s42-survival-guide/IMG_0012.jpg&quot; alt=&quot;Map of 42 campus with my markup&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The school is located on a campus where other companies also rent office spaces. This means that it is is a very isolated area. If you want to do anything you have to get out of the campus, which is awkward since the whole place is designed for cars. But you have options…&lt;/p&gt;

&lt;h2 id=&quot;commute&quot;&gt;Commute&lt;/h2&gt;

&lt;p&gt;There are a few ways to get out of the campus, these are indicated on the map above. There are two shortcuts to the main road both of which cross a train track (which you are not supposed to cross 🤫). One is a slightly shorter walk than the designated path while the other requires you to climb a wall.
By walking you can go to the grocery store, restaurants and bus stops.&lt;/p&gt;

&lt;p&gt;If you are taking the public transport then make sure you buy a &lt;a href=&quot;https://www.clippercard.com/ClipperWeb/index.do&quot; title=&quot;Clipper card website&quot;&gt;clipper card&lt;/a&gt;. The clipper card is kind of like a virtual wallet for public transport. It works on busses, trains and anything else in the bay area. You can buy it in &lt;a href=&quot;https://www.clippercard.com/ClipperWeb/map.do&quot; title=&quot;Clipper card store search&quot;&gt;select locations&lt;/a&gt;. The card is $3 upfront and then you have to put money on it. You can do it online which takes 1-2 days or in person at the store where you bought the card or in Clipper Card ATMs. The closest Clipper Card ATM that I’m aware of is the &lt;a href=&quot;https://www.google.com/maps/place/Union+City+Station/@37.5769678,-122.0227892,14.07z/data=!4m5!3m4!1s0x808f9560459de053:0x5d5ea5f0aad2a03b!8m2!3d37.5906463!4d-122.0173518&quot; title=&quot;Union City Bart station on the map&quot;&gt;Union City Station&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you don’t like walking or the public transport then you can take an &lt;a href=&quot;https://www.uber.com/invite/kristofk40ue&quot; title=&quot;Uber invite link&quot;&gt;Uber&lt;/a&gt; or &lt;a href=&quot;https://www.lyft.com/idi/KRISTOF571044&quot; title=&quot;Lyft referral link&quot;&gt;Lyft&lt;/a&gt; or rent a car from services like &lt;a href=&quot;https://turo.com&quot; title=&quot;Turo link&quot;&gt;Turo&lt;/a&gt; or &lt;a href=&quot;https://www.getaround.com&quot; title=&quot;Getaround link&quot;&gt;Getaround&lt;/a&gt;. All of which I tried without any hiccups.&lt;/p&gt;

&lt;h2 id=&quot;groceries-and-restaurants&quot;&gt;Groceries and restaurants&lt;/h2&gt;

&lt;p&gt;There is a big supermarket called &lt;a href=&quot;https://www.google.com/maps/place/Safeway/@37.5500239,-122.0495554,17.48z/data=!4m8!1m2!2m1!1ss42+silicon+valley!3m4!1s0x0:0x5190e29858e2d077!8m2!3d37.5518895!4d-122.0499187&quot; title=&quot;Safeway on the map&quot;&gt;Safeway&lt;/a&gt; near the campus. It is about 10-20 minutes walk (depending on which route you take 😉). Before you purchase anything you MUST get a Safeway Club card. The prices are straight-up suicidal without the Club card. You can ask for the card at the Customer Care table and they give you one immediately. You don’t even need to fill out anything.
There are a few restaurants near Safeway but most of them are fast food. There is a Starbucks in Safeway.&lt;/p&gt;

&lt;p&gt;If you feel like ordering food instead of going out to eat then I can recommend you Uber eats, Postmates and Doordash. All of these companies have promotions and deals and rotating free delivery places. Make sure to use referral links when signing up, like the ones I provided as it is beneficial for both the sides. Once you have an account you can also refer others.&lt;/p&gt;

&lt;p&gt;The local restaurants are usually running promotions so if you are lucky you can get a free or at least a cheap meal.&lt;/p&gt;

&lt;p&gt;PRO TIP: There is a Dell Taco walking distance from the campus and they serve tacos with Beyond meet!&lt;/p&gt;

&lt;h2 id=&quot;going-to-san-francisco&quot;&gt;Going to San Francisco&lt;/h2&gt;

&lt;p&gt;The best way to go to San Francisco is with the public transport system: BART (Bay Area Rapid Transport). It is about $12 one way to SF and it takes about 1.5 hours.
There is a lot to do in San Francisco and while there are a lot of options for getting around I found a hack that lets you get around for free and even get paid. If you bike around with Jump (Uber bikes) you can pick up bikes that are low on battery and bike them to a charging station near your destination. This will let you ride for free for 60 minutes and get $3.&lt;/p&gt;

&lt;h2 id=&quot;visiting-tech-companies-and-silicon-valley&quot;&gt;Visiting tech companies and Silicon Valley&lt;/h2&gt;

&lt;p&gt;If you want to go on a Silicon Valley tour then you should rent a car from the aforementioned car rental companies and drive around. Recommended places you should hit are Google, Apple, Winchester Mystery House and Stanford. To hit all these places it takes about 1 day and you can expect to drive less than 100 miles.&lt;/p&gt;

&lt;h1 id=&quot;amenities-in-42-dorms-canteen-labs-security&quot;&gt;Amenities in 42: Dorms, Canteen, Labs, Security&lt;/h1&gt;

&lt;p&gt;Now that you know the lay of the land and you can get around, you are ready to check in to the dorms.
If you have a car and would like to park on the campus, you have to register it at &lt;a href=&quot;https://heimdall.42.us.org/users/sign_in&quot; title=&quot;42 Car registration&quot;&gt;heimdall.42.us.org&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;dorms&quot;&gt;Dorms&lt;/h2&gt;

&lt;p&gt;All you need to do is to show up in front of the dorm building. You’ll get your turn to check-in and you’ll get assigned with random roommates. However, if you don’t want random roommates, you can get a room as a group of up to 4 people. So while you are in the line, you might as well utilize your time and talk to people, mingle. You can find friends there and make sure that you get in a room with the best people. Just remember that everyone in the line is new here, no one knows anyone and everybody wants to socialize. So be the one who initiates conversations.&lt;/p&gt;

&lt;p&gt;In the dorm room, there will be 4 beds (2 bunk beds), a bathroom and 2 closets. If you bring your cloth hangers then you can hang your clothes in the closets. There is air conditioning in all the rooms.&lt;/p&gt;

&lt;p&gt;You need to bring your own supplies like bed sheets, soap and a pillow. If you forgot anything then you can go to Safeway and Ross and you can buy anything.&lt;/p&gt;

&lt;p&gt;In the dorms, there is also a section for charity. If you don’t need or need something you can give it or if you find something you need you can take it.
You can also find a common room in the building and there is a ping pong table there with rackets and balls. However, I highly recommend that you bring your own ping pong balls and hang onto them.&lt;/p&gt;

&lt;h2 id=&quot;cantina&quot;&gt;Cantina&lt;/h2&gt;

&lt;p&gt;The cantina can be found in the dorms building. You can buy your lunch and dinner there and there is also a sandwich/cafe bar and a desserts bar. In the cantina, you can only pay with your digital wallet. You have to put money into this wallet before buying your meals. You can find all the information about the canteen, food and your wallet on &lt;a href=&quot;https://cantina.42.us.org/users/sign_in&quot; title=&quot;42 Cantina&quot;&gt;cantina.42.us.org&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;labs&quot;&gt; Labs&lt;/h2&gt;

&lt;p&gt;The labs are where you are expected to spend most of your time. The labs are split up into sections and one of the sections is for the pisciners. In this section, you can sit down in front of any of the computers and use your intra credentials to sign in to your profile and mac user. The workload from the piscine is enough to keep you in the labs all day long. While people aren’t exactly chatty in the labs, people tend to help each other out. Just remember help first before you ask for help.
It is worth monitoring the Slack group for the piscine as they share information about which area in the labs pisciners are supposed to be in and if you need to move around or there is a change. But normally you can stay in the labs 24/7. It is always open.&lt;/p&gt;

&lt;p&gt;There is an important rule in the labs: no food or drinks. In reality, this means don’t put these on the table but you can put them on the floor or the chair next to you. Periodically some guards go around and check for any “illegal” items on tables and if they find something even if it is empty, you’ll get locked out of your account and the building for 4 hours. There are cameras in the labs and some people were speculating that guards might be watching there and come when they see water bottles on the tables… I don’t think this is true, or at least I hope they have something better to do. Regardless, this rule is absolutely ridiculous.&lt;/p&gt;

&lt;h2 id=&quot;security&quot;&gt;Security&lt;/h2&gt;

&lt;p&gt;The security at 42 is pretty good. No one who is not a 42 member can enter the buildings. Pisciners get a bracelet that signals that they belong and cadets also have their signs. You can write a message to security on Slack (though I never got a response) and you can also call them in case of emergency.
The labs you can only enter through the front door (which is really the back door of the building). The dorms are tougher since none of the doors is open. You just have to hope that there will be someone in the lobby to open the front door for you. During the night a guard is behind the reception who can open the door for you.&lt;/p&gt;

&lt;h2 id=&quot;mail&quot;&gt;Mail&lt;/h2&gt;

&lt;p&gt;There is a specific way to address physical mail: &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;name&amp;gt; - &amp;lt;intra username&amp;gt; - 42&lt;/code&gt;. If you don’t use this naming scheme then they threaten you that your mail will be discarded or sent back immediately, but in reality, no-one cares, it is on the table with the other mail.&lt;/p&gt;

&lt;h1 id=&quot;communication&quot;&gt;Communication&lt;/h1&gt;

&lt;h2 id=&quot;communication--slack--mother&quot;&gt;Communication / slack / mother&lt;/h2&gt;

&lt;p&gt;All the communication within 42 happens on Slack. There are channels for topics, you can message your peer students on Slack and you can even create groups for your teams. You can contact staff from different departments from there and you can also write to everyone. Lost and found is also handled through Slack.
Even before you start the piscine they ask you to register with your 42 email and intra login as the display name. And they aren’t saying this just to annoy you. If your display name is your intra login username that it is easier for people to look, find and talk to you.
Important announcements and reminders are on Slack so make sure that you can receive notifications from Slack at all times.
There is also a bot on slack called mother which you can write to and it’ll connect you to a person and it can help you with many things.&lt;/p&gt;

&lt;h1 id=&quot;life-and-people-in-the-42-piscine&quot;&gt;Life and people in the 42 piscine&lt;/h1&gt;

&lt;p&gt;At the beginning of the piscine, most people can be described as diligent but as the days pass more and more people give up. People give up for many reasons, for some, it is just too hard and others find out that the school is not what they imagined and it may not be able to provide them what they were looking for. (The latter happened to me.)&lt;/p&gt;

&lt;p&gt;Be prepared that you roommates are going to be arriving in the room even after midnight. But don’t forget, a good nights sleep is much better for the human brain than working a few extra hours.&lt;/p&gt;

&lt;h2 id=&quot;bicycles&quot;&gt;Bicycles&lt;/h2&gt;

&lt;p&gt;There is a bicycle room in the labs where you can put your bike and also you can borrow community bikes from there. All the bikes are colour coded and there is a colour for shared bikes. When you are going to the store or to eat or something nearby then you can take them.
However, I never actually used any of these bikes, so I don’t know if there are any extra rules and if they give locks with the bikes or not.&lt;/p&gt;

&lt;h1 id=&quot;curriculum&quot;&gt;Curriculum&lt;/h1&gt;

&lt;p&gt;During weekdays you are going to have daily projects called: d00, d01, d02… You have 2 days for these projects and you have to get yourself evaluated the following day. On the weekends you are going to have extra hard challenges and team projects. For these, you have the whole weekend to solve and they are going to be evaluated differently.&lt;/p&gt;

&lt;p&gt;There is a project to turn in every day by 23:42. Many people hold back submitting until the last hours and minutes. This is because in the last few hours everyone is hyped and collaboration is at its maximum. At this point, everyone is asking questions and sharing their code. So if you have something that you want to double-check or you have an unfinished task, this is a good time to deal with them.&lt;/p&gt;

&lt;p class=&quot;warning&quot;&gt;IMPORTANT: You don’t just automatically get projects, you have to register to them 24 hours in advance! If you forget this you cannot participate in the project… or at least that’s what they say. In reality, in the first 2 weeks, they are willing to sign you up but you’ll get a punishment, like 42 push-ups or something.&lt;/p&gt;

&lt;p class=&quot;warning&quot;&gt;ALSO IMPORTANT: for exams, you have to sign up to 2 things: the project and the event. Don’t forget this because it feels humiliating to sit down on the exam and stand up immediately.&lt;/p&gt;

&lt;h2 id=&quot;code-principle&quot;&gt;Code principle&lt;/h2&gt;

&lt;p&gt;In 42 there is this principle to write your own code. Meaning that you have to understand every bit and line of your code. According to them, you should figure it out whatever it takes but don’t copy code from anywhere for any reason.&lt;/p&gt;

&lt;p&gt;Occasionally this is even tested to catch cheaters I assume. I know my opinion doesn’t matter much here but I think this is BS. You should know your code but in my experience, this approach just killed collaboration and communication with the development community.&lt;/p&gt;

&lt;h2 id=&quot;rushes&quot;&gt;Rushes:&lt;/h2&gt;

&lt;p&gt;Rushes happen on the weekends they are teamwork projects. You get assigned randomly to 2-3 other people making the teams 3-4 people in size. You have the weekend to complete and submit the project. Everyone has access to the git repo of the project.
There is also a team leader who doesn’t have and special privileges that I know of.
With your team, you have to figure out how to split up the task. I found this especially challenging since the task is not any harder than the daily projects making them perfect for a single person to solve. There isn’t much to split.
This project is going to be evaluated by the prefects and they are going to make sure that everyone understands the code by asking a trick question. They might go as far as to delete the whole code and ask someone to rewrite it on the spot. (This is unnecessarily cruel but it is what it is.)&lt;/p&gt;

&lt;h2 id=&quot;evaluation-process&quot;&gt;Evaluation process:&lt;/h2&gt;

&lt;p&gt;Your projects are going to be evaluated by your peer students, therefore you’ll also need to evaluate others. Everything is kept in balance with the evaluation points; you get an evaluation point each time you evaluate someone and lose one when you get evaluated.
So when it is time to evaluate projects, everyone puts their available times in a calendar. When you enter your project, you can see this calendar and subscribe to the empty slots to get evaluated. To keep everything in order you have to get evaluated twice a day and evaluate 2 people.
The teamwork (internally referred to as rush) have a different evaluation: those are evaluated by the prefect and the whole team is present.&lt;/p&gt;

&lt;h2 id=&quot;grading-system&quot;&gt;Grading system:&lt;/h2&gt;

&lt;p&gt;Each project has a threshold which you have to reach to pass it:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;daily projects: 50%&lt;/li&gt;
  &lt;li&gt;exams: 25%&lt;/li&gt;
  &lt;li&gt;the rest I’m not sure about&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the daily projects, the absolute minimum peer evaluations are 1 and it goes up to 2. If none of the peers evaluates you then your project is automatically 0%. If 1 of your peers evaluate you then the other peer evaluation is going to get 0. If you have at least 1 peer evaluation then Moulinette (the automatic grading system) will grade your work and your score is the average of the peer evaluations and Moulinette.&lt;/p&gt;

&lt;h2 id=&quot;checking-yourself&quot;&gt;Checking yourself:&lt;/h2&gt;

&lt;p&gt;At the beginning of the piscine everybody struggles with how and what to turn in. What is acceptable and what is good enough. The answer is that no one knows for sure. We didn’t receive any documentation or guidance as to how moulinette works. But there are a few resources that might help you get closer to the truth.
Two systems go through your code automatically when you submit: Norminette and Moulinette. Norminette checks for syntax and styling errors while Moulinette builds and runs your code with test parameters and checks the output.
You can run Norminette on any 42 computer, so that’s easy. On the other hand, however, Moulinette is a secret. There are open-source repositories that try to mimic Moulinette:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Stupidity: This is a repo containing all the presets and tests of Moulinette. It is not 100% accurate but it is really helpful. However, this repo is a bit cumbersome to use and this is where the next repo comes in…&lt;/li&gt;
  &lt;li&gt;MockMoulinette: I created this repo and it is basically the same as stupidity but much easier to use. It is only 1 command.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;not-working&quot;&gt;Not working&lt;/h2&gt;

&lt;p&gt;If you are not working on or signing up to projects or if you are not present in the labs for a long period, then you trip “an alarm” and the prefects will hunt you down and tell you that if you are not working then you cannot stay. I only got this warning once, it was enough to scare me. However, I’m not aware of anyone getting to this level or even worse getting kicked out. For me, it took about 3-4 days of not showing up until they come looking for me.&lt;/p&gt;
&lt;h2 id=&quot;exams&quot;&gt;Exams&lt;/h2&gt;

&lt;p&gt;Every Friday you’ll have to do an exam. Now the exam is different from all other project types. First of all, to participate in the exam, on top of registering for the exam project you also need to register for the event.&lt;/p&gt;

&lt;p&gt;Before the first exam, you’ll get some scary instructions but there is no need to worry because the instructions are on the wallpaper of the computer. Just make sure that you know your Intra username and password when you show up.&lt;/p&gt;

&lt;p&gt;On the exam, you can only use the terminal and a few other apps. I used the terminal, TextEdit and Stickies on the exams.&lt;/p&gt;

&lt;p&gt;In the exam, there are levels and they start at 0. The levels are always the same so level 0 will always be the same task. Since every test starts with level 0, every test starts with the same task. I know what you are thinking… WHAT?!… but yes you read correctly, every exam start from level 0, therefore, the same task.&lt;/p&gt;

&lt;p&gt;If you get a task right then you get X points but if you fail you get fewer points for the next task. After a few failed attempts, you fail the whole exam.&lt;/p&gt;
&lt;h2 id=&quot;if-they-suspect-you-cheating&quot;&gt;If they suspect you cheating&lt;/h2&gt;

&lt;p&gt;If you do something out of the ordinary or for some reason you trip some sensors you might have to prove the authenticity of your code and that it is your code and isn’t copy this.&lt;/p&gt;

&lt;p&gt;You will get a message from the prefects that you have to chance to prove your ethics (or something like that I don’t remember the exact text). If you don’t show up, it is an automatic failure case. But if you do show up then they will tell you that you have to redo the task in question. The catch is that you have to do it in exam mode. Meaning that you can only use the resources available in exams and there is no internet. And if you need the exercise description then you need to ask for it (Looser… jk).&lt;/p&gt;

&lt;p&gt;If you fail to complete the task with 100% then your score on the project will be -42%. If you complete the task to 100% then nothing happens. If you complete the task partially then you might get partial credit e.g. -10%.
However the negative percentages will not affect your progression, it will just simply be an ugly burn-mark.&lt;/p&gt;

&lt;p class=&quot;info&quot;&gt;I do not see eye to eye with this philosophy of punishing the suspected bad and not rewarding the suspected good but that’s just my insignificant opinion.&lt;/p&gt;

&lt;h2 id=&quot;helpful-not-helpful-prefects&quot;&gt;Helpful, not helpful prefects&lt;/h2&gt;

&lt;p&gt;The prefects are the cadets who are managing the piscine. They are there to help and manage the people. They can answer generic questions about 42 and they are cool people so you can make great conversations with them. However, they cannot help you or answer any specific questions which is frustrating since they know about things that would make everyone’s life so much easier. But it’s all right, you have this blog post now.
Also while there are cool prefects there are much stricter ones too, and the can bust your balls. You’ll just have to figure out who is cool and who isn’t.&lt;/p&gt;

&lt;h1 id=&quot;resources&quot;&gt;Resources&lt;/h1&gt;

&lt;p&gt;There are a lot of resources to guide through your problems. There are GitHub repos that contain all the project exercises, solutions and utilities that help you correct yourself.&lt;/p&gt;

&lt;p&gt;If you use these repos then make sure to pay attention to any changes as sometimes the title of the task or the order of the tasks changes to detect cheaters.
There are also videos and documents from 42 and the whole Intranet of 42.&lt;/p&gt;

&lt;h2 id=&quot;must-know-before-you-come-to-the-piscine&quot;&gt;Must know before you come to the Piscine&lt;/h2&gt;

&lt;p&gt;There are some things that you can prepare for so that your job at the piscine will be much easier. Throughout the piscine, you are basically forced to use terminal and vim as your primary tools.
So if you learn the basics of terminal and vim you are golden.&lt;/p&gt;

&lt;h2 id=&quot;open-source-repos&quot;&gt;Open source repos&lt;/h2&gt;

&lt;p&gt;For Moulinette and Norminette checking I recommend my own repo: &lt;a href=&quot;https://github.com/kristofk/MockMoulinette&quot;&gt;MockMoulinette&lt;/a&gt;.
If you cannot find the task papers because the project is already closed or something, some repos include the task papers.
When you are stuck on a problem and absolutely cannot figure out what next then you can find all the solutions to the problems on GitHub. Just paste the title of the exercise in Google.
DISCLAIMER: Copy-pasting is considered cheating and some tasks are changed so that they can detect copyPasting… so use at your own risk.&lt;/p&gt;

&lt;p&gt;There are some things that you can only access from the computers in the labs. This is because of the Kerberos technology. However, there is a repo on GitHub that claims to circumnavigate this. But I didn’t test this myself.&lt;/p&gt;

&lt;h2 id=&quot;the-intranet&quot;&gt;The Intranet:&lt;/h2&gt;

&lt;p&gt;Throughout 42 everything is connected to your Intra account. Think of it as your AppleID or Google account but for 42 services. You use these credentials even when logging into the computers.
There are a few important Intra services:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Profile: includes all your projects and progress&lt;/li&gt;
  &lt;li&gt;Cantin: Everything food and cantina related&lt;/li&gt;
  &lt;li&gt;Campus: If you want to find someone in the labs you can look them up on a map of the campus. This, however, isn’t very reliable as it doesn’t always show everyone.&lt;/li&gt;
  &lt;li&gt;Heimdall: If you are driving around the campus, you have to register your car. This is so security doesn’t toe the car and no one bothers you about it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;computers-and-kerberos&quot;&gt;Computers and Kerberos:&lt;/h2&gt;

&lt;p&gt;You can only get work done in the labs on computers provided by 42. Only these have access to work and project-related resources. This is made possible by a technology called Kerberos. What you need to know is that when the computers start blabbering about access rights, it is usually something to do with Kerberos. Either your Kerberos ticket expired or you are at someone else’s computer that doesn’t have your k. ticket. This is easy to solve: you can generate Kerberos tickets on demand. However, you’ll have to figure this out as it is outside the scope of this article.&lt;/p&gt;

&lt;p&gt;Some of your data is synced across sessions and logins but some are not. Your files and work are synced always, that is reliable. However your preferences, connected devices are all over the place. Sometimes the mouse’s tracking speed is synced but not other times. You cannot sign in to iCloud on sad machines and if you try, you are going to get pop up messages forever about iCloud being misconfigured.&lt;/p&gt;

&lt;p&gt;The computers are logging the time you spend on them. I tried hard to trick the computer to think I’m there but with no luck. I tried the caffeinate command and even putting weight on a key so that it types infinitely in text edit but no luck. The computer restarts if it cannot lock itself.&lt;/p&gt;

&lt;h1 id=&quot;extra-knowledge&quot;&gt;Extra knowledge&lt;/h1&gt;

&lt;h2 id=&quot;privacy&quot;&gt;Privacy&lt;/h2&gt;

&lt;p&gt;After the piscine has ended I GDPR requested my data to see for myself what data they collect and what can contribute to the final decision. This process was very simple, there is a request button in Intra and they provided my data in a few days in JSON format.
This is especially nice since I was in the US and they are in the US so they had no obligation to provide me with the data that I requested. I really like how 42 is being a good citizen here.&lt;/p&gt;

&lt;p&gt;I read through the data and I’m happy to report that they aren’t tracking anything suspicious or scary or super intrusive. They don’t have key loggers or secret data points. The data they collect is straight forward:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;When you login/out and how long you are active&lt;/li&gt;
  &lt;li&gt;Which computers you log in from&lt;/li&gt;
  &lt;li&gt;Which projects and exams you sign up for&lt;/li&gt;
  &lt;li&gt;The scores of those projects and exams&lt;/li&gt;
  &lt;li&gt;Evaluations you give and receive&lt;/li&gt;
  &lt;li&gt;When you were free to evaluate others&lt;/li&gt;
  &lt;li&gt;General data about you (name, address…)&lt;/li&gt;
  &lt;li&gt;A bunch of other things that were empty as they don’t apply to pisciners
I think that this amount of data is reasonable for them to collect. It even feels like they have more but let’s hope that they stay reasonable in the future too.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;rumors-and-gossips&quot;&gt;Rumors and gossips&lt;/h2&gt;

&lt;p&gt;Rumours are spreading in and outside of 42 as to how they select cadets. 42 is a breeding ground for rumours and misconceptions because of the lack of transparency and there isn’t anyone you can turn to if you have questions.
There are rumours that they track your interactions with people and how those people perform around you. There are cameras in the labs, they might be watching through that… although I read the privacy policy and they say that the cameras are only used to protect gear and personnel and not to evaluate them.&lt;/p&gt;

&lt;p&gt;For me, personally, 42 felt like they were always watching and monitoring me through cameras and maybe even key loggers. This is probably just paranoia but that doesn’t change the fact, that this is what it felt like. So you should probably use a VPN when connected to 42 wifi.&lt;/p&gt;

&lt;h2 id=&quot;other-piscines&quot;&gt;Other piscines&lt;/h2&gt;

&lt;p&gt;The default piscine that you can access from outside 42 is the “C” piscine all about the C language. However, cadets inside 42 can attend other piscines like PHP or my favourite, the Swift piscine. Don’t ask me for the logic behind this… hiring process for employees… but most of the things in 42 have a purpose.&lt;/p&gt;

&lt;h2 id=&quot;dictionary&quot;&gt;Dictionary&lt;/h2&gt;

&lt;p&gt;Here is a list of words that you would only come across in 42 and the meaning isn’t immediately obvious:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bocal&lt;/strong&gt; - Staff at 42, not the cleaners or the guards but the people responsible for the academic things.
&lt;strong&gt;Cadets&lt;/strong&gt; - The students of 42.
&lt;strong&gt;Piscine&lt;/strong&gt; - The selection process of 42 to become a cadet.
&lt;strong&gt;Prefects&lt;/strong&gt; - Cadets that are helping to organize the piscine.
&lt;strong&gt;Pisciners&lt;/strong&gt; - People attending the piscine.&lt;/p&gt;

&lt;h2 id=&quot;quick-link-collection&quot;&gt;Quick link collection&lt;/h2&gt;
&lt;p&gt;Heimdall - car rental
Campus - interactive campus map&lt;/p&gt;

&lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;Good luck to your piscine, may the force be with you.&lt;/p&gt;</content><author><name>Kristof Kocsis</name><email>kristof@kristofk.com</email></author><category term="Generic" /><summary type="html">I intend to keep this post up to date. If you notice anything missing or incorrect then please send me an email at hello@kristofk.com. This article isn’t a “What I learned at the piscine” or a “Top tips for the piscine”. This article is a handbook, a manual… a survival guide to the Piscine. Because the piscine is the survival of the fittest (where the “fittest” is undefined). This article will arm you with the knowledge for an explosive headstart compared to others (who haven’t read this article). By the time people figure out how to start the first project, you’ll be polishing your finished work. If that sounds good to you then let’s get started. This article is meant to be a guide and a reference too. I recommend reading it once fully and then only coming back to parts relevant to you. If you are reading this post then I take it you know what 42 is and you are already decided on taking part in it. Its good to know that in Silicon Valley, everyone is immediately accepted to the Piscine, but this is not the case in other countries. I attended School 42’s Piscine in Silicon Valley and it was a unique experience. It is more like an endurance test rather than a knowledge test. I reason I’m writing this article is to help you prepare mentally and save you the trouble of figuring out the thing that you should be told about. Arguably figuring out these things is part of the process… but here is this article anyway. General knowledge Generally, you need to know that the piscine is mostly automated. This means that computers and programs run everything and humans have to adapt to that. So everything is always on time, for example, presentations happen in the exact second they are supposed to. Your work is mostly corrected by a computer and a combination of multiple programs meaning that there isn’t any room for negotiation. The one thing that really bothered me was the french naming scheme, e.g. bocal, piscine, moulinette… but if you get used to it, its actually fine. There is also an inside joke that everything is 42: the start and end times, points, punishments… hilarious. If god forbid you fail on the piscine then don’t worry, as you can try again unlimited times. As a result, there are usually people in the piscine who failed it previously. These people are the most knowledgeable and so if you happen to find one, be friendly to them as they can give you a lot of insight. Area and housing before 42 School 42 Silicon Valley is located in Fremont. Fremont is a chill city in the Bay Area. There aren’t many distractions so you can focus on your studies. The good thing is that you can easily go to San Francisco or visit companies in Silicon Valley. Housing before 42 There is a Slack channel called #need-a-room where you can coordinate with other people to rent rooms. I recommend you take an Airbnb in the area. But since Fremont is not a big place it doesn’t have that many options as big urban cities would. So book early for the best deals. Position of the campus The school is located on a campus where other companies also rent office spaces. This means that it is is a very isolated area. If you want to do anything you have to get out of the campus, which is awkward since the whole place is designed for cars. But you have options… Commute There are a few ways to get out of the campus, these are indicated on the map above. There are two shortcuts to the main road both of which cross a train track (which you are not supposed to cross 🤫). One is a slightly shorter walk than the designated path while the other requires you to climb a wall. By walking you can go to the grocery store, restaurants and bus stops. If you are taking the public transport then make sure you buy a clipper card. The clipper card is kind of like a virtual wallet for public transport. It works on busses, trains and anything else in the bay area. You can buy it in select locations. The card is $3 upfront and then you have to put money on it. You can do it online which takes 1-2 days or in person at the store where you bought the card or in Clipper Card ATMs. The closest Clipper Card ATM that I’m aware of is the Union City Station. If you don’t like walking or the public transport then you can take an Uber or Lyft or rent a car from services like Turo or Getaround. All of which I tried without any hiccups. Groceries and restaurants There is a big supermarket called Safeway near the campus. It is about 10-20 minutes walk (depending on which route you take 😉). Before you purchase anything you MUST get a Safeway Club card. The prices are straight-up suicidal without the Club card. You can ask for the card at the Customer Care table and they give you one immediately. You don’t even need to fill out anything. There are a few restaurants near Safeway but most of them are fast food. There is a Starbucks in Safeway. If you feel like ordering food instead of going out to eat then I can recommend you Uber eats, Postmates and Doordash. All of these companies have promotions and deals and rotating free delivery places. Make sure to use referral links when signing up, like the ones I provided as it is beneficial for both the sides. Once you have an account you can also refer others. The local restaurants are usually running promotions so if you are lucky you can get a free or at least a cheap meal. PRO TIP: There is a Dell Taco walking distance from the campus and they serve tacos with Beyond meet! Going to San Francisco The best way to go to San Francisco is with the public transport system: BART (Bay Area Rapid Transport). It is about $12 one way to SF and it takes about 1.5 hours. There is a lot to do in San Francisco and while there are a lot of options for getting around I found a hack that lets you get around for free and even get paid. If you bike around with Jump (Uber bikes) you can pick up bikes that are low on battery and bike them to a charging station near your destination. This will let you ride for free for 60 minutes and get $3. Visiting tech companies and Silicon Valley If you want to go on a Silicon Valley tour then you should rent a car from the aforementioned car rental companies and drive around. Recommended places you should hit are Google, Apple, Winchester Mystery House and Stanford. To hit all these places it takes about 1 day and you can expect to drive less than 100 miles. Amenities in 42: Dorms, Canteen, Labs, Security Now that you know the lay of the land and you can get around, you are ready to check in to the dorms. If you have a car and would like to park on the campus, you have to register it at heimdall.42.us.org. Dorms All you need to do is to show up in front of the dorm building. You’ll get your turn to check-in and you’ll get assigned with random roommates. However, if you don’t want random roommates, you can get a room as a group of up to 4 people. So while you are in the line, you might as well utilize your time and talk to people, mingle. You can find friends there and make sure that you get in a room with the best people. Just remember that everyone in the line is new here, no one knows anyone and everybody wants to socialize. So be the one who initiates conversations. In the dorm room, there will be 4 beds (2 bunk beds), a bathroom and 2 closets. If you bring your cloth hangers then you can hang your clothes in the closets. There is air conditioning in all the rooms. You need to bring your own supplies like bed sheets, soap and a pillow. If you forgot anything then you can go to Safeway and Ross and you can buy anything. In the dorms, there is also a section for charity. If you don’t need or need something you can give it or if you find something you need you can take it. You can also find a common room in the building and there is a ping pong table there with rackets and balls. However, I highly recommend that you bring your own ping pong balls and hang onto them. Cantina The cantina can be found in the dorms building. You can buy your lunch and dinner there and there is also a sandwich/cafe bar and a desserts bar. In the cantina, you can only pay with your digital wallet. You have to put money into this wallet before buying your meals. You can find all the information about the canteen, food and your wallet on cantina.42.us.org.  Labs The labs are where you are expected to spend most of your time. The labs are split up into sections and one of the sections is for the pisciners. In this section, you can sit down in front of any of the computers and use your intra credentials to sign in to your profile and mac user. The workload from the piscine is enough to keep you in the labs all day long. While people aren’t exactly chatty in the labs, people tend to help each other out. Just remember help first before you ask for help. It is worth monitoring the Slack group for the piscine as they share information about which area in the labs pisciners are supposed to be in and if you need to move around or there is a change. But normally you can stay in the labs 24/7. It is always open. There is an important rule in the labs: no food or drinks. In reality, this means don’t put these on the table but you can put them on the floor or the chair next to you. Periodically some guards go around and check for any “illegal” items on tables and if they find something even if it is empty, you’ll get locked out of your account and the building for 4 hours. There are cameras in the labs and some people were speculating that guards might be watching there and come when they see water bottles on the tables… I don’t think this is true, or at least I hope they have something better to do. Regardless, this rule is absolutely ridiculous. Security The security at 42 is pretty good. No one who is not a 42 member can enter the buildings. Pisciners get a bracelet that signals that they belong and cadets also have their signs. You can write a message to security on Slack (though I never got a response) and you can also call them in case of emergency. The labs you can only enter through the front door (which is really the back door of the building). The dorms are tougher since none of the doors is open. You just have to hope that there will be someone in the lobby to open the front door for you. During the night a guard is behind the reception who can open the door for you. Mail There is a specific way to address physical mail: &amp;lt;name&amp;gt; - &amp;lt;intra username&amp;gt; - 42. If you don’t use this naming scheme then they threaten you that your mail will be discarded or sent back immediately, but in reality, no-one cares, it is on the table with the other mail. Communication Communication / slack / mother All the communication within 42 happens on Slack. There are channels for topics, you can message your peer students on Slack and you can even create groups for your teams. You can contact staff from different departments from there and you can also write to everyone. Lost and found is also handled through Slack. Even before you start the piscine they ask you to register with your 42 email and intra login as the display name. And they aren’t saying this just to annoy you. If your display name is your intra login username that it is easier for people to look, find and talk to you. Important announcements and reminders are on Slack so make sure that you can receive notifications from Slack at all times. There is also a bot on slack called mother which you can write to and it’ll connect you to a person and it can help you with many things. Life and people in the 42 piscine At the beginning of the piscine, most people can be described as diligent but as the days pass more and more people give up. People give up for many reasons, for some, it is just too hard and others find out that the school is not what they imagined and it may not be able to provide them what they were looking for. (The latter happened to me.) Be prepared that you roommates are going to be arriving in the room even after midnight. But don’t forget, a good nights sleep is much better for the human brain than working a few extra hours. Bicycles There is a bicycle room in the labs where you can put your bike and also you can borrow community bikes from there. All the bikes are colour coded and there is a colour for shared bikes. When you are going to the store or to eat or something nearby then you can take them. However, I never actually used any of these bikes, so I don’t know if there are any extra rules and if they give locks with the bikes or not. Curriculum During weekdays you are going to have daily projects called: d00, d01, d02… You have 2 days for these projects and you have to get yourself evaluated the following day. On the weekends you are going to have extra hard challenges and team projects. For these, you have the whole weekend to solve and they are going to be evaluated differently. There is a project to turn in every day by 23:42. Many people hold back submitting until the last hours and minutes. This is because in the last few hours everyone is hyped and collaboration is at its maximum. At this point, everyone is asking questions and sharing their code. So if you have something that you want to double-check or you have an unfinished task, this is a good time to deal with them. IMPORTANT: You don’t just automatically get projects, you have to register to them 24 hours in advance! If you forget this you cannot participate in the project… or at least that’s what they say. In reality, in the first 2 weeks, they are willing to sign you up but you’ll get a punishment, like 42 push-ups or something. ALSO IMPORTANT: for exams, you have to sign up to 2 things: the project and the event. Don’t forget this because it feels humiliating to sit down on the exam and stand up immediately. Code principle In 42 there is this principle to write your own code. Meaning that you have to understand every bit and line of your code. According to them, you should figure it out whatever it takes but don’t copy code from anywhere for any reason. Occasionally this is even tested to catch cheaters I assume. I know my opinion doesn’t matter much here but I think this is BS. You should know your code but in my experience, this approach just killed collaboration and communication with the development community. Rushes: Rushes happen on the weekends they are teamwork projects. You get assigned randomly to 2-3 other people making the teams 3-4 people in size. You have the weekend to complete and submit the project. Everyone has access to the git repo of the project. There is also a team leader who doesn’t have and special privileges that I know of. With your team, you have to figure out how to split up the task. I found this especially challenging since the task is not any harder than the daily projects making them perfect for a single person to solve. There isn’t much to split. This project is going to be evaluated by the prefects and they are going to make sure that everyone understands the code by asking a trick question. They might go as far as to delete the whole code and ask someone to rewrite it on the spot. (This is unnecessarily cruel but it is what it is.) Evaluation process: Your projects are going to be evaluated by your peer students, therefore you’ll also need to evaluate others. Everything is kept in balance with the evaluation points; you get an evaluation point each time you evaluate someone and lose one when you get evaluated. So when it is time to evaluate projects, everyone puts their available times in a calendar. When you enter your project, you can see this calendar and subscribe to the empty slots to get evaluated. To keep everything in order you have to get evaluated twice a day and evaluate 2 people. The teamwork (internally referred to as rush) have a different evaluation: those are evaluated by the prefect and the whole team is present. Grading system: Each project has a threshold which you have to reach to pass it: daily projects: 50% exams: 25% the rest I’m not sure about For the daily projects, the absolute minimum peer evaluations are 1 and it goes up to 2. If none of the peers evaluates you then your project is automatically 0%. If 1 of your peers evaluate you then the other peer evaluation is going to get 0. If you have at least 1 peer evaluation then Moulinette (the automatic grading system) will grade your work and your score is the average of the peer evaluations and Moulinette. Checking yourself: At the beginning of the piscine everybody struggles with how and what to turn in. What is acceptable and what is good enough. The answer is that no one knows for sure. We didn’t receive any documentation or guidance as to how moulinette works. But there are a few resources that might help you get closer to the truth. Two systems go through your code automatically when you submit: Norminette and Moulinette. Norminette checks for syntax and styling errors while Moulinette builds and runs your code with test parameters and checks the output. You can run Norminette on any 42 computer, so that’s easy. On the other hand, however, Moulinette is a secret. There are open-source repositories that try to mimic Moulinette: Stupidity: This is a repo containing all the presets and tests of Moulinette. It is not 100% accurate but it is really helpful. However, this repo is a bit cumbersome to use and this is where the next repo comes in… MockMoulinette: I created this repo and it is basically the same as stupidity but much easier to use. It is only 1 command. Not working If you are not working on or signing up to projects or if you are not present in the labs for a long period, then you trip “an alarm” and the prefects will hunt you down and tell you that if you are not working then you cannot stay. I only got this warning once, it was enough to scare me. However, I’m not aware of anyone getting to this level or even worse getting kicked out. For me, it took about 3-4 days of not showing up until they come looking for me. Exams Every Friday you’ll have to do an exam. Now the exam is different from all other project types. First of all, to participate in the exam, on top of registering for the exam project you also need to register for the event. Before the first exam, you’ll get some scary instructions but there is no need to worry because the instructions are on the wallpaper of the computer. Just make sure that you know your Intra username and password when you show up. On the exam, you can only use the terminal and a few other apps. I used the terminal, TextEdit and Stickies on the exams. In the exam, there are levels and they start at 0. The levels are always the same so level 0 will always be the same task. Since every test starts with level 0, every test starts with the same task. I know what you are thinking… WHAT?!… but yes you read correctly, every exam start from level 0, therefore, the same task. If you get a task right then you get X points but if you fail you get fewer points for the next task. After a few failed attempts, you fail the whole exam. If they suspect you cheating If you do something out of the ordinary or for some reason you trip some sensors you might have to prove the authenticity of your code and that it is your code and isn’t copy this. You will get a message from the prefects that you have to chance to prove your ethics (or something like that I don’t remember the exact text). If you don’t show up, it is an automatic failure case. But if you do show up then they will tell you that you have to redo the task in question. The catch is that you have to do it in exam mode. Meaning that you can only use the resources available in exams and there is no internet. And if you need the exercise description then you need to ask for it (Looser… jk). If you fail to complete the task with 100% then your score on the project will be -42%. If you complete the task to 100% then nothing happens. If you complete the task partially then you might get partial credit e.g. -10%. However the negative percentages will not affect your progression, it will just simply be an ugly burn-mark. I do not see eye to eye with this philosophy of punishing the suspected bad and not rewarding the suspected good but that’s just my insignificant opinion. Helpful, not helpful prefects The prefects are the cadets who are managing the piscine. They are there to help and manage the people. They can answer generic questions about 42 and they are cool people so you can make great conversations with them. However, they cannot help you or answer any specific questions which is frustrating since they know about things that would make everyone’s life so much easier. But it’s all right, you have this blog post now. Also while there are cool prefects there are much stricter ones too, and the can bust your balls. You’ll just have to figure out who is cool and who isn’t. Resources There are a lot of resources to guide through your problems. There are GitHub repos that contain all the project exercises, solutions and utilities that help you correct yourself. If you use these repos then make sure to pay attention to any changes as sometimes the title of the task or the order of the tasks changes to detect cheaters. There are also videos and documents from 42 and the whole Intranet of 42. Must know before you come to the Piscine There are some things that you can prepare for so that your job at the piscine will be much easier. Throughout the piscine, you are basically forced to use terminal and vim as your primary tools. So if you learn the basics of terminal and vim you are golden. Open source repos For Moulinette and Norminette checking I recommend my own repo: MockMoulinette. If you cannot find the task papers because the project is already closed or something, some repos include the task papers. When you are stuck on a problem and absolutely cannot figure out what next then you can find all the solutions to the problems on GitHub. Just paste the title of the exercise in Google. DISCLAIMER: Copy-pasting is considered cheating and some tasks are changed so that they can detect copyPasting… so use at your own risk. There are some things that you can only access from the computers in the labs. This is because of the Kerberos technology. However, there is a repo on GitHub that claims to circumnavigate this. But I didn’t test this myself. The Intranet: Throughout 42 everything is connected to your Intra account. Think of it as your AppleID or Google account but for 42 services. You use these credentials even when logging into the computers. There are a few important Intra services: Profile: includes all your projects and progress Cantin: Everything food and cantina related Campus: If you want to find someone in the labs you can look them up on a map of the campus. This, however, isn’t very reliable as it doesn’t always show everyone. Heimdall: If you are driving around the campus, you have to register your car. This is so security doesn’t toe the car and no one bothers you about it. Computers and Kerberos: You can only get work done in the labs on computers provided by 42. Only these have access to work and project-related resources. This is made possible by a technology called Kerberos. What you need to know is that when the computers start blabbering about access rights, it is usually something to do with Kerberos. Either your Kerberos ticket expired or you are at someone else’s computer that doesn’t have your k. ticket. This is easy to solve: you can generate Kerberos tickets on demand. However, you’ll have to figure this out as it is outside the scope of this article. Some of your data is synced across sessions and logins but some are not. Your files and work are synced always, that is reliable. However your preferences, connected devices are all over the place. Sometimes the mouse’s tracking speed is synced but not other times. You cannot sign in to iCloud on sad machines and if you try, you are going to get pop up messages forever about iCloud being misconfigured. The computers are logging the time you spend on them. I tried hard to trick the computer to think I’m there but with no luck. I tried the caffeinate command and even putting weight on a key so that it types infinitely in text edit but no luck. The computer restarts if it cannot lock itself. Extra knowledge Privacy After the piscine has ended I GDPR requested my data to see for myself what data they collect and what can contribute to the final decision. This process was very simple, there is a request button in Intra and they provided my data in a few days in JSON format. This is especially nice since I was in the US and they are in the US so they had no obligation to provide me with the data that I requested. I really like how 42 is being a good citizen here. I read through the data and I’m happy to report that they aren’t tracking anything suspicious or scary or super intrusive. They don’t have key loggers or secret data points. The data they collect is straight forward: When you login/out and how long you are active Which computers you log in from Which projects and exams you sign up for The scores of those projects and exams Evaluations you give and receive When you were free to evaluate others General data about you (name, address…) A bunch of other things that were empty as they don’t apply to pisciners I think that this amount of data is reasonable for them to collect. It even feels like they have more but let’s hope that they stay reasonable in the future too. Rumors and gossips Rumours are spreading in and outside of 42 as to how they select cadets. 42 is a breeding ground for rumours and misconceptions because of the lack of transparency and there isn’t anyone you can turn to if you have questions. There are rumours that they track your interactions with people and how those people perform around you. There are cameras in the labs, they might be watching through that… although I read the privacy policy and they say that the cameras are only used to protect gear and personnel and not to evaluate them. For me, personally, 42 felt like they were always watching and monitoring me through cameras and maybe even key loggers. This is probably just paranoia but that doesn’t change the fact, that this is what it felt like. So you should probably use a VPN when connected to 42 wifi. Other piscines The default piscine that you can access from outside 42 is the “C” piscine all about the C language. However, cadets inside 42 can attend other piscines like PHP or my favourite, the Swift piscine. Don’t ask me for the logic behind this… hiring process for employees… but most of the things in 42 have a purpose. Dictionary Here is a list of words that you would only come across in 42 and the meaning isn’t immediately obvious: Bocal - Staff at 42, not the cleaners or the guards but the people responsible for the academic things. Cadets - The students of 42. Piscine - The selection process of 42 to become a cadet. Prefects - Cadets that are helping to organize the piscine. Pisciners - People attending the piscine. Quick link collection Heimdall - car rental Campus - interactive campus map Conclusion Good luck to your piscine, may the force be with you.</summary></entry><entry><title type="html">Book review: The Effective Executive</title><link href="https://kristofk.com/posts/The-Effective-Executive" rel="alternate" type="text/html" title="Book review: The Effective Executive" /><published>2019-05-11T00:00:00+00:00</published><updated>2019-05-11T00:00:00+00:00</updated><id>https://kristofk.com/posts/The-Effective-Executive</id><content type="html" xml:base="https://kristofk.com/posts/The-Effective-Executive">&lt;h1 id=&quot;the-effective-executive&quot;&gt;The Effective Executive&lt;/h1&gt;
&lt;h2 id=&quot;the-definitive-guide-to-getting-things-done&quot;&gt;The definitive guide to getting things done&lt;/h2&gt;
&lt;h3 id=&quot;by-peter-f-drucker&quot;&gt;by Peter F. Drucker&lt;/h3&gt;

&lt;p&gt;I listened to this book with Audible at 1.5x speed mostly. It didn’t take me long to finish this book. It takes less then a week for me and I can only imagine how fast proficient readers can burn through this book.
I got the inspiration to read this book from the &lt;strong&gt;Cortex&lt;/strong&gt; podcast. I’m also writing this review after it discussed the book in the aforementioned podcast.&lt;/p&gt;

&lt;h2 id=&quot;thoughts-on-the-book&quot;&gt;Thoughts on the book&lt;/h2&gt;

&lt;p&gt;The Effective Executive was written a long time ago, and it’s showing its age now and then. 
The example that Cortex brings up for this is a chapter where Peter Drucker talks about computers and how they don’t even come close to replacing humans. 
Nowadays this isn’t really applicable. In the more recent release of the book, they have taken this chapter out.
 Also, I must have been sleeping during this chapter because I barely remember computers being mentioned. The one sentence with computers I remember was a brilliant phrase: &lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;The computer multiplies the man’s capacity. The wheel, airplane, tv… that do things that man can’t do at all, add a new dimension to man and extends his nature.
I think this is a well-written sentence.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Another shower of the age is the use of he and man. In this book the effective executive can only be a man. Of course you can think of man as mankind, so it is humanity and not literally men. Tying into this is the obsessive use of &lt;strong&gt;&lt;em&gt;One **&lt;/em&gt; and **&lt;em&gt;Oneself&lt;/em&gt;&lt;/strong&gt;. This makes some sentences weird. Both could and should have been edited in later releases of the book just like Dale Carnegie’s book: How to win Friends and influence people.&lt;/p&gt;

&lt;p&gt;I also think the book was good until around the 1/3 of the way when it started falling apart. It is hard to say the exact reason for this but it was noticeable harder to understand the book the further I got.&lt;/p&gt;

&lt;p&gt;Now let’s see some positives in this book. 
First if you are an indie in any field so a free agent, then you’ll be happy to hear that this book focuses more on the individual than on company or team structure.
Relating to that, this book is amongst the first to coin the term &lt;strong&gt;knowledge worker&lt;/strong&gt;. The knowledge worker is a person who doesn’t directly produce goods and so his or her ideas cannot be directly sold or traded. A knowledge worker is not defined by quantity, neither by its costs, knowledge work is defined by its result. The knowledge worker in a company is not necessarily tied to the output. The idea might be passed down to somebody to do something with it.&lt;/p&gt;

&lt;p&gt;Drucker really knew what he was talking about which is especially impressive considering the time this book was written in. 
Some gems in this book are the time measurement and the advice to focus on your strength… more on this later.&lt;/p&gt;

&lt;p&gt;The more familiar you are with the topics discussed in this book the less you’ll enjoy this book. However, the less you know about these topics, the bigger impact this book will have on you.&lt;/p&gt;

&lt;h2 id=&quot;content-breakdown&quot;&gt;Content breakdown&lt;/h2&gt;

&lt;p&gt; The book starts with a foreword written by another person. I found this very cute as it is setting up the book as a romantic novel… I went up to his house in the evening… The house was way too small for such a man… the address matched so I walked up to the front door…&lt;/p&gt;

&lt;p&gt;The first chapter start of very generic. The author says that effective executives can have many differences. They can be shy or outgoing, organized or chaotic… however there are a few things in common, that all executives have:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Effective Executives (E.E.) ask themselves &lt;strong&gt;What needs to be done?&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;They hold the enterprise above all.&lt;/li&gt;
  &lt;li&gt;The take extreme ownership above results, communication and results&lt;/li&gt;
  &lt;li&gt;They are focused on opportunities rather than problems&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This book also explains that Intelligence, imagination and knowledge are essential resources, but only effectiveness converts them into results. By themselves they only set limits to what we can attain. So basically it is hard work rather than talent that matters.&lt;/p&gt;

&lt;p&gt;My favorite parts in this book are about time tracking and strengths.&lt;/p&gt;

&lt;h3 id=&quot;time-tracking&quot;&gt;Time tracking&lt;/h3&gt;

&lt;p&gt;It is very important to track time, so you know where your time is spent. For this you can use products like Timing on Mac. The important thing about time tracking is that it should be recorder real time since if you are trying to do it from memory, your brain will distort time. Your brain will report what should have been done, not the facts. It is also all right if somebody else like your secretary records your time. 
After you consistently measured your time, you can analyze and ask questions. &lt;strong&gt;&lt;em&gt;What if you didn’t do an activity, what impact would it have?&lt;/em&gt;&lt;/strong&gt; If the answer to this is nothing, then drop that activity. 
&lt;strong&gt;&lt;em&gt;What activities could be don by someone else?&lt;/em&gt;&lt;/strong&gt; Delegate those tasks.
&lt;strong&gt;&lt;em&gt;What is wasting your time without adding to your effectiveness?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Time tracking is essential in any professional’s carrier, so I highly recommend that you track and analyze your time.&lt;/p&gt;

&lt;h3 id=&quot;focus-on-your-strengths&quot;&gt;Focus on your strengths&lt;/h3&gt;

&lt;p&gt;In a school for many years, possibly for 2 decades we hear the propaganda, that we should focus on our weaknesses. For example, if you have an “A” in math and Literature but a ”C” in English, then you should focus more on English. 
In real life this isn’t true. If you have a weakness and it doesn’t directly hold you back, then you should not focus on it. &lt;/p&gt;

&lt;p&gt;If you are building a team, build on strengths. If somebody has a weakness, don’t make them do a role related to that but let somebody else with that strength to do it. This will not get rid of the weaknesses, but it will make theme irrelevant. &lt;/p&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;While reading this book I kept thinking of Netflix. Netflix has a podcast where they discuss the company culture and structure. I feel like that if not this book, then the principle in this book played a big role in building the culture of Netflix.
Since employees there have a lot of freedom to decide and the only thing that is expected of theme is to keep the company’s interests above all. 
Obviously this is oversimplifying Netflix, but the principles are there. Every employee at Netflix is a Knowledge worker and an effective executive.&lt;/p&gt;

&lt;p&gt;I recommend this book to anyone who hasn’t gotten deep into the self development, soft skills and professional growth books. If you have already read books on books on self development, then you probably heard all these principles so you could skip this book. &lt;/p&gt;</content><author><name>Kristof Kocsis</name><email>kristof@kristofk.com</email></author><category term="Books" /><summary type="html">The Effective Executive The definitive guide to getting things done by Peter F. Drucker I listened to this book with Audible at 1.5x speed mostly. It didn’t take me long to finish this book. It takes less then a week for me and I can only imagine how fast proficient readers can burn through this book. I got the inspiration to read this book from the Cortex podcast. I’m also writing this review after it discussed the book in the aforementioned podcast. Thoughts on the book The Effective Executive was written a long time ago, and it’s showing its age now and then.  The example that Cortex brings up for this is a chapter where Peter Drucker talks about computers and how they don’t even come close to replacing humans.  Nowadays this isn’t really applicable. In the more recent release of the book, they have taken this chapter out.  Also, I must have been sleeping during this chapter because I barely remember computers being mentioned. The one sentence with computers I remember was a brilliant phrase:  The computer multiplies the man’s capacity. The wheel, airplane, tv… that do things that man can’t do at all, add a new dimension to man and extends his nature. I think this is a well-written sentence. Another shower of the age is the use of he and man. In this book the effective executive can only be a man. Of course you can think of man as mankind, so it is humanity and not literally men. Tying into this is the obsessive use of One ** and **Oneself. This makes some sentences weird. Both could and should have been edited in later releases of the book just like Dale Carnegie’s book: How to win Friends and influence people. I also think the book was good until around the 1/3 of the way when it started falling apart. It is hard to say the exact reason for this but it was noticeable harder to understand the book the further I got. Now let’s see some positives in this book.  First if you are an indie in any field so a free agent, then you’ll be happy to hear that this book focuses more on the individual than on company or team structure. Relating to that, this book is amongst the first to coin the term knowledge worker. The knowledge worker is a person who doesn’t directly produce goods and so his or her ideas cannot be directly sold or traded. A knowledge worker is not defined by quantity, neither by its costs, knowledge work is defined by its result. The knowledge worker in a company is not necessarily tied to the output. The idea might be passed down to somebody to do something with it. Drucker really knew what he was talking about which is especially impressive considering the time this book was written in.  Some gems in this book are the time measurement and the advice to focus on your strength… more on this later. The more familiar you are with the topics discussed in this book the less you’ll enjoy this book. However, the less you know about these topics, the bigger impact this book will have on you. Content breakdown  The book starts with a foreword written by another person. I found this very cute as it is setting up the book as a romantic novel… I went up to his house in the evening… The house was way too small for such a man… the address matched so I walked up to the front door… The first chapter start of very generic. The author says that effective executives can have many differences. They can be shy or outgoing, organized or chaotic… however there are a few things in common, that all executives have: Effective Executives (E.E.) ask themselves What needs to be done? They hold the enterprise above all. The take extreme ownership above results, communication and results They are focused on opportunities rather than problems This book also explains that Intelligence, imagination and knowledge are essential resources, but only effectiveness converts them into results. By themselves they only set limits to what we can attain. So basically it is hard work rather than talent that matters. My favorite parts in this book are about time tracking and strengths. Time tracking It is very important to track time, so you know where your time is spent. For this you can use products like Timing on Mac. The important thing about time tracking is that it should be recorder real time since if you are trying to do it from memory, your brain will distort time. Your brain will report what should have been done, not the facts. It is also all right if somebody else like your secretary records your time.  After you consistently measured your time, you can analyze and ask questions. What if you didn’t do an activity, what impact would it have? If the answer to this is nothing, then drop that activity.  What activities could be don by someone else? Delegate those tasks. What is wasting your time without adding to your effectiveness? Time tracking is essential in any professional’s carrier, so I highly recommend that you track and analyze your time. Focus on your strengths In a school for many years, possibly for 2 decades we hear the propaganda, that we should focus on our weaknesses. For example, if you have an “A” in math and Literature but a ”C” in English, then you should focus more on English.  In real life this isn’t true. If you have a weakness and it doesn’t directly hold you back, then you should not focus on it.  If you are building a team, build on strengths. If somebody has a weakness, don’t make them do a role related to that but let somebody else with that strength to do it. This will not get rid of the weaknesses, but it will make theme irrelevant.  Conclusion While reading this book I kept thinking of Netflix. Netflix has a podcast where they discuss the company culture and structure. I feel like that if not this book, then the principle in this book played a big role in building the culture of Netflix. Since employees there have a lot of freedom to decide and the only thing that is expected of theme is to keep the company’s interests above all.  Obviously this is oversimplifying Netflix, but the principles are there. Every employee at Netflix is a Knowledge worker and an effective executive. I recommend this book to anyone who hasn’t gotten deep into the self development, soft skills and professional growth books. If you have already read books on books on self development, then you probably heard all these principles so you could skip this book. </summary></entry><entry><title type="html">A new beginning</title><link href="https://kristofk.com/posts/A-new-beginning" rel="alternate" type="text/html" title="A new beginning" /><published>2019-02-03T00:00:00+00:00</published><updated>2019-02-03T00:00:00+00:00</updated><id>https://kristofk.com/posts/A-new-beginning</id><content type="html" xml:base="https://kristofk.com/posts/A-new-beginning">&lt;p&gt;Hello new world…&lt;/p&gt;

&lt;p&gt;This is the new face of kristofk.com. This version of the website is static so it should much better than the previous version which was developed using Wordpress.&lt;/p&gt;

&lt;p&gt;All my previous content still lives securely on the previous version of my website available at &lt;a href=&quot;https://old.kristofk.com&quot;&gt;old.kristofk.com&lt;/a&gt;.&lt;/p&gt;</content><author><name>Kristof Kocsis</name><email>kristof@kristofk.com</email></author><category term="Generic" /><summary type="html">Hello new world… This is the new face of kristofk.com. This version of the website is static so it should much better than the previous version which was developed using Wordpress. All my previous content still lives securely on the previous version of my website available at old.kristofk.com.</summary></entry><entry><title type="html">Response to Stack Overflow being unwelcoming</title><link href="https://kristofk.com/posts/Response-to-Stack-Overflow-being-unwelcoming" rel="alternate" type="text/html" title="Response to Stack Overflow being unwelcoming" /><published>2018-05-24T00:00:00+00:00</published><updated>2018-05-24T00:00:00+00:00</updated><id>https://kristofk.com/posts/Response-to-Stack-Overflow-being-unwelcoming</id><content type="html" xml:base="https://kristofk.com/posts/Response-to-Stack-Overflow-being-unwelcoming">&lt;p&gt;Stack Overflow not that long ago released a &lt;a href=&quot;https://stackoverflow.blog/2018/04/26/stack-overflow-isnt-very-welcoming-its-time-for-that-to-change/&quot;&gt;blog post&lt;/a&gt; about how Stack Overflow isn’t welcoming and that they mean to change that. At the end of the post, they are asking for feedback from users. This is my feedback and response to that post.&lt;/p&gt;

&lt;p&gt;Fun fun function made a &lt;a href=&quot;https://youtu.be/YYzt71o2IvQ&quot;&gt;video&lt;/a&gt; loosely tied to this blog post where MPJ talks about politeness and clear communication and how those 2 things relate to each other.&lt;/p&gt;

&lt;p&gt;I want to make a video that is a direct response to the blog post. Hopefully, I’m not too late.&lt;/p&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;my-experience-with-stack-overflow&quot;&gt;My experience with Stack Overflow&lt;/h1&gt;

&lt;p&gt;I’m an iOS developer with ~1 year of Development experience. I asked my first question on Stack overflow 2 years ago and I asked a lot since then. Those questions were not limited to Swift and iOS Development but other programming languages too.&lt;/p&gt;

&lt;h2 id=&quot;my-first-question&quot;&gt;My first Question&lt;/h2&gt;

&lt;p&gt;I asked my first question on Stack Overflow 2 years ago and it was the following: “ &lt;a href=&quot;https://stackoverflow.com/questions/37644514/how-to-access-the-second-element-of-an-array-in-a-dictionary-within-an-array&quot;&gt;How to access the second element of an array in a dictionary within an array?&lt;/a&gt;”&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/37644514/how-to-access-the-second-element-of-an-array-in-a-dictionary-within-an-array&quot;&gt;&lt;img src=&quot;https://res.cloudinary.com/kristofk-com/image/upload/v1565710158/kristofk-com/posts/2018-05-24-Response-to-Stack-Overflow-being-unwelcoming/Screen-Shot-2018-05-22-at-14.57.36-copy.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This question was arguably pretty stupid. But you have to take into consideration that at this point I was new to Stack Overflow and new to Swift. I didn’t even know that documentation existed let alone how to use it.&lt;/p&gt;

&lt;p&gt;And the community came at me and the question got downvoted to -6 and I got a few useless comments. I did get a good answer at the end and I believe that that guy went above and beyond for me.&lt;/p&gt;

&lt;p&gt;But if we take a look at the comments there is one that says “&lt;a href=&quot;https://stackoverflow.com/questions/37644514/how-to-access-the-second-element-of-an-array-in-a-dictionary-within-an-array#comment62768785_37644514&quot;&gt;You should consult documentation, why ask it there?&lt;/a&gt;”. This comment is really bad because it added no value and it made me feel like shit. On the other hand, there is a comment that is just a link to the proper page on the documentation. Which is much better, that person didn’t bother to formulate an opinion and didn’t waste time typing he just straight up gave me all I needed and went on with his life. This would be a much better way to handle such a situation.&lt;/p&gt;

&lt;p&gt;As to the downvotes, I have no clue what purpose they serve. One thing is for sure the -6 score on my account has nearly got me banned. And the cherry on top is that after all this I didn’t learn anything.&lt;/p&gt;

&lt;h2 id=&quot;current-status-of-my-account&quot;&gt;Current status of my account&lt;/h2&gt;

&lt;p&gt;I asked multiple “stupid” questions all of which got downvoted and now if I attempt to ask a question I see this red box:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://res.cloudinary.com/kristofk-com/image/upload/v1565710306/kristofk-com/posts/2018-05-24-Response-to-Stack-Overflow-being-unwelcoming/Screen-Shot-2018-05-22-at-18.03.13.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This is absolutely ridiculous in my opinion. My questions got downvoted mainly because they were too easy to answer and the community didn’t like them for &lt;strong&gt;WHATEVER&lt;/strong&gt; reason. I didn’t even get a chance to learn from my mistakes because when you downvote you aren’t required to provide an explanation.&lt;/p&gt;

&lt;p&gt;In my opinion, &lt;strong&gt;the possibility of getting banned as a result of anonymous, unexplained and possibly careless downvotes is a way too harsh sanction. The punishment is not in balance with the “crime”&lt;/strong&gt;.&lt;/p&gt;

&lt;h2 id=&quot;my-recourse-regarding-the-message-above&quot;&gt;My recourse regarding the message above&lt;/h2&gt;

&lt;p&gt;My main e-mail address and my name amongst others are associated with that account. So I didn’t want to take the chance of my account being banned from asking any more. If I were to ask a question &lt;strong&gt;I’d be at the mercy of the community&lt;/strong&gt; which tends to be overly negative.&lt;/p&gt;

&lt;p&gt;But I still wanted to ask questions. So what I did is register secondary accounts with my other email addresses. This was a good solution at first but then those accounts got banned.&lt;/p&gt;

&lt;p&gt;So I have evolved. I discovered that there are services out there that provide a burner email address to you for an hour. So I use these email addresses to register burner accounts to stack overflow. So far I have 3 accounts besides my main account 2 of which are banned I forgot the username and password for them so I have no access and I cannot even identify them. I’m not happy with this. I’d rather have all my questions stupid or not on my account but I feel that my hands are tied.&lt;/p&gt;

&lt;p&gt;Obviously, I have a problem with asking “bad questions”. But why would the community have the right to label a question right or wrong? After all, there is no such thing as a bad question and if there is then the asker shouldn’t be crucified just corrected.&lt;/p&gt;

&lt;p&gt;At one point I got so frustrated with Stack Overflow that I made a snarky comment in one of my videos encouraging others to do the same as me.&lt;/p&gt;

&lt;h3 id=&quot;what-is-it-like-asking-a-stupid-question-on-another-site&quot;&gt;What is it like asking a stupid question on another site&lt;/h3&gt;

&lt;p&gt;For example here is a question and the answer to it which would have been the final nail in the coffin for my main account but I asked it on the Swift forums:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; “&lt;a href=&quot;https://forums.swift.org/t/since-when-do-i-need-to-use-pointee-instead-of-memory-to-access-the-data-of-an-unsafemutable-pointer/12865&quot;&gt;Since when do I need to use ‘.pointee’ instead of ‘.memory’ to access the data of an UnsafeMutable pointer?&lt;/a&gt;”.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A:&lt;/strong&gt; “This happened “way back” in Swift 3 as part of &lt;a href=&quot;https://github.com/apple/swift-evolution/blob/master/proposals/0006-apply-api-guidelines-to-the-standard-library.md&quot;&gt;SE-0006: Apply API Guidelines to the Standard Library 9&lt;/a&gt; .”&lt;/p&gt;

&lt;p&gt;There was no downvoting, there were no useless comments and no bad rep, just a short answer. This is how Stack Overflow should be like. If a question is bad, let it sink as better ones will prevail.&lt;/p&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;my-problems-specifically&quot;&gt;My problems specifically&lt;/h1&gt;

&lt;p&gt;Stack Overflow’s post starts off by stating the central problem:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Too many people experience Stack Overflow¹ as a hostile or elitist place, especially newer coders, women, people of color, and others in marginalized groups.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I personally cannot speak for women, people of colour and other marginalized groups. I cannot even be a representative for newer coders since I wasn’t elected by anyone.&lt;/p&gt;

&lt;p&gt;But what I can do is state my opinion. I personally do not think that Stack Overflow is “hostile”. It would be that if people were bullied. I haven’t seen or experienced that on Stack Overflow. If I had then there would be a much bigger problem. In my opinion Stack Overflow is just generally an unwelcoming and unforgiving community that is very frustrating for new users and newbie developers (not to mention if both are true like in my case it was).&lt;/p&gt;

&lt;h2 id=&quot;marking-questions-as-duplicate&quot;&gt;Marking Questions as Duplicate&lt;/h2&gt;

&lt;p&gt;This isn’t a bad feature necessarily but I believe that it is used in the wrong way.&lt;/p&gt;

&lt;p&gt;It is only natural that we indicate that a question has been asked before or that it the same fundamentally or a similar question has been asked. But that doesn’t mean that the question thread should be closed and people should disregard or downvote the question.&lt;/p&gt;

&lt;p&gt;Here is an example. Swift is a rapidly evolving language. Syntax and language features change from year to year. So if a question was asked once, the answer may not apply anymore since there was a change in the language. Even though the question is the same word for word.&lt;/p&gt;

&lt;p&gt;Also if a question is marked as a duplicate but the other solution has to be modified significantly then the question is still worth answering in the same thread.&lt;/p&gt;

&lt;h3 id=&quot;my-solution-proposal&quot;&gt;My solution proposal&lt;/h3&gt;

&lt;p&gt;If a question is marked as a duplicate then the asker should be able to respond either&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Accepting&lt;/strong&gt; that his/her question was answered in which case the question can get archived. But still, this shouldn’t leave a negative mark on the profile of the user who asked it.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Appealing&lt;/strong&gt; In case the answer doesn’t apply or the answer still doesn’t solve his or her question. This could be because the problem is elsewhere and also answers can get deprecated.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;downvoting&quot;&gt;Downvoting&lt;/h2&gt;

&lt;p&gt;As of right now downvoting a question can bring serious consequences to the asker, like in my case. If a couple of questions from a specific user get downvoted then that user could be banned. This is absolutely nuts in my opinion since the people who downvote don’t even need to support their stance.&lt;/p&gt;

&lt;p&gt;Currently, the reasons I see why people would downvote are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Very easy question and the answer could be found elsewhere e.g. documentation&lt;/li&gt;
  &lt;li&gt;Doesn’t provide enough code to compile and reproduce the problem&lt;/li&gt;
  &lt;li&gt;Very hard question that is nearly impossible to solve&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;my-solution-proposal-1&quot;&gt;My solution proposal&lt;/h3&gt;

&lt;p&gt;All of the reasons I just mentioned above should not result in downvotes.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;If the solution to a question can indeed be found in a Documentation then that part of the Documentation should be linked as the answer.&lt;/li&gt;
  &lt;li&gt;If there isn’t enough code then we should be able to request more until we can grasp the problem.&lt;/li&gt;
  &lt;li&gt;In case the question is very hard and we cannot answer the question then maybe it could become a challenge and bonus points can be given to the first one who answers the questions.&lt;/li&gt;
  &lt;li&gt;I cannot even come up with any reason as to why one should downvote.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;one-mans-trash-is-another-mans-treasure&quot;&gt;One man’s trash is another man’s treasure&lt;/h3&gt;

&lt;p&gt;Just as an example my first question was “How do I access the second element of an array”. I asked this question 2 years ago and it was downvoted criticized and all. But this is my most popular question to date with 2k views. Meaning that what you might think is stupid others value. Imagine if this question was upvoted by everyone who found it useful. I’m sure it wouldn’t have -6 reputation. This again shows that it is encouraged to downvote but not to upvote.&lt;/p&gt;

&lt;h2 id=&quot;useless-comments&quot;&gt;Useless comments&lt;/h2&gt;

&lt;p&gt;Useless comments are left unpunished while useless questions get crucified.&lt;/p&gt;

&lt;p&gt;There are people who just simply comment:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;“It is in the documentation”&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/questions/15956427/href-turns-whole-line-into-a-link#comment22739908_15956427&quot;&gt;Don’t give it away, let the OP learn for themselves. We’re spoon feeding a generation of lazy people.&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Comments like these express the viewpoint of one person and are useless. As far as I’m aware Stack Overflow doesn’t encourage opinionated comments or questions and while bad questions don’t, bad answers like this one can ruin a site. So I think if anything bad comments should be punished.&lt;/p&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;general-philosophy-of-stack-overflow&quot;&gt;General philosophy of Stack Overflow&lt;/h1&gt;

&lt;p&gt;Currently, it is unclear, at least for beginners as to what the mission of this website is. Of course, it is a QA site, that is obvious. But what is not obvious is that there are many criteria for a question like it should reach a wide audience, it shouldn’t be opinionated and much more. This site in its current form should state that it is only accepting questions that are general, can be answered one way and one way only, it should be broad enough to reach a general audience. And these aren’t even the only requirements.&lt;/p&gt;

&lt;p&gt;Also, I believe in prevention over punishment. People aren’t asking bad questions to mess with the website or the community but because they know no better. The beginner ask page could be great but not only for beginners but for everyone and you could only opt out of it if you had maybe 100 points.&lt;/p&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;encouraging-the-community&quot;&gt;Encouraging the community&lt;/h1&gt;

&lt;p&gt;There is a whole lot of documentation on how to use Stack Overflow but it isn’t reasonable to expect that people read these before posting their first question. Anyone who asks a reasonable question deserves an answer even if it is duplicate silly or something along the lines.&lt;/p&gt;

&lt;p&gt;If you don’t agree with a question or think that it is bad then you should just disregard it, don’t make it your personal mission to destroy that question, after all, what has it done to you? It isn’t like someone is forcing you to answer questions.&lt;/p&gt;

&lt;p&gt;It should be encouraged to upvote questions, mark answers as correct and mark questions as answered.&lt;/p&gt;

&lt;p&gt;And logically the ones who should vote are the people with the same problem, not anyone who just stumbles upon the question and doesn’t like the wording of it.&lt;/p&gt;

&lt;p&gt;Also, there are some questionable badges. Like “Peer Pressure”. This is awarded if you delete a question that wasn’t well received. It could be a hilarious gag but as it is right now, this is a serious problem. This is one of the most awarded badge on Stack Overflow. Meaning that there are a lot of downvotes and intimidated people as a result.&lt;/p&gt;

&lt;p&gt;Imagine how many people would have found at least some of those questions useful. And imagine how many duplicate questions this resulted in as people deleted their questions and others posted the same one over and over again.&lt;/p&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;other-improvements&quot;&gt;Other improvements&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;Categorize profiles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If there was a badge on every profile that stated that they are newbies or beginners, advanced… it would allow the answerers to not be so hard on people. Newbies would need some guidance. It is ok to point out the mistakes and tell them how to improve some things. But if we anonymously down vote questions without explanation then why are we expecting to make a positive change?&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Curators/ moderators&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some questions are asked in the wrong place. It is just a law of nature. In this case, moderators should be able to edit the tags or the question and put it in the right place. I know that this works on Stack Overflow but I don’t see it in practice a lot. On other similar websites like Reddit and the Swift Forums, this works well.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Opinionated or other questions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If Stack Overflow won’t deal with opinionated questions and answers then there should be a disclaimer on the question writing page. Something like “Stack Overflow isn’t a site for asking for opinions! For that, you can go to Reddit: r/iosprogramming”.&lt;/p&gt;

&lt;p&gt;Sometimes I want to ask a question but I don’t have a specific problem that I want solved. Sometimes I’m just looking for advice and some guidance. Again if Stack Overflow doesn’t want to deal with such questions then there should be a short disclaimer.&lt;/p&gt;

&lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt;

&lt;p&gt;I know that some of the solutions I mentioned are already implemented in Stack Overflow, but I want to emphasise that what matters is action. The tools are useless if we aren’t practising theme.&lt;/p&gt;

&lt;p&gt;I know that this post had a rather negative voice but this was some tough love from me. I am rooting for Stack Overflow and I want is to succeed. I believe that they can reach a new level with the changes that are to come. This could be the start of a brand new experience on Stack Overflow where the community is supporting, encouraging, curious and helpful.&lt;/p&gt;

&lt;p&gt;I am willing to assist as much as I can but it is hard with a nearly banned account, so Stack Overflow, I would appreciate if you could help me out with that!&lt;/p&gt;</content><author><name>Kristof Kocsis</name><email>kristof@kristofk.com</email></author><category term="Generic" /><summary type="html">Stack Overflow not that long ago released a blog post about how Stack Overflow isn’t welcoming and that they mean to change that. At the end of the post, they are asking for feedback from users. This is my feedback and response to that post. Fun fun function made a video loosely tied to this blog post where MPJ talks about politeness and clear communication and how those 2 things relate to each other. I want to make a video that is a direct response to the blog post. Hopefully, I’m not too late. My experience with Stack Overflow I’m an iOS developer with ~1 year of Development experience. I asked my first question on Stack overflow 2 years ago and I asked a lot since then. Those questions were not limited to Swift and iOS Development but other programming languages too. My first Question I asked my first question on Stack Overflow 2 years ago and it was the following: “ How to access the second element of an array in a dictionary within an array?” This question was arguably pretty stupid. But you have to take into consideration that at this point I was new to Stack Overflow and new to Swift. I didn’t even know that documentation existed let alone how to use it. And the community came at me and the question got downvoted to -6 and I got a few useless comments. I did get a good answer at the end and I believe that that guy went above and beyond for me. But if we take a look at the comments there is one that says “You should consult documentation, why ask it there?”. This comment is really bad because it added no value and it made me feel like shit. On the other hand, there is a comment that is just a link to the proper page on the documentation. Which is much better, that person didn’t bother to formulate an opinion and didn’t waste time typing he just straight up gave me all I needed and went on with his life. This would be a much better way to handle such a situation. As to the downvotes, I have no clue what purpose they serve. One thing is for sure the -6 score on my account has nearly got me banned. And the cherry on top is that after all this I didn’t learn anything. Current status of my account I asked multiple “stupid” questions all of which got downvoted and now if I attempt to ask a question I see this red box: This is absolutely ridiculous in my opinion. My questions got downvoted mainly because they were too easy to answer and the community didn’t like them for WHATEVER reason. I didn’t even get a chance to learn from my mistakes because when you downvote you aren’t required to provide an explanation. In my opinion, the possibility of getting banned as a result of anonymous, unexplained and possibly careless downvotes is a way too harsh sanction. The punishment is not in balance with the “crime”. My recourse regarding the message above My main e-mail address and my name amongst others are associated with that account. So I didn’t want to take the chance of my account being banned from asking any more. If I were to ask a question I’d be at the mercy of the community which tends to be overly negative. But I still wanted to ask questions. So what I did is register secondary accounts with my other email addresses. This was a good solution at first but then those accounts got banned. So I have evolved. I discovered that there are services out there that provide a burner email address to you for an hour. So I use these email addresses to register burner accounts to stack overflow. So far I have 3 accounts besides my main account 2 of which are banned I forgot the username and password for them so I have no access and I cannot even identify them. I’m not happy with this. I’d rather have all my questions stupid or not on my account but I feel that my hands are tied. Obviously, I have a problem with asking “bad questions”. But why would the community have the right to label a question right or wrong? After all, there is no such thing as a bad question and if there is then the asker shouldn’t be crucified just corrected. At one point I got so frustrated with Stack Overflow that I made a snarky comment in one of my videos encouraging others to do the same as me. What is it like asking a stupid question on another site For example here is a question and the answer to it which would have been the final nail in the coffin for my main account but I asked it on the Swift forums: Q: “Since when do I need to use ‘.pointee’ instead of ‘.memory’ to access the data of an UnsafeMutable pointer?”. A: “This happened “way back” in Swift 3 as part of SE-0006: Apply API Guidelines to the Standard Library 9 .” There was no downvoting, there were no useless comments and no bad rep, just a short answer. This is how Stack Overflow should be like. If a question is bad, let it sink as better ones will prevail. My problems specifically Stack Overflow’s post starts off by stating the central problem: Too many people experience Stack Overflow¹ as a hostile or elitist place, especially newer coders, women, people of color, and others in marginalized groups. I personally cannot speak for women, people of colour and other marginalized groups. I cannot even be a representative for newer coders since I wasn’t elected by anyone. But what I can do is state my opinion. I personally do not think that Stack Overflow is “hostile”. It would be that if people were bullied. I haven’t seen or experienced that on Stack Overflow. If I had then there would be a much bigger problem. In my opinion Stack Overflow is just generally an unwelcoming and unforgiving community that is very frustrating for new users and newbie developers (not to mention if both are true like in my case it was). Marking Questions as Duplicate This isn’t a bad feature necessarily but I believe that it is used in the wrong way. It is only natural that we indicate that a question has been asked before or that it the same fundamentally or a similar question has been asked. But that doesn’t mean that the question thread should be closed and people should disregard or downvote the question. Here is an example. Swift is a rapidly evolving language. Syntax and language features change from year to year. So if a question was asked once, the answer may not apply anymore since there was a change in the language. Even though the question is the same word for word. Also if a question is marked as a duplicate but the other solution has to be modified significantly then the question is still worth answering in the same thread. My solution proposal If a question is marked as a duplicate then the asker should be able to respond either Accepting that his/her question was answered in which case the question can get archived. But still, this shouldn’t leave a negative mark on the profile of the user who asked it. Appealing In case the answer doesn’t apply or the answer still doesn’t solve his or her question. This could be because the problem is elsewhere and also answers can get deprecated. Downvoting As of right now downvoting a question can bring serious consequences to the asker, like in my case. If a couple of questions from a specific user get downvoted then that user could be banned. This is absolutely nuts in my opinion since the people who downvote don’t even need to support their stance. Currently, the reasons I see why people would downvote are: Very easy question and the answer could be found elsewhere e.g. documentation Doesn’t provide enough code to compile and reproduce the problem Very hard question that is nearly impossible to solve My solution proposal All of the reasons I just mentioned above should not result in downvotes. If the solution to a question can indeed be found in a Documentation then that part of the Documentation should be linked as the answer. If there isn’t enough code then we should be able to request more until we can grasp the problem. In case the question is very hard and we cannot answer the question then maybe it could become a challenge and bonus points can be given to the first one who answers the questions. I cannot even come up with any reason as to why one should downvote. One man’s trash is another man’s treasure Just as an example my first question was “How do I access the second element of an array”. I asked this question 2 years ago and it was downvoted criticized and all. But this is my most popular question to date with 2k views. Meaning that what you might think is stupid others value. Imagine if this question was upvoted by everyone who found it useful. I’m sure it wouldn’t have -6 reputation. This again shows that it is encouraged to downvote but not to upvote. Useless comments Useless comments are left unpunished while useless questions get crucified. There are people who just simply comment: “It is in the documentation” Don’t give it away, let the OP learn for themselves. We’re spoon feeding a generation of lazy people.. Comments like these express the viewpoint of one person and are useless. As far as I’m aware Stack Overflow doesn’t encourage opinionated comments or questions and while bad questions don’t, bad answers like this one can ruin a site. So I think if anything bad comments should be punished. General philosophy of Stack Overflow Currently, it is unclear, at least for beginners as to what the mission of this website is. Of course, it is a QA site, that is obvious. But what is not obvious is that there are many criteria for a question like it should reach a wide audience, it shouldn’t be opinionated and much more. This site in its current form should state that it is only accepting questions that are general, can be answered one way and one way only, it should be broad enough to reach a general audience. And these aren’t even the only requirements. Also, I believe in prevention over punishment. People aren’t asking bad questions to mess with the website or the community but because they know no better. The beginner ask page could be great but not only for beginners but for everyone and you could only opt out of it if you had maybe 100 points. Encouraging the community There is a whole lot of documentation on how to use Stack Overflow but it isn’t reasonable to expect that people read these before posting their first question. Anyone who asks a reasonable question deserves an answer even if it is duplicate silly or something along the lines. If you don’t agree with a question or think that it is bad then you should just disregard it, don’t make it your personal mission to destroy that question, after all, what has it done to you? It isn’t like someone is forcing you to answer questions. It should be encouraged to upvote questions, mark answers as correct and mark questions as answered. And logically the ones who should vote are the people with the same problem, not anyone who just stumbles upon the question and doesn’t like the wording of it. Also, there are some questionable badges. Like “Peer Pressure”. This is awarded if you delete a question that wasn’t well received. It could be a hilarious gag but as it is right now, this is a serious problem. This is one of the most awarded badge on Stack Overflow. Meaning that there are a lot of downvotes and intimidated people as a result. Imagine how many people would have found at least some of those questions useful. And imagine how many duplicate questions this resulted in as people deleted their questions and others posted the same one over and over again. Other improvements Categorize profiles If there was a badge on every profile that stated that they are newbies or beginners, advanced… it would allow the answerers to not be so hard on people. Newbies would need some guidance. It is ok to point out the mistakes and tell them how to improve some things. But if we anonymously down vote questions without explanation then why are we expecting to make a positive change? Curators/ moderators Some questions are asked in the wrong place. It is just a law of nature. In this case, moderators should be able to edit the tags or the question and put it in the right place. I know that this works on Stack Overflow but I don’t see it in practice a lot. On other similar websites like Reddit and the Swift Forums, this works well. Opinionated or other questions If Stack Overflow won’t deal with opinionated questions and answers then there should be a disclaimer on the question writing page. Something like “Stack Overflow isn’t a site for asking for opinions! For that, you can go to Reddit: r/iosprogramming”. Sometimes I want to ask a question but I don’t have a specific problem that I want solved. Sometimes I’m just looking for advice and some guidance. Again if Stack Overflow doesn’t want to deal with such questions then there should be a short disclaimer. Conclusion I know that some of the solutions I mentioned are already implemented in Stack Overflow, but I want to emphasise that what matters is action. The tools are useless if we aren’t practising theme. I know that this post had a rather negative voice but this was some tough love from me. I am rooting for Stack Overflow and I want is to succeed. I believe that they can reach a new level with the changes that are to come. This could be the start of a brand new experience on Stack Overflow where the community is supporting, encouraging, curious and helpful. I am willing to assist as much as I can but it is hard with a nearly banned account, so Stack Overflow, I would appreciate if you could help me out with that!</summary></entry><entry><title type="html">Evolve Your Brain – Book Review &amp;amp; Summary</title><link href="https://kristofk.com/posts/Evolve-Your-Brain-Book-Review-Summary" rel="alternate" type="text/html" title="Evolve Your Brain – Book Review &amp; Summary" /><published>2018-04-28T00:00:00+00:00</published><updated>2018-04-28T00:00:00+00:00</updated><id>https://kristofk.com/posts/Evolve-Your-Brain%E2%80%93Book-Review-Summary</id><content type="html" xml:base="https://kristofk.com/posts/Evolve-Your-Brain-Book-Review-Summary">&lt;h2 id=&quot;general-info&quot;&gt;General info&lt;/h2&gt;

&lt;p&gt;This book was a longer book, it is about 15hours of listening on Audible. I read it at 2x speed and finished it in about 2weeks. I really liked the book as a whole even though there were some boring parts in it. If you read the Psycho-Cybernetics before then you can think of this book as an expansion and update of that. This book expands on the topic. In a scientific way. I would have liked if this book mentioned Psycho-Cybernetics, it would have been nice if it paid tribute to it. Even the science of cybernetics is mentioned but not the book. I recognized the same advice multiple time in this book that Psycho-cybernetics already talked about. However, this book grounded everything in reality while that one didn’t exactly. Unlike Psycho-Cybernetics, this book didn’t compare the brain to computers. It disassociated from it even though it mentioned how important association in the brain is. I’m not saying that any of this is bad, I’m just comparing this book to that one because there are so many similarities.&lt;/p&gt;

&lt;h2 id=&quot;topics-discussed-in-the-book&quot;&gt;Topics discussed in the book&lt;/h2&gt;

&lt;p&gt;This book started out by hypothesizing about quantum possibilities and how our brain is the measuring tool that collapses the quantum possibility wave and our thoughts become matter. This idea immediately struck a chord with me. This would explain why some people believe that there is a shared intelligence between humans and it is possible to get ideas out of this shared intellect. This theory is also in line with the workings of Quantum computing, something that is dear to my heart.&lt;/p&gt;

&lt;p&gt;The book tells the story of how the author broke his back and healed himself without modern medicine and human intervention. Then the author tells us about patients who survived or healed from medical condition disregarding the doctors’ advice. There are 4 common things among these people and you can elevate your mind to this level too:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;There is a higher intelligence/ power&lt;/strong&gt;&lt;br /&gt;
Every patient believed that they can draw power from a higher intelligence within them&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Thoughts have a profound effect on our body&lt;/strong&gt;&lt;br /&gt;
They believed that their taught can control every aspect of their bodies, it has the power to make and break&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;People can reinvent themselves&lt;/strong&gt;&lt;br /&gt;
People are dynamic and are capable of massive change&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Humans can concentrate like nothing else&lt;/strong&gt;&lt;br /&gt;
Humans have the ability to rule out every brain function and to focus solely on the task at hand. This way we can lose the sense of time and space, that no other living creature can achieve.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;theory&quot;&gt;Theory&lt;/h3&gt;

&lt;p&gt;This book isn’t purely practical and pragmatic. There is a complete chapter in the book that goes through brain imaging machines and technical terms like synapses, lobes, cortex and much more. I found these chapters boring at the beginning but looking back now, I think it was useful. The information really isn’t overwhelming and it can add a lot to your general literacy and understanding of your brain. What is really useful, is that the author gives definitions for the &lt;strong&gt;brain&lt;/strong&gt;, &lt;strong&gt;mind&lt;/strong&gt; and &lt;strong&gt;consciousness&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The evolution of our nervous system is also discussed. The author goes to great lengths to compare our nervous system to those of jellyfish and other species. He looks at a difference between male and female brains for humans. Spoiler alert, he concludes that it is negligible.&lt;/p&gt;

&lt;h3 id=&quot;practical&quot;&gt;Practical&lt;/h3&gt;

&lt;p&gt;Some myth busting is sprinkled throughout the book. Every time a function of the brain is at hand, the author mentions old misconceptions. One such example that it is believed that the brain is a blank slate at birth. This isn’t exactly true. We already have genetic predispositions to out species and more importantly, out parents’ DNA. However, as we learn, we make new cells and connections and so we can create our own personalities.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The apple doesn’t fall far from the tree, but it can roll away.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Our brain evolves in accordance with how we utilize it so everybody’s brain is deferent based on education, occupation and surroundings. The brain adapts to whatever we expose it to. The motto of the book that gets repeated in almost every chapter is&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;What fires together wires together.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This way if a person is blind the brain can still utilize the unused part of the brain to enhance some other function. This is how blind people learn to read braille writing. The body creates finer receptors that are processed in the visual cortex.&lt;br /&gt;
The process of learning on a neurological level gets explained, which is the most practical part of the book:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;By learning &lt;strong&gt;new information&lt;/strong&gt; (semantic memories) and having &lt;strong&gt;new experiences&lt;/strong&gt; (episodic memories) we make new synaptic connections and evolve out brain’s hardware.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;We learn by association&lt;/strong&gt;&lt;br /&gt;
We use what we already know to understand the unknowns we encounter. When we fire neurological networks that are already developed from our knowledge and experience that part of the brain is now receptive to making new synaptic connections for greater understanding. This is Hebb’s Fire together wire together model of learning.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;We remember by repetition&lt;/strong&gt;&lt;br /&gt;
When we put our full attention on what we are learning and practice it repeatedly, firing these synaptic connections time and time again neurotrophic chemicals are released that cause the synapses between neurons to form long-term relationships. Neurons that repeatedly fire together, wire together more strongly.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;We have hardware in our brain&lt;/strong&gt;&lt;br /&gt;
that enables us to learn, to make the unknown know on both the Hebbian level of neurons (microscopic) and on the level of dual-brain (macroscopic) processing.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;stress&quot;&gt;Stress&lt;/h3&gt;

&lt;p&gt;There is a dedicated chapter in the book that demystifies stress. The author explores stress, how it comes to be, what its original purpose was and how it got turned inside-out in the modern world. The book also goes on to talk about addiction to the routine. How our brains are addicted to our comfort zone, to routine and the chemistry of our thoughts. This is slowing us down. We don’t get the chance to get better, to evolve our brain.&lt;/p&gt;

&lt;h3 id=&quot;personal-favourite--frontal-lobe&quot;&gt;Personal favourite – Frontal Lobe&lt;/h3&gt;

&lt;p&gt;My favourite chapter of the book talked about the unique part of our brain, the frontal lobe. In the whole animal kingdom, the ratio of the frontal lobe to the rest of the brain is the highest for humans. The frontal lobe is what allows us to deny the built-in processes of the brain and the outside stimulus so that we can act on our free will. This part of the brain is what can break our habits and allow us to concentrate. Buddhist monks have mastered this part of their brains. Their activity reading in this part of the brain is off the charts. The frontal lobe can be exercised like a muscle.&lt;/p&gt;

&lt;p&gt;Furthermore, the book talks about the mental reversal, feedback to our brain, priming amongst others. Another process that I found interesting in the book is the process to mastery:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Unconsciously unskilled&lt;/li&gt;
  &lt;li&gt;Consciously unskilled&lt;/li&gt;
  &lt;li&gt;Consciously skilled&lt;/li&gt;
  &lt;li&gt;Unconsciously skilled&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;I recommend this book to everyone regardless of age, gender or ethnicity. This book repeats and builds on top of Psycho-Cybernetics, which is another book I can only recommend.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;You can buy this book on Amazon (with my affiliate link)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.amazon.com/gp/product/B01MR060FW/ref=as_li_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=B01MR060FW&amp;amp;linkCode=as2&amp;amp;tag=kk03f5-20&amp;amp;linkId=5f6be88bf420b209097f03b8a12acac7&quot;&gt;Evolve Your Brain: The Science of Changing Your Mind&lt;/a&gt;&lt;img src=&quot;//ir-na.amazon-adsystem.com/e/ir?t=kk03f5-20&amp;amp;l=am2&amp;amp;o=1&amp;amp;a=B01MR060FW&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;iframe style=&quot;width: 120px; height: 240px;&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&amp;amp;OneJS=1&amp;amp;Operation=GetAdHtml&amp;amp;MarketPlace=US&amp;amp;source=ac&amp;amp;ref=tf_til&amp;amp;ad_type=product_link&amp;amp;tracking_id=kk03f5-20&amp;amp;marketplace=amazon&amp;amp;region=US&amp;amp;placement=B01MR060FW&amp;amp;asins=B01MR060FW&amp;amp;linkId=aa255c922bd06dcaae9e3f7617f633d2&amp;amp;show_border=true&amp;amp;link_opens_in_new_window=true&amp;amp;price_color=333333&amp;amp;title_color=0066c0&amp;amp;bg_color=ffffff&quot; width=&quot;300&quot; height=&quot;150&quot; frameborder=&quot;0&quot;&gt;&lt;br /&gt;&lt;/iframe&gt;</content><author><name>Kristof Kocsis</name><email>kristof@kristofk.com</email></author><category term="Books" /><summary type="html">General info This book was a longer book, it is about 15hours of listening on Audible. I read it at 2x speed and finished it in about 2weeks. I really liked the book as a whole even though there were some boring parts in it. If you read the Psycho-Cybernetics before then you can think of this book as an expansion and update of that. This book expands on the topic. In a scientific way. I would have liked if this book mentioned Psycho-Cybernetics, it would have been nice if it paid tribute to it. Even the science of cybernetics is mentioned but not the book. I recognized the same advice multiple time in this book that Psycho-cybernetics already talked about. However, this book grounded everything in reality while that one didn’t exactly. Unlike Psycho-Cybernetics, this book didn’t compare the brain to computers. It disassociated from it even though it mentioned how important association in the brain is. I’m not saying that any of this is bad, I’m just comparing this book to that one because there are so many similarities. Topics discussed in the book This book started out by hypothesizing about quantum possibilities and how our brain is the measuring tool that collapses the quantum possibility wave and our thoughts become matter. This idea immediately struck a chord with me. This would explain why some people believe that there is a shared intelligence between humans and it is possible to get ideas out of this shared intellect. This theory is also in line with the workings of Quantum computing, something that is dear to my heart. The book tells the story of how the author broke his back and healed himself without modern medicine and human intervention. Then the author tells us about patients who survived or healed from medical condition disregarding the doctors’ advice. There are 4 common things among these people and you can elevate your mind to this level too: There is a higher intelligence/ power Every patient believed that they can draw power from a higher intelligence within them Thoughts have a profound effect on our body They believed that their taught can control every aspect of their bodies, it has the power to make and break People can reinvent themselves People are dynamic and are capable of massive change Humans can concentrate like nothing else Humans have the ability to rule out every brain function and to focus solely on the task at hand. This way we can lose the sense of time and space, that no other living creature can achieve. Theory This book isn’t purely practical and pragmatic. There is a complete chapter in the book that goes through brain imaging machines and technical terms like synapses, lobes, cortex and much more. I found these chapters boring at the beginning but looking back now, I think it was useful. The information really isn’t overwhelming and it can add a lot to your general literacy and understanding of your brain. What is really useful, is that the author gives definitions for the brain, mind and consciousness. The evolution of our nervous system is also discussed. The author goes to great lengths to compare our nervous system to those of jellyfish and other species. He looks at a difference between male and female brains for humans. Spoiler alert, he concludes that it is negligible. Practical Some myth busting is sprinkled throughout the book. Every time a function of the brain is at hand, the author mentions old misconceptions. One such example that it is believed that the brain is a blank slate at birth. This isn’t exactly true. We already have genetic predispositions to out species and more importantly, out parents’ DNA. However, as we learn, we make new cells and connections and so we can create our own personalities. The apple doesn’t fall far from the tree, but it can roll away. Our brain evolves in accordance with how we utilize it so everybody’s brain is deferent based on education, occupation and surroundings. The brain adapts to whatever we expose it to. The motto of the book that gets repeated in almost every chapter is What fires together wires together. This way if a person is blind the brain can still utilize the unused part of the brain to enhance some other function. This is how blind people learn to read braille writing. The body creates finer receptors that are processed in the visual cortex. The process of learning on a neurological level gets explained, which is the most practical part of the book: By learning new information (semantic memories) and having new experiences (episodic memories) we make new synaptic connections and evolve out brain’s hardware. We learn by association We use what we already know to understand the unknowns we encounter. When we fire neurological networks that are already developed from our knowledge and experience that part of the brain is now receptive to making new synaptic connections for greater understanding. This is Hebb’s Fire together wire together model of learning. We remember by repetition When we put our full attention on what we are learning and practice it repeatedly, firing these synaptic connections time and time again neurotrophic chemicals are released that cause the synapses between neurons to form long-term relationships. Neurons that repeatedly fire together, wire together more strongly. We have hardware in our brain that enables us to learn, to make the unknown know on both the Hebbian level of neurons (microscopic) and on the level of dual-brain (macroscopic) processing. Stress There is a dedicated chapter in the book that demystifies stress. The author explores stress, how it comes to be, what its original purpose was and how it got turned inside-out in the modern world. The book also goes on to talk about addiction to the routine. How our brains are addicted to our comfort zone, to routine and the chemistry of our thoughts. This is slowing us down. We don’t get the chance to get better, to evolve our brain. Personal favourite – Frontal Lobe My favourite chapter of the book talked about the unique part of our brain, the frontal lobe. In the whole animal kingdom, the ratio of the frontal lobe to the rest of the brain is the highest for humans. The frontal lobe is what allows us to deny the built-in processes of the brain and the outside stimulus so that we can act on our free will. This part of the brain is what can break our habits and allow us to concentrate. Buddhist monks have mastered this part of their brains. Their activity reading in this part of the brain is off the charts. The frontal lobe can be exercised like a muscle. Furthermore, the book talks about the mental reversal, feedback to our brain, priming amongst others. Another process that I found interesting in the book is the process to mastery: Unconsciously unskilled Consciously unskilled Consciously skilled Unconsciously skilled Conclusion I recommend this book to everyone regardless of age, gender or ethnicity. This book repeats and builds on top of Psycho-Cybernetics, which is another book I can only recommend. You can buy this book on Amazon (with my affiliate link) Evolve Your Brain: The Science of Changing Your Mind</summary></entry><entry><title type="html">class init – Swift initializers pt. 2</title><link href="https://kristofk.com/posts/Swift-initializers-pt-2" rel="alternate" type="text/html" title="class init – Swift initializers pt. 2" /><published>2018-03-28T00:00:00+00:00</published><updated>2018-03-28T00:00:00+00:00</updated><id>https://kristofk.com/posts/Swift-initializers-pt-2</id><content type="html" xml:base="https://kristofk.com/posts/Swift-initializers-pt-2">&lt;p&gt;This is part 2 of Swift initializers. &lt;a href=&quot;https://kristofk.com/posts/Swift-initializers-pt-1&quot;&gt;You can find part 1 here&lt;/a&gt;. This post is going to be an exhaustive guide to initializers for Classes in Swift.&lt;/p&gt;

&lt;p&gt;I created a diagram about all the topics I am going to discuss here.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://res.cloudinary.com/kristofk-com/image/upload/v1565861982/kristofk-com/posts/2018-03-28-class-init%E2%80%93Swift-initializers-pt-2/initialization-types-transparent-min.png&quot; alt=&quot;class initialization diagramm&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;class&quot;&gt;Class&lt;/h1&gt;

&lt;p&gt;A class is a reference type in Swift meaning that each time you copy the instance it is going copy only the reference to the original instance. So if you change one instance then all the others will change as well.&lt;/p&gt;

&lt;p&gt;Classes support inheritance. The subclasses must initializer all the superclasses before use. This is going to be the trickiest part.&lt;/p&gt;

&lt;h1 id=&quot;root-classes&quot;&gt;Root classes&lt;/h1&gt;

&lt;p&gt;If your class doesn’t inherit from any other class then it is called a root class. This is the simplest form of a class. You don’t have to worry about initializing any other classes.&lt;/p&gt;

&lt;h2 id=&quot;designated-initializers&quot;&gt;Designated initializers&lt;/h2&gt;

&lt;p&gt;Designated initializers must set up an instance of the type so that it is ready to be used for the first time. This initializer is most similar to an initializer in a struct.&lt;/p&gt;

&lt;p&gt;All the properties get initializer before this init method completes.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;class Person {
	let name: String
	let height: String
	let weight: String

	init(name: String, height: String, weight: String) {
		self.name = name
		self.height = height
		self.weight = weight
	}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;convenience-initializers&quot;&gt;Convenience initializers&lt;/h2&gt;

&lt;p&gt;Convenience initializers don’t initialize the properties of the type directly. Rather they call the designated initializer. Convenience initializers are great if you’d like to accept different types of certain arguments or if you want to do some conversion. You can do these things in a convenience initializer and then call the designated initializer for the actual initialization.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;convenience init(firstName: String, lastName: String, height: String, weight: String) {
    let fullName = &quot;\(firstName) \(lastName)&quot;
    self.init(name: fullName, height: height, weight: weight)
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;failable-initialization&quot;&gt;Failable initialization&lt;/h2&gt;

&lt;p&gt;Just like in pt. 1 of initializers where I discussed initializers for structs, there are failable initializers for classes too. The purpose here is to not let a corrupted instance of a Type occur at any point of out code. You can use failing and throwing initializers. The behaviour is dependent on wether the initializer is a designated or a convenience initializer.&lt;/p&gt;

&lt;h3 id=&quot;failing-init&quot;&gt;Failing init&lt;/h3&gt;

&lt;p&gt;You use the &lt;code class=&quot;highlighter-rouge&quot;&gt;init?&lt;/code&gt;keyword in order to create a failing designated initializer. This allows you to return nil at any point in the initializer in order to render that instance unusable aka nil.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;// Designated init
init?(name: String, height: String, weight: String) {
	if name.isEmpty || height.isEmpty || weight.isEmpty { return nil }
	self.name = name
	self.height = height
	self.weight = weight
}

// Convenience init
convenience init?(firstName: String, lastName: String, height: String, weight: String) {
	let fullName = &quot;\(firstName) \(lastName)&quot;
	if fullName.isEmpty || height.isEmpty || weight.isEmpty { return nil }
	self.init(name: fullName, height: height, weight: weight)
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It is a good practice to have non-failing designated initializers and to encapsulate all your failing logic inside a convenience init. This makes the implementation clearer.&lt;/p&gt;

&lt;h1 id=&quot;subclasses&quot;&gt;Subclasses&lt;/h1&gt;

&lt;p&gt;Subclasses do everything that superclasses do, initialize their own properties. On top of that, they have to make sure that the initialize the superclasses too.&lt;/p&gt;

&lt;h2 id=&quot;designated-and-convenience-initializers&quot;&gt;Designated and convenience initializers&lt;/h2&gt;

&lt;p&gt;Subclasses, just like a superclass can define designated and convenience initializers. However, because superclasses have to be initialized, two-step initialization comes into the picture.&lt;/p&gt;

&lt;p&gt;In case of a designated initializer you have to do the following&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;initializer all the stored properties (you cannot directly initialize the superclass’s properties, only the ones that the class introduces)&lt;/li&gt;
  &lt;li&gt;Call the initializer method of the superclass (this makes sure that the superclass gets initialized properly)&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;class Male: Person {
	let gender = &quot;M&quot;
	var hairLength: String

	init(hairLength: String, name: String, height: String, weight: String) {
		self.hairLength = hairLength
		print(self.hairLength)
		super.init(name: name, height: height, weight: weight)
		print(self.name)
	}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Convenience initializers cannot call the the designated initializer of the superclass, but rather it can call the designated initializer of its’s class. So basically in the convenience initializer you should do all the failing and other logic and then delegate to the designated initializer in order to do the actual initialization. The designated initializer will also call the the superclass’s init so you are covered.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;class Male: Person {
	let gender = &quot;M&quot;
	var hairLength: String

	init(hairLength: String, name: String, height: String, weight: String) {
		self.hairLength = hairLength
		print(self.hairLength)
		super.init(name: name, height: height, weight: weight)
		print(self.name)
	}

	convenience init(name: String) {
		self.init(hairLength: &quot;3cm&quot;, name: &quot;Kristof Kocsis&quot;, height: &quot;195cm&quot;, weight: &quot;80kg&quot;)
	}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you override all the designated initializers of a superclass, you will inherit all the convenience initializers associated with that superclass. By default, these inherited convenience initializers will only call the overriden designated initializer. You can also give your own definition of the convenience init in the subclass.&lt;/p&gt;

&lt;h2 id=&quot;overriding-initializers&quot;&gt;Overriding initializers&lt;/h2&gt;

&lt;p&gt;In Swift, once you declare a designated initializer, you no longer have access to the superclass’s designated initializer to initialize the class. If you want to use the same initializer signature then you can override the original initializer. Override behaves a little different depending on if you are overriding a designated initializer or a convenience init and if you are overriding with a designated or a convenience init.&lt;/p&gt;

&lt;h3 id=&quot;overriding-a-designated-initializers&quot;&gt;Overriding a designated initializers&lt;/h3&gt;

&lt;p&gt;If you override the designated initializer of a superclass you still need to initialize the properties in the class and call super.init since you are only using the signature of the function and not the contents of it.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;class Male: Person {
	let gender = &quot;M&quot;
	var hairLength: String

	init(hairLength: String, name: String, height: String, weight: String) {
		self.hairLength = hairLength
		print(self.hairLength)
		super.init(name: name, height: height, weight: weight)
		print(self.name)
	}

	convenience init(name: String) {
		self.init(hairLength: &quot;3cm&quot;, name: &quot;Kristof Kocsis&quot;, height: &quot;195cm&quot;, weight: &quot;80kg&quot;)
	}

	override init(name: String, height: String, weight: String) {
		self.hairLength = &quot;0&quot;
		super.init(name: name, height: height, weight: weight)
	}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;overriding-convenience-initializers&quot;&gt;Overriding convenience initializers&lt;/h3&gt;

&lt;p&gt;Strictly speaking you cannot override a convenience init of a superclass. You can only override a designated init because you can call super.init and access a it. This is not the case with convenience initializers. You cannot access a superclass’s convenience initializer from a subclass.&lt;/p&gt;

&lt;p&gt;So if you want to use the same init signature as a convenience init’s signature in a superclass you can just simply create the same initializer without the override keyword and the compiler won’t complain.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;class SomeClass {
	var str: String

	init(str: String) {
		self.str = str
	}

	convenience init(strFromInt num: Int) {
		self.init(str: &quot;\(num)&quot;)
	}
}

class AnotherClass: SomeClass {
	var text: String

	init(text: String, str: String) {
		self.text = text
		super.init(str: str)
	}

	override init(str: String) {
		self.text = str
		super.init(str: str)
	}

	convenience init(strFromInt num: Int) {
		self.init(str: &quot;\(num)&quot;)
	}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;overriding-with-a-designated-vs-convenience-initializers&quot;&gt;Overriding with a designated vs convenience initializers&lt;/h2&gt;

&lt;p&gt;You just learned about overriding convenience and designated initializers. Now let’s talk about overriding the init method with either a convenience or designated init.&lt;/p&gt;

&lt;p&gt;All of our previous overrides were done using designated initializers. So this is when you can call super.init. However in this case, if have another designated init in your class and you have some logic in it, you cannot call it from the overridden designated init. This is because you cannot call a designated initializer from a designated initializer.&lt;/p&gt;

&lt;p&gt;If you want to override a superclass’s initializer and you want to call the subclass’s designated init the you can override with a convenience init. You declare a convenience overriding init by using&lt;code class=&quot;highlighter-rouge&quot;&gt;convenience override init&lt;/code&gt;. (You can also use &lt;code class=&quot;highlighter-rouge&quot;&gt;override convenience init&lt;/code&gt;, this makes no difference. But this makes your code harder to read since people might think you are overriding a convenience init which you arent. You are overriding a designated init with a convenience init.)&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;class SomeClass {
	var str: String

	init(str: String) {
		self.str = str
	}

	convenience init(strFromInt num: Int) {
		self.init(str: &quot;\(num)&quot;)
	}
}

class AnotherClass: SomeClass {
	var text: String

	init(text: String, str: String) {
		self.text = text
		super.init(str: str)
	}

	convenience override init(str: String) {
		self.init(text: &quot;&quot;, str: str)
	}

	convenience init(strFromInt num: Int) {
		self.init(str: &quot;\(num)&quot;)
	}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;initialization-funnel&quot;&gt;Initialization funnel&lt;/h2&gt;

&lt;p&gt;You might have been wondering about the &lt;code class=&quot;highlighter-rouge&quot;&gt;self.init&lt;/code&gt;and &lt;code class=&quot;highlighter-rouge&quot;&gt;super.init&lt;/code&gt;calls and how they work. Well they are a product of a concept called the Initialization funnel. This initialization funnel makes sure that you are initializing all your classes and that you are correctly initializing all your classes ion a hierarchy.&lt;/p&gt;

&lt;p&gt;In the initialization funnel a convenience init can only call one designated init in the same class or call another convenience init from the same class. Ultimately a convenience init must get to designated init. Designated initializers can only call one designated init from a superclass when if applicable.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://res.cloudinary.com/kristofk-com/image/upload/v1565861981/kristofk-com/posts/2018-03-28-class-init%E2%80%93Swift-initializers-pt-2/initializerDelegation-min.png&quot; alt=&quot;initialization funnel&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt;

&lt;p&gt;Now you know all there is to know about class initialization. If you read part 1 then you know everything there is to know about initialization in Swift.&lt;/p&gt;

&lt;p&gt;If you’d like to read more here are some useful resources:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Initialization.html&quot;&gt;Apple Official Documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.raywenderlich.com/121603/swift-tutorial-initialization-part-2&quot;&gt;Ray Wenderlich Initializers pt.2&lt;/a&gt;&lt;/p&gt;</content><author><name>Kristof Kocsis</name><email>kristof@kristofk.com</email></author><category term="SwiftDevelopment" /><summary type="html">This is part 2 of Swift initializers. You can find part 1 here. This post is going to be an exhaustive guide to initializers for Classes in Swift. I created a diagram about all the topics I am going to discuss here. Class A class is a reference type in Swift meaning that each time you copy the instance it is going copy only the reference to the original instance. So if you change one instance then all the others will change as well. Classes support inheritance. The subclasses must initializer all the superclasses before use. This is going to be the trickiest part. Root classes If your class doesn’t inherit from any other class then it is called a root class. This is the simplest form of a class. You don’t have to worry about initializing any other classes. Designated initializers Designated initializers must set up an instance of the type so that it is ready to be used for the first time. This initializer is most similar to an initializer in a struct. All the properties get initializer before this init method completes. class Person { let name: String let height: String let weight: String init(name: String, height: String, weight: String) { self.name = name self.height = height self.weight = weight } } Convenience initializers Convenience initializers don’t initialize the properties of the type directly. Rather they call the designated initializer. Convenience initializers are great if you’d like to accept different types of certain arguments or if you want to do some conversion. You can do these things in a convenience initializer and then call the designated initializer for the actual initialization. convenience init(firstName: String, lastName: String, height: String, weight: String) { let fullName = &quot;\(firstName) \(lastName)&quot; self.init(name: fullName, height: height, weight: weight) } Failable initialization Just like in pt. 1 of initializers where I discussed initializers for structs, there are failable initializers for classes too. The purpose here is to not let a corrupted instance of a Type occur at any point of out code. You can use failing and throwing initializers. The behaviour is dependent on wether the initializer is a designated or a convenience initializer. Failing init You use the init?keyword in order to create a failing designated initializer. This allows you to return nil at any point in the initializer in order to render that instance unusable aka nil. // Designated init init?(name: String, height: String, weight: String) { if name.isEmpty || height.isEmpty || weight.isEmpty { return nil } self.name = name self.height = height self.weight = weight } // Convenience init convenience init?(firstName: String, lastName: String, height: String, weight: String) { let fullName = &quot;\(firstName) \(lastName)&quot; if fullName.isEmpty || height.isEmpty || weight.isEmpty { return nil } self.init(name: fullName, height: height, weight: weight) } It is a good practice to have non-failing designated initializers and to encapsulate all your failing logic inside a convenience init. This makes the implementation clearer. Subclasses Subclasses do everything that superclasses do, initialize their own properties. On top of that, they have to make sure that the initialize the superclasses too. Designated and convenience initializers Subclasses, just like a superclass can define designated and convenience initializers. However, because superclasses have to be initialized, two-step initialization comes into the picture. In case of a designated initializer you have to do the following initializer all the stored properties (you cannot directly initialize the superclass’s properties, only the ones that the class introduces) Call the initializer method of the superclass (this makes sure that the superclass gets initialized properly) class Male: Person { let gender = &quot;M&quot; var hairLength: String init(hairLength: String, name: String, height: String, weight: String) { self.hairLength = hairLength print(self.hairLength) super.init(name: name, height: height, weight: weight) print(self.name) } } Convenience initializers cannot call the the designated initializer of the superclass, but rather it can call the designated initializer of its’s class. So basically in the convenience initializer you should do all the failing and other logic and then delegate to the designated initializer in order to do the actual initialization. The designated initializer will also call the the superclass’s init so you are covered. class Male: Person { let gender = &quot;M&quot; var hairLength: String init(hairLength: String, name: String, height: String, weight: String) { self.hairLength = hairLength print(self.hairLength) super.init(name: name, height: height, weight: weight) print(self.name) } convenience init(name: String) { self.init(hairLength: &quot;3cm&quot;, name: &quot;Kristof Kocsis&quot;, height: &quot;195cm&quot;, weight: &quot;80kg&quot;) } } If you override all the designated initializers of a superclass, you will inherit all the convenience initializers associated with that superclass. By default, these inherited convenience initializers will only call the overriden designated initializer. You can also give your own definition of the convenience init in the subclass. Overriding initializers In Swift, once you declare a designated initializer, you no longer have access to the superclass’s designated initializer to initialize the class. If you want to use the same initializer signature then you can override the original initializer. Override behaves a little different depending on if you are overriding a designated initializer or a convenience init and if you are overriding with a designated or a convenience init. Overriding a designated initializers If you override the designated initializer of a superclass you still need to initialize the properties in the class and call super.init since you are only using the signature of the function and not the contents of it. class Male: Person { let gender = &quot;M&quot; var hairLength: String init(hairLength: String, name: String, height: String, weight: String) { self.hairLength = hairLength print(self.hairLength) super.init(name: name, height: height, weight: weight) print(self.name) } convenience init(name: String) { self.init(hairLength: &quot;3cm&quot;, name: &quot;Kristof Kocsis&quot;, height: &quot;195cm&quot;, weight: &quot;80kg&quot;) } override init(name: String, height: String, weight: String) { self.hairLength = &quot;0&quot; super.init(name: name, height: height, weight: weight) } } Overriding convenience initializers Strictly speaking you cannot override a convenience init of a superclass. You can only override a designated init because you can call super.init and access a it. This is not the case with convenience initializers. You cannot access a superclass’s convenience initializer from a subclass. So if you want to use the same init signature as a convenience init’s signature in a superclass you can just simply create the same initializer without the override keyword and the compiler won’t complain. class SomeClass { var str: String init(str: String) { self.str = str } convenience init(strFromInt num: Int) { self.init(str: &quot;\(num)&quot;) } } class AnotherClass: SomeClass { var text: String init(text: String, str: String) { self.text = text super.init(str: str) } override init(str: String) { self.text = str super.init(str: str) } convenience init(strFromInt num: Int) { self.init(str: &quot;\(num)&quot;) } } Overriding with a designated vs convenience initializers You just learned about overriding convenience and designated initializers. Now let’s talk about overriding the init method with either a convenience or designated init. All of our previous overrides were done using designated initializers. So this is when you can call super.init. However in this case, if have another designated init in your class and you have some logic in it, you cannot call it from the overridden designated init. This is because you cannot call a designated initializer from a designated initializer. If you want to override a superclass’s initializer and you want to call the subclass’s designated init the you can override with a convenience init. You declare a convenience overriding init by usingconvenience override init. (You can also use override convenience init, this makes no difference. But this makes your code harder to read since people might think you are overriding a convenience init which you arent. You are overriding a designated init with a convenience init.) class SomeClass { var str: String init(str: String) { self.str = str } convenience init(strFromInt num: Int) { self.init(str: &quot;\(num)&quot;) } } class AnotherClass: SomeClass { var text: String init(text: String, str: String) { self.text = text super.init(str: str) } convenience override init(str: String) { self.init(text: &quot;&quot;, str: str) } convenience init(strFromInt num: Int) { self.init(str: &quot;\(num)&quot;) } } Initialization funnel You might have been wondering about the self.initand super.initcalls and how they work. Well they are a product of a concept called the Initialization funnel. This initialization funnel makes sure that you are initializing all your classes and that you are correctly initializing all your classes ion a hierarchy. In the initialization funnel a convenience init can only call one designated init in the same class or call another convenience init from the same class. Ultimately a convenience init must get to designated init. Designated initializers can only call one designated init from a superclass when if applicable. Conclusion Now you know all there is to know about class initialization. If you read part 1 then you know everything there is to know about initialization in Swift. If you’d like to read more here are some useful resources: Apple Official Documentation Ray Wenderlich Initializers pt.2</summary></entry><entry><title type="html">struct init – Swift initializers pt. 1</title><link href="https://kristofk.com/posts/Swift-initializers-pt-1" rel="alternate" type="text/html" title="struct init – Swift initializers pt. 1" /><published>2018-03-21T00:00:00+00:00</published><updated>2018-03-21T00:00:00+00:00</updated><id>https://kristofk.com/posts/Swift-initializers-pt-1</id><content type="html" xml:base="https://kristofk.com/posts/Swift-initializers-pt-1">&lt;p&gt;The topic of initialization in Swift if very important. You come across it every day. It is not a hard topic at all but there are many types of initalizers. This is a no-nonsense, in-depth look at initializer.&lt;/p&gt;

&lt;p&gt;The process of initialization in Swift encapsulates everything that is needed to prepare a type for use. Reference and Value types differ in how they use initializers.&lt;/p&gt;

&lt;p&gt;An initializer method sets up all the stored properties of a type and makes sure that the instance is ready to be used for the first time.&lt;/p&gt;

&lt;p&gt;Let’s look at initializers in structs. I made a small diagram of all the topics I’m going to mention about struct initialization. The diagram includes example code too.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://res.cloudinary.com/kristofk-com/image/upload/v1565952435/kristofk-com/posts/2018-03-21-Swift-initializers-pt-1/initialization-types-min.png&quot; alt=&quot;struct init diagram&quot; /&gt;&lt;/p&gt;

&lt;div&gt;&lt;div class=&quot;extensions extensions--video&quot;&gt;
  &lt;iframe src=&quot;https://www.youtube.com/embed/xDDBN9xko00?rel=0&amp;amp;showinfo=0&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;struct-init&quot;&gt;Struct init&lt;/h1&gt;

&lt;p&gt;A struct is a value type just like an enum. For this reason, structs behave differently compared to classes, since a &lt;span color=&quot;#c1349a&quot; style=&quot;color: #c1349a;&quot;&gt;class&lt;/span&gt; is a reference type.&lt;/p&gt;

&lt;h2 id=&quot;default-init&quot;&gt;Default &lt;span color=&quot;#aa0d2d&quot;&gt;&lt;span color=&quot;#c1349a&quot; style=&quot;color: #c1349a;&quot;&gt;init&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;Default initializers are generated for you by Xcode. By default, Xcode generates &lt;strong&gt;memberwise initialization&lt;/strong&gt; for you for each property with the properties’ names.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;struct ShoppingListItem {
	var name: String?
	var quantity = 1
	var purchased = false
}
var item2 = ShoppingListItem(name: &quot;&quot;, quantity: 1, purchased: false)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Otherwise, you can give &lt;strong&gt;default values for your properties&lt;/strong&gt; in which case the memberwise initializer will be an empty init method.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;struct ShoppingListItem {
	var name: String?
	var quantity = 1
	var purchased = false
}
var item = ShoppingListItem()
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Keep in mind that if you have an optional property without a default value then Xcode will assume that value is &lt;code class=&quot;highlighter-rouge&quot;&gt;nil&lt;/code&gt;by default.&lt;/p&gt;

&lt;h2 id=&quot;custom-init&quot;&gt;Custom init&lt;/h2&gt;

&lt;p&gt;Whenever you specify a custom initializer you override the default memberwise initializer.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;struct Celsius {
	var temperatureInCelsius: Double
	init(fromFahrenheit fahrenheit: Double) {
		temperatureInCelsius = (fahrenheit - 32.0) / 1.8
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Custom initializer methods behave much the same was as standard methods do.&lt;br /&gt;
You can give&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;the same name for the parameter name and the argument label&lt;/p&gt;

    &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;init(fahrenheit: Double) {
		temperatureInCelsius = (fahrenheit - 32.0) / 1.8
	}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;separate names for the parameter name and the argument label&lt;/p&gt;

    &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;init(fromFahrenheit fahrenheit: Double) {
		temperatureInCelsius = (fahrenheit - 32.0) / 1.8
	}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;omit the argument label&lt;/p&gt;

    &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;init(_ fahrenheit: Double) {
		temperatureInCelsius = (fahrenheit - 32.0) / 1.8
	}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;assign default values to the arguments&lt;/p&gt;

    &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;init(fromFahrenheit fahrenheit: Double = 32) {
		temperatureInCelsius = (fahrenheit - 32.0) / 1.8
	}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Alternatively, if you do not want to override the memberwise initializer then you can put all your custom initializers in an&lt;code class=&quot;highlighter-rouge&quot;&gt;extension&lt;/code&gt;. This way you can choose from all the initializers later on.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;struct Misc {
	let something: String
}

extension Misc {
	init(sth: String = &quot;&quot;) {
		self.something = sth
	}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://res.cloudinary.com/kristofk-com/image/upload/v1565952434/kristofk-com/posts/2018-03-21-Swift-initializers-pt-1/Screen-Shot-2018-03-15-at-20.09.02-min-1024x268.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;initializer-delegation&quot;&gt;Initializer delegation&lt;/h2&gt;

&lt;p&gt;If you are creating multiple initializers but all of them initialize the same properties then it is a good practice to utilize initializer delegation. This means that you create a main initializer (this could be the memberwise initializer) and all the other initializers call this one. This helps us maintain the DRY (Don’t Repeat Yourself) principle.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;struct Name {
	var prefix: String
	let fullName: String
	var prefixName: String
}

extension Name {
	init(prefix: String = &quot;Mr.&quot;, fullName: String) {
		let prefixName = &quot;\(prefix) \(fullName)&quot;
		self.init(prefix: prefix, fullName: fullName, prefixName: prefixName)
	}

	init(prefix: String = &quot;Mr.&quot;, firstName: String, lastName: String) {
		let fullName = &quot;\(firstName) \(lastName)&quot;
		self.init(prefix: prefix, fullName: fullName)
	}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Be aware that &lt;span color=&quot;#c1349a&quot; style=&quot;color: #c1349a;&quot;&gt;init&lt;/span&gt; delegation leads to another concept and that is the &lt;strong&gt;2 phase initialization&lt;/strong&gt;. This basically means that in an initialization method that calls another initializer you cannot use &lt;span color=&quot;#c1349a&quot; style=&quot;color: #c1349a;&quot;&gt;self&lt;/span&gt; before &lt;span color=&quot;#c1349a&quot; style=&quot;color: #c1349a;&quot;&gt;self.init&lt;/span&gt;. This splits up the init method into two distinct parts:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Phase 1 is before the &lt;span color=&quot;#c1349a&quot; style=&quot;color: #c1349a;&quot;&gt;self.init&lt;/span&gt; call and you cannot use self&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Phase 2 is after the &lt;span color=&quot;#c1349a&quot; style=&quot;color: #c1349a;&quot;&gt;self.init&lt;/span&gt; call where you can use self&lt;/p&gt;

    &lt;p&gt;init(prefix: String = “Mr.”, fullName: String) {
		let prefixName = “(prefix) (fullName)”
		// self.greet is inaccessiable here
		self.init(prefix: prefix, fullName: fullName, prefixName: prefixName)
		self.greet()
	}&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;failable-init&quot;&gt;Failable &lt;span color=&quot;#c1349a&quot; style=&quot;color: #c1349a;&quot;&gt;init&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;In some cases, types cannot be initialized. This can be due to invalid or missing data or many other reasons too. In this case, you don’t want to work with invalid types. For this reason, Swift has failable initializers that can either return nil or throw an error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Failing initializers&lt;/strong&gt; are the ones that return nil. This is a very simple approach and you won’t necessarily know what caused the error. You can specify a failing initializer with the a “?” (&lt;code class=&quot;highlighter-rouge&quot;&gt;init?&lt;/code&gt;).&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;struct Animal {
	let species: String
	init?(species: String) {
		if species.isEmpty { return nil }
		self.species = species
	}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Throwing initializers&lt;/strong&gt; are somewhat more sophisticated as they can give you an actual error instead of just nil. For this, you also need an Error type to throw. You specify a throwing initializer with the &lt;code class=&quot;highlighter-rouge&quot;&gt;throws&lt;/code&gt;keyword (&lt;code class=&quot;highlighter-rouge&quot;&gt;init() throws&lt;/code&gt;).&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;enum AnimalError: Error {
	case noSpeciesDefined
}

struct Animal {
	let species: String
	init(species: String) throws {
		if species.isEmpty { throw AnimalError.noSpeciesDefined }
		self.species = species
	}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There are of course multiple ways can deal with throwing functions but here is one.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;do {
	try Animal(species: &quot;&quot;)
} catch {
	print(&quot;error&quot;)
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;partial-conclusion&quot;&gt;Partial conclusion&lt;/h1&gt;

&lt;p&gt;This was just part 1 of the no-nonsense guide to initialization in Swift. Now you know all the ins and outs of initializing &lt;code class=&quot;highlighter-rouge&quot;&gt;structs&lt;/code&gt;in Swift.&lt;/p&gt;

&lt;p&gt;Stay tuned for part 2 in which I’ll be looking into initializers for classes.&lt;/p&gt;

&lt;p&gt;References:&lt;a href=&quot;https://www.raywenderlich.com/119922/swift-tutorial-initialization-part-1&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.raywenderlich.com/119922/swift-tutorial-initialization-part-1&quot;&gt;RayWenderlich – Initialization In Depth&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Initialization.html&quot;&gt;Official Apple Documentation&lt;/a&gt;&lt;/p&gt;</content><author><name>Kristof Kocsis</name><email>kristof@kristofk.com</email></author><category term="SwiftDevelopment" /><summary type="html">The topic of initialization in Swift if very important. You come across it every day. It is not a hard topic at all but there are many types of initalizers. This is a no-nonsense, in-depth look at initializer. The process of initialization in Swift encapsulates everything that is needed to prepare a type for use. Reference and Value types differ in how they use initializers. An initializer method sets up all the stored properties of a type and makes sure that the instance is ready to be used for the first time. Let’s look at initializers in structs. I made a small diagram of all the topics I’m going to mention about struct initialization. The diagram includes example code too. Struct init A struct is a value type just like an enum. For this reason, structs behave differently compared to classes, since a class is a reference type. Default init Default initializers are generated for you by Xcode. By default, Xcode generates memberwise initialization for you for each property with the properties’ names. struct ShoppingListItem { var name: String? var quantity = 1 var purchased = false } var item2 = ShoppingListItem(name: &quot;&quot;, quantity: 1, purchased: false) Otherwise, you can give default values for your properties in which case the memberwise initializer will be an empty init method. struct ShoppingListItem { var name: String? var quantity = 1 var purchased = false } var item = ShoppingListItem() Keep in mind that if you have an optional property without a default value then Xcode will assume that value is nilby default. Custom init Whenever you specify a custom initializer you override the default memberwise initializer. struct Celsius { var temperatureInCelsius: Double init(fromFahrenheit fahrenheit: Double) { temperatureInCelsius = (fahrenheit - 32.0) / 1.8 } Custom initializer methods behave much the same was as standard methods do. You can give the same name for the parameter name and the argument label init(fahrenheit: Double) { temperatureInCelsius = (fahrenheit - 32.0) / 1.8 } separate names for the parameter name and the argument label init(fromFahrenheit fahrenheit: Double) { temperatureInCelsius = (fahrenheit - 32.0) / 1.8 } omit the argument label init(_ fahrenheit: Double) { temperatureInCelsius = (fahrenheit - 32.0) / 1.8 } assign default values to the arguments init(fromFahrenheit fahrenheit: Double = 32) { temperatureInCelsius = (fahrenheit - 32.0) / 1.8 } Alternatively, if you do not want to override the memberwise initializer then you can put all your custom initializers in anextension. This way you can choose from all the initializers later on. struct Misc { let something: String } extension Misc { init(sth: String = &quot;&quot;) { self.something = sth } } Initializer delegation If you are creating multiple initializers but all of them initialize the same properties then it is a good practice to utilize initializer delegation. This means that you create a main initializer (this could be the memberwise initializer) and all the other initializers call this one. This helps us maintain the DRY (Don’t Repeat Yourself) principle. struct Name { var prefix: String let fullName: String var prefixName: String } extension Name { init(prefix: String = &quot;Mr.&quot;, fullName: String) { let prefixName = &quot;\(prefix) \(fullName)&quot; self.init(prefix: prefix, fullName: fullName, prefixName: prefixName) } init(prefix: String = &quot;Mr.&quot;, firstName: String, lastName: String) { let fullName = &quot;\(firstName) \(lastName)&quot; self.init(prefix: prefix, fullName: fullName) } } Be aware that init delegation leads to another concept and that is the 2 phase initialization. This basically means that in an initialization method that calls another initializer you cannot use self before self.init. This splits up the init method into two distinct parts: Phase 1 is before the self.init call and you cannot use self Phase 2 is after the self.init call where you can use self init(prefix: String = “Mr.”, fullName: String) { let prefixName = “(prefix) (fullName)” // self.greet is inaccessiable here self.init(prefix: prefix, fullName: fullName, prefixName: prefixName) self.greet() } Failable init In some cases, types cannot be initialized. This can be due to invalid or missing data or many other reasons too. In this case, you don’t want to work with invalid types. For this reason, Swift has failable initializers that can either return nil or throw an error. Failing initializers are the ones that return nil. This is a very simple approach and you won’t necessarily know what caused the error. You can specify a failing initializer with the a “?” (init?). struct Animal { let species: String init?(species: String) { if species.isEmpty { return nil } self.species = species } } Throwing initializers are somewhat more sophisticated as they can give you an actual error instead of just nil. For this, you also need an Error type to throw. You specify a throwing initializer with the throwskeyword (init() throws). enum AnimalError: Error { case noSpeciesDefined } struct Animal { let species: String init(species: String) throws { if species.isEmpty { throw AnimalError.noSpeciesDefined } self.species = species } } There are of course multiple ways can deal with throwing functions but here is one. do { try Animal(species: &quot;&quot;) } catch { print(&quot;error&quot;) } Partial conclusion This was just part 1 of the no-nonsense guide to initialization in Swift. Now you know all the ins and outs of initializing structsin Swift. Stay tuned for part 2 in which I’ll be looking into initializers for classes. References: RayWenderlich – Initialization In Depth Official Apple Documentation</summary></entry><entry><title type="html">Events, releases, utilities • iDevReport • Week 11, 2018</title><link href="https://kristofk.com/posts/idevreport-week11" rel="alternate" type="text/html" title="Events, releases, utilities • iDevReport • Week 11, 2018" /><published>2018-03-18T00:00:00+00:00</published><updated>2018-03-18T00:00:00+00:00</updated><id>https://kristofk.com/posts/idevreport-week11</id><content type="html" xml:base="https://kristofk.com/posts/idevreport-week11">&lt;p&gt;There are new interesting events coming up and there are some new interesting utilities you might want to use in your workflow.&lt;/p&gt;

&lt;h1 id=&quot;releases&quot;&gt;Releases&lt;/h1&gt;

&lt;h2 id=&quot;apple-released-new-beta-software&quot;&gt;&lt;a href=&quot;https://developer.apple.com/news/releases/?id=03122018a&quot;&gt;Apple released new beta software:&lt;/a&gt;&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;span&gt;macOS 10.13.4 beta 5 (17E182a)&lt;br /&gt;
&lt;a href=&quot;https://9to5mac.com/2018/03/12/macos-10-13-4-beta-5/&quot;&gt;Track features on 9to5mac&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span&gt;iOS 11.3 beta 5 (15E5211a), iOS 11.3 beta 6 (15E5216a)&lt;/span&gt;&lt;span&gt;&lt;br /&gt;
The release notes for beta 5 is the same as beta 4&lt;br /&gt;
&lt;a href=&quot;https://9to5mac.com/2018/03/12/ios-11-3-beta-5/&quot;&gt;Track features on 9to5mac&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span&gt;tvOS 11.3 beta 5 (15L5208a)&lt;br /&gt;
&lt;a href=&quot;https://9to5mac.com/2018/03/12/tvos-11-3-beta-5/&quot;&gt;Track features on 9to5mac&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;watchOS 4.3 beta 5 (15T5209a), &lt;span&gt;watchOS 4.3 beta 6 (15T5212a)&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://9to5mac.com/2018/03/12/watchos-4-3-beta-5/&quot;&gt;Track features on 9to5mac&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;events&quot;&gt;Events&lt;/h1&gt;

&lt;h2 id=&quot;wwdc2018&quot;&gt;&lt;a href=&quot;https://developer.apple.com/wwdc/&quot;&gt;WWDC2018&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;This year the Apple Developer conference will be held in San Jose, CA on June 4-8. By the cover art, we can expect new AR announcements. All the usual sessions, hands-on, consultations, get-togethers will be available.&lt;/p&gt;

&lt;h2 id=&quot;altconf&quot;&gt;&lt;a href=&quot;http://altconf.com&quot;&gt;AltConf&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;span&gt;THE ALTERNATIVE APPLE DEVELOPER CONFERENCE. AltCOnf is very similar to Apple’s WWDC. It tries to offer the same events as hands-on, speakers and much more. This is a community event and you can enter for free.&lt;/span&gt;&lt;/p&gt;

&lt;h1 id=&quot;articles--blog-posts&quot;&gt;Articles &amp;amp; Blog posts&lt;/h1&gt;

&lt;h2 id=&quot;designing-jank-free-apps&quot;&gt;&lt;a href=&quot;https://medium.com/@nathangitter/designing-jank-free-apps-9f66d43b9c87&quot;&gt;Designing Jank-Free Apps&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;span&gt;With the release of iOS 11, there was widespread concern that Apple’s software quality was declining. Many users experienced performance issues, software bugs, and visual glitches. This blog post looks into how you can solve those pesky visual glitches.&lt;/span&gt;&lt;/p&gt;

&lt;h2 id=&quot;using-tuples-as-lightweight-types-in-swift&quot;&gt;&lt;a href=&quot;https://www.swiftbysundell.com/posts/using-tuples-as-lightweight-types-in-swift&quot;&gt;Using tuples as lightweight types in Swift&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;span&gt;Even though it’s a simple concept, it opens up some really cool opportunities, both in terms of API design and when structuring code.&lt;/span&gt;&lt;/p&gt;

&lt;h1 id=&quot;utilities&quot;&gt;Utilities&lt;/h1&gt;

&lt;h2 id=&quot;supernova&quot;&gt;&lt;a href=&quot;https://supernova.studio&quot;&gt;Supernova&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Supernova is a new utility from a startup based in the Czech Republic. It promises to convert sketch designs into the native design for either iOS or Android. It has monthly and yearly plans available and a free trial too. There are free services online that offer to do the same thing. I haven’t tried Supernova myself, but for the price, I hope that they do a good job.&lt;/p&gt;

&lt;h2 id=&quot;ios-dev-directory&quot;&gt;&lt;a href=&quot;https://iosdevdirectory.com&quot;&gt;iOS Dev Directory&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;iOS Dev Directory is a website that collects and organises all the iOS related websites and blog. It is open source so you can contribute to it yourself. I’d highly recommend you check it out and I’ll be working on bringing my website to this list.&lt;/p&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;one-more-thing&quot;&gt;One more thing&lt;/h1&gt;

&lt;p&gt;This is going to be the last release of iDevReport. This was my attempt at bringing the latest happenings in the community to you. However, I’m stopping with it now. I created this weekly post to have something I can release each week. Since then I have sounded cool new projects to work on that interests me unlike this. So in the future iDevReport is no longer active but new projects are on their way.&lt;/p&gt;</content><author><name>Kristof Kocsis</name><email>kristof@kristofk.com</email></author><category term="iDevReport" /><summary type="html">There are new interesting events coming up and there are some new interesting utilities you might want to use in your workflow. Releases Apple released new beta software: macOS 10.13.4 beta 5 (17E182a) Track features on 9to5mac iOS 11.3 beta 5 (15E5211a), iOS 11.3 beta 6 (15E5216a) The release notes for beta 5 is the same as beta 4 Track features on 9to5mac tvOS 11.3 beta 5 (15L5208a) Track features on 9to5mac watchOS 4.3 beta 5 (15T5209a), watchOS 4.3 beta 6 (15T5212a) Track features on 9to5mac Events WWDC2018 This year the Apple Developer conference will be held in San Jose, CA on June 4-8. By the cover art, we can expect new AR announcements. All the usual sessions, hands-on, consultations, get-togethers will be available. AltConf THE ALTERNATIVE APPLE DEVELOPER CONFERENCE. AltCOnf is very similar to Apple’s WWDC. It tries to offer the same events as hands-on, speakers and much more. This is a community event and you can enter for free. Articles &amp;amp; Blog posts Designing Jank-Free Apps With the release of iOS 11, there was widespread concern that Apple’s software quality was declining. Many users experienced performance issues, software bugs, and visual glitches. This blog post looks into how you can solve those pesky visual glitches. Using tuples as lightweight types in Swift Even though it’s a simple concept, it opens up some really cool opportunities, both in terms of API design and when structuring code. Utilities Supernova Supernova is a new utility from a startup based in the Czech Republic. It promises to convert sketch designs into the native design for either iOS or Android. It has monthly and yearly plans available and a free trial too. There are free services online that offer to do the same thing. I haven’t tried Supernova myself, but for the price, I hope that they do a good job. iOS Dev Directory iOS Dev Directory is a website that collects and organises all the iOS related websites and blog. It is open source so you can contribute to it yourself. I’d highly recommend you check it out and I’ll be working on bringing my website to this list. One more thing This is going to be the last release of iDevReport. This was my attempt at bringing the latest happenings in the community to you. However, I’m stopping with it now. I created this weekly post to have something I can release each week. Since then I have sounded cool new projects to work on that interests me unlike this. So in the future iDevReport is no longer active but new projects are on their way.</summary></entry><entry><title type="html">Lazy Stored Property – DevTip</title><link href="https://kristofk.com/posts/lazy-keyword-swift" rel="alternate" type="text/html" title="Lazy Stored Property – DevTip" /><published>2018-03-14T00:00:00+00:00</published><updated>2018-03-14T00:00:00+00:00</updated><id>https://kristofk.com/posts/lazy-keyword-swift</id><content type="html" xml:base="https://kristofk.com/posts/lazy-keyword-swift">&lt;p&gt;Chances are that you have used or at least have seen the &lt;code class=&quot;highlighter-rouge&quot;&gt;lazy&lt;/code&gt;keyword used before. However, you have never stopped to think about what are the true capabilities of a lazy stored property. I want to tell you about what lazy properties are, why they exist and how you can take advantage of them.&lt;/p&gt;

&lt;div&gt;&lt;div class=&quot;extensions extensions--video&quot;&gt;
  &lt;iframe src=&quot;https://www.youtube.com/embed/AIPBxEmPsqQ?rel=0&amp;amp;showinfo=0&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;ground-work&quot;&gt;Ground Work&lt;/h1&gt;

&lt;p&gt;The initial value of lazy stored properties isn’t calculated and assigned until you call the property. You can think of this as an on-demand property, it doesn’t exist in the memory until you call it.&lt;/p&gt;

&lt;p&gt;A lazy property must always be a variable since constants must always have an initial value at the instance initialization.&lt;/p&gt;

&lt;p class=&quot;warning&quot;&gt;&lt;strong&gt;Lazy stored properties aren’t thread safe!&lt;/strong&gt;&lt;br /&gt;
If a property marked with the &lt;code class=&quot;highlighter-rouge&quot;&gt;lazy&lt;/code&gt; modifier is accessed by multiple threads simultaneously and the property has not yet been initialized, there is no guarantee that the property will be initialized only once.&lt;/p&gt;

&lt;h1 id=&quot;when-do-you-use-a-lazy-stored-property&quot;&gt;When do you use a lazy stored property?&lt;/h1&gt;

&lt;ol&gt;
  &lt;li&gt;When the property is dependent on an outside source and the value may not be known until after the initialization is complete (asynchronous calls like web request)&lt;/li&gt;
  &lt;li&gt;If the initial value of the property requires a computationally expensive setup that should not be performed until the value is needed&lt;/li&gt;
  &lt;li&gt;To avoid optionals AKA non-optionaloptionss&lt;/li&gt;
  &lt;li&gt;Keep initializers clean by deferring some setup until after later in the life-cycle of the object&lt;/li&gt;
&lt;/ol&gt;

&lt;h1 id=&quot;using-lazy-stored-properties&quot;&gt;Using lazy stored properties&lt;/h1&gt;

&lt;p&gt;The &lt;strong&gt;simplest way to implement&lt;/strong&gt; a lazy stored property is by putting the lazy keyword before a variable with a default value. This means that the property won’t be initialized during the type’s initialization process. The initial value is only going to be assigned when the property is called.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;class SomeClass {
	lazy var storedProp = &quot;&quot;
}

let instance = SomeClass()
instance.storedProp // The property isn't initialized until this point
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Another way to initialize a lazy property is by &lt;strong&gt;using a method&lt;/strong&gt;. This is useful if you want to separate the property and the initialization or if you have a lengthy and complex initialization. For this, you need to create an initialization method and call that on the property.&lt;br /&gt;
In the example, I used the Fibonacci numbers as they can be computationally heavy. I made this example vary unoptimized to make a point, this isn’t how you would implement this in real life.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;class SomeClass {
	lazy var fibonacciNumbers = self.createFirstFewFibonacciNumbers()

	func addOneMoreFibonacciNumber() {
		let currentNum = fibonacciNumbers.last!
		let prevNum = fibonacciNumbers[fibonacciNumbers.count - 2]

		let newNum = currentNum + prevNum
		fibonacciNumbers.append(newNum)
	}

	private func createFirstFewFibonacciNumbers() -&amp;gt; [Int] {
		var fibonacciNumbers = [0, 1, 1]
		for index in 2...8 {
			let currentNum = fibonacciNumbers[index]
			let prevNum = fibonacciNumbers[index - 1]

			let newNum = currentNum + prevNum
			fibonacciNumbers.append(newNum)
		}
		return fibonacciNumbers
	}
}

let instance = SomeClass()
instance.addOneMoreFibonacciNumber()
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you’re like me and you like compactness when it doesn’t compromise readability then you can move all the code that is defined in the initialization method into an &lt;a href=&quot;https://kristofk.com/posts/swift4-closure-expressions&quot;&gt;&lt;strong&gt;auto-executing closure&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;class SomeClass {
	lazy var fibonacciNumbers: [Int] = {
		var fibonacciNumbers = [0, 1, 1]
		for index in 2...8 {
			let currentNum = fibonacciNumbers[index]
			let prevNum = fibonacciNumbers[index - 1]

			let newNum = currentNum + prevNum
			fibonacciNumbers.append(newNum)
		}
		return fibonacciNumbers
	}()

	func addOneMoreFibonacciNumber() {
		let currentNum = fibonacciNumbers.last!
		let prevNum = fibonacciNumbers[fibonacciNumbers.count - 2]

		let newNum = currentNum + prevNum
		fibonacciNumbers.append(newNum)
	}
}

let instance = SomeClass()
instance.addOneMoreFibonacciNumber()
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There is one more way you can assign an initial value to a lazy property, that is &lt;strong&gt;using type methods&lt;/strong&gt;. This method capitalizes on the single responsibility principle and type decoupling. This is the most tedious of all and I only recommend it if you actually find a good use for it.&lt;br /&gt;
For instance, in my example, I have 2 classes. One which is all about the Fibonacci numbers and the other one is a general maths class.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;class FibonacciNumbers {
	static func createFirstFewFibonacciNumbers() -&amp;gt; [Int] {
		var fibonacciNumbers = [0, 1, 1]
		for index in 2...8 {
			let currentNum = fibonacciNumbers[index]
			let prevNum = fibonacciNumbers[index - 1]

			let newNum = currentNum + prevNum
			fibonacciNumbers.append(newNum)
		}
		return fibonacciNumbers
	}
}

class Maths {
	lazy var fibonacciNumbers = FibonacciNumbers.createFirstFewFibonacciNumbers()

	/*
	Other stuff here! e.g.
	let pi = 3.14159265359
	*/
}

let instance = SomeClass()
instance.fibonacciNumbers
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt;

&lt;p&gt;Lazy stored properties can be very useful for optimizing RAM and CPU usage and keeping our code base readable.&lt;/p&gt;

&lt;p&gt;There is no sign of performance difference between any of the above methods of initializing the property.&lt;/p&gt;

&lt;p&gt;If you have any questions you can ask me in the comments or on Twitter @kristofkocsis.&lt;/p&gt;

&lt;p&gt;If you’d like to know more about lazy stored properties I recommend the following resources:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;a href=&quot;https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Properties.html&quot;&gt;&lt;span size=&quot;4&quot; style=&quot;font-size: large;&quot;&gt;Apple Official Documentation page&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;a href=&quot;https://www.swiftbysundell.com/posts/using-lazy-properties-in-swift&quot;&gt;Using lazy properties in Swift – Swift by Sundell&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;a href=&quot;https://www.hackingwithswift.com/example-code/language/what-are-lazy-variables&quot;&gt;What are lazy variables? – Hacking with Swift&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Kristof Kocsis</name><email>kristof@kristofk.com</email></author><category term="SwiftDevelopment" /><summary type="html">Chances are that you have used or at least have seen the lazykeyword used before. However, you have never stopped to think about what are the true capabilities of a lazy stored property. I want to tell you about what lazy properties are, why they exist and how you can take advantage of them. Ground Work The initial value of lazy stored properties isn’t calculated and assigned until you call the property. You can think of this as an on-demand property, it doesn’t exist in the memory until you call it. A lazy property must always be a variable since constants must always have an initial value at the instance initialization. Lazy stored properties aren’t thread safe! If a property marked with the lazy modifier is accessed by multiple threads simultaneously and the property has not yet been initialized, there is no guarantee that the property will be initialized only once. When do you use a lazy stored property? When the property is dependent on an outside source and the value may not be known until after the initialization is complete (asynchronous calls like web request) If the initial value of the property requires a computationally expensive setup that should not be performed until the value is needed To avoid optionals AKA non-optionaloptionss Keep initializers clean by deferring some setup until after later in the life-cycle of the object Using lazy stored properties The simplest way to implement a lazy stored property is by putting the lazy keyword before a variable with a default value. This means that the property won’t be initialized during the type’s initialization process. The initial value is only going to be assigned when the property is called. class SomeClass { lazy var storedProp = &quot;&quot; } let instance = SomeClass() instance.storedProp // The property isn't initialized until this point Another way to initialize a lazy property is by using a method. This is useful if you want to separate the property and the initialization or if you have a lengthy and complex initialization. For this, you need to create an initialization method and call that on the property. In the example, I used the Fibonacci numbers as they can be computationally heavy. I made this example vary unoptimized to make a point, this isn’t how you would implement this in real life. class SomeClass { lazy var fibonacciNumbers = self.createFirstFewFibonacciNumbers() func addOneMoreFibonacciNumber() { let currentNum = fibonacciNumbers.last! let prevNum = fibonacciNumbers[fibonacciNumbers.count - 2] let newNum = currentNum + prevNum fibonacciNumbers.append(newNum) } private func createFirstFewFibonacciNumbers() -&amp;gt; [Int] { var fibonacciNumbers = [0, 1, 1] for index in 2...8 { let currentNum = fibonacciNumbers[index] let prevNum = fibonacciNumbers[index - 1] let newNum = currentNum + prevNum fibonacciNumbers.append(newNum) } return fibonacciNumbers } } let instance = SomeClass() instance.addOneMoreFibonacciNumber() If you’re like me and you like compactness when it doesn’t compromise readability then you can move all the code that is defined in the initialization method into an auto-executing closure. class SomeClass { lazy var fibonacciNumbers: [Int] = { var fibonacciNumbers = [0, 1, 1] for index in 2...8 { let currentNum = fibonacciNumbers[index] let prevNum = fibonacciNumbers[index - 1] let newNum = currentNum + prevNum fibonacciNumbers.append(newNum) } return fibonacciNumbers }() func addOneMoreFibonacciNumber() { let currentNum = fibonacciNumbers.last! let prevNum = fibonacciNumbers[fibonacciNumbers.count - 2] let newNum = currentNum + prevNum fibonacciNumbers.append(newNum) } } let instance = SomeClass() instance.addOneMoreFibonacciNumber() There is one more way you can assign an initial value to a lazy property, that is using type methods. This method capitalizes on the single responsibility principle and type decoupling. This is the most tedious of all and I only recommend it if you actually find a good use for it. For instance, in my example, I have 2 classes. One which is all about the Fibonacci numbers and the other one is a general maths class. class FibonacciNumbers { static func createFirstFewFibonacciNumbers() -&amp;gt; [Int] { var fibonacciNumbers = [0, 1, 1] for index in 2...8 { let currentNum = fibonacciNumbers[index] let prevNum = fibonacciNumbers[index - 1] let newNum = currentNum + prevNum fibonacciNumbers.append(newNum) } return fibonacciNumbers } } class Maths { lazy var fibonacciNumbers = FibonacciNumbers.createFirstFewFibonacciNumbers() /* Other stuff here! e.g. let pi = 3.14159265359 */ } let instance = SomeClass() instance.fibonacciNumbers Conclusion Lazy stored properties can be very useful for optimizing RAM and CPU usage and keeping our code base readable. There is no sign of performance difference between any of the above methods of initializing the property. If you have any questions you can ask me in the comments or on Twitter @kristofkocsis. If you’d like to know more about lazy stored properties I recommend the following resources: Apple Official Documentation page Using lazy properties in Swift – Swift by Sundell What are lazy variables? – Hacking with Swift</summary></entry><entry><title type="html">iOS SDK 10 years – Swift bug • iDevReport • Week 10, 2018</title><link href="https://kristofk.com/posts/idevreport-week10" rel="alternate" type="text/html" title="iOS SDK 10 years – Swift bug • iDevReport • Week 10, 2018" /><published>2018-03-11T00:00:00+00:00</published><updated>2018-03-11T00:00:00+00:00</updated><id>https://kristofk.com/posts/idevreport-week10</id><content type="html" xml:base="https://kristofk.com/posts/idevreport-week10">&lt;p&gt;This week was the ?10th anniversary of the iPhone OS SDK?. On March 6. 2008, Apple announced that they are going to allow 3rd party developers to use the same development tools as Apple does. This changed the lives of many. Not so much for me since I have only been a developer since the release of Swift but still this was a special event to look back on.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://res.cloudinary.com/kristofk-com/image/upload/v1566026884/kristofk-com/posts/2018-03-11-idevreport-week10/Screenshot-2018-03-10-10.18.29-1024x550.png.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;new-releases&quot;&gt;New releases&lt;/h1&gt;

&lt;p&gt;Apple released a new version for every OS and a beta update to Xcode too.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;span style=&quot;font-size: 18px;&quot;&gt;Xcode 9.3 beta 4&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-size: 18px;&quot;&gt;The main change here is conditional compilation in Swift. &lt;a href=&quot;http://www.amarendrasingh.com/ios/xcode/whats-new-in-xcode-9-3/&quot;&gt;&lt;em&gt;Source&lt;/em&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span size=&quot;4&quot; style=&quot;font-size: large;&quot;&gt;WatchOS 4.3 beta 4&lt;br /&gt;
9to5Mac is following the feature changes &lt;a href=&quot;https://9to5mac.com/2018/03/06/watchos-4-3-beta-4/&quot;&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;iOS 11.3 beta 4&lt;br /&gt;
Again, 9to5mac is following the iOS feature changes &lt;a href=&quot;https://9to5mac.com/2018/03/05/ios-11-3-beta-4/&quot;&gt;here&lt;/a&gt;. This new version of iOS suggests &lt;a href=&quot;https://9to5mac.com/2018/03/06/apple-pay-transit-beta-beijing-shanghai/&quot;&gt;Apple Pay transit coming&lt;/a&gt; to Beijing and Shanghai and it seems the &lt;a href=&quot;https://9to5mac.com/2018/03/05/ios-11-3-beta-4-tv-app-brazil-soon/&quot;&gt;TV app is coming to Brazil&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;macOS 10.13.4 beta 4&lt;br /&gt;
You can follow the feature changes on &lt;a href=&quot;https://9to5mac.com/2018/03/05/macos-10-13-4-beta-4/&quot;&gt;9to5mac&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;tvOS 11.3 beta 4&lt;br /&gt;
As always, feature changes on &lt;a href=&quot;https://9to5mac.com/2018/03/05/tvos-11-3-beta-4/&quot;&gt;9to5mac&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;blog-post--articles&quot;&gt;Blog post &amp;amp; Articles&lt;/h1&gt;

&lt;h2 id=&quot;solving-a-mysterious-heap-corruption-crash&quot;&gt;&lt;a href=&quot;https://topologyeyewear.github.io/engineering-blog/2018/03/07/heap_corruption/&quot;&gt;&lt;u&gt;Solving a Mysterious Heap Corruption Crash&lt;/u&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;This is an investigative tale by Agnes Vasarhelyi (a fellow Hungarian). The post discusses how she found a bug in the App and the process of eliminating it. Spoiler alert: Swift is involved. In the end, she shares what Apple’s Swift team had to say. This is a truly interesting read.&lt;/p&gt;

&lt;h2 id=&quot;improving-your-ios-apps-launch-time&quot;&gt;&lt;a href=&quot;https://techblog.izotope.com/2018/03/08/improving-your-ios-apps-launch-time/&quot;&gt;&lt;u&gt;Improving your iOS App’s Launch Time&lt;/u&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;span&gt;This is a guide to improving the launch time of any iOS app. It covers how to analyze your launch time and some strategies we’ve used here at iZotope to make the&lt;/span&gt; &lt;a href=&quot;https://www.spire.live/content/spire/en/spire-app.html&quot;&gt;&lt;span&gt;Spire app&lt;/span&gt;&lt;/a&gt; &lt;span&gt;launch faster.&lt;/span&gt;&lt;/p&gt;

&lt;h2 id=&quot;how-to-use-swift-playgrounds-to-help-with-ui-development&quot;&gt;&lt;a href=&quot;http://swiftyjimmy.com/swift-playgrounds-ui-development/&quot;&gt;&lt;u&gt;How to use Swift playgrounds to help with UI development&lt;/u&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;This is a lengthy post about how you can utilize the playgrounds for UI development. This is from the same person that not that long ago showed us how to run an entire project in a playground. If you are looking for a snappy way to develop UI, this is the place to start.&lt;/p&gt;

&lt;h1 id=&quot;utility&quot;&gt;Utility&lt;/h1&gt;

&lt;h2 id=&quot;hackterms&quot;&gt;&lt;a href=&quot;https://www.hackterms.com&quot;&gt;&lt;u&gt;Hackterms&lt;/u&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Hackterms is a crowdsourced dictionary for programming terms. It is basically the urban dictionary for programmers. You can register and contribute to the page. It is a responsive page and it could be a great resource for developers. I know I would have loved this when I was starting out.&lt;/p&gt;

&lt;h2 id=&quot;the-developers-toolbox&quot;&gt;&lt;a href=&quot;https://medium.com/mobile-quality/the-developers-toolbox-daaaa875081e&quot;&gt;&lt;u&gt;The Developer’s Toolbox&lt;/u&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;This is a list of all sorts of useful tools for iOS Developers. It lists both UI and Terminal based apps. It goes through all the apps from design to development and testing.&lt;/p&gt;

&lt;h1 id=&quot;my-resources&quot;&gt;My resources&lt;/h1&gt;

&lt;h2 id=&quot;an-exhaustive-guide-to-the-static-keyword-aka-type-methods-in-swift-swiftcore&quot;&gt;An exhaustive guide to the Static keyword AKA Type methods in Swift SwiftCore&lt;/h2&gt;

&lt;p&gt;This week I made a video about the static keyword in Swift. It discusses all the use cases of it. This is part of my SwiftCore series in which I take a Swift concept and I explain it. You can find this content on my &lt;a href=&quot;https://kristofk.com/posts/static-keyword-swift&quot;&gt;website&lt;/a&gt; and on &lt;a href=&quot;https://www.youtube.com/channel/UC60VWleORVQ5rBEt85oqErQ&quot;&gt;youtube&lt;/a&gt;.&lt;/p&gt;</content><author><name>Kristof Kocsis</name><email>kristof@kristofk.com</email></author><category term="iDevReport" /><summary type="html">This week was the ?10th anniversary of the iPhone OS SDK?. On March 6. 2008, Apple announced that they are going to allow 3rd party developers to use the same development tools as Apple does. This changed the lives of many. Not so much for me since I have only been a developer since the release of Swift but still this was a special event to look back on. New releases Apple released a new version for every OS and a beta update to Xcode too. Xcode 9.3 beta 4 The main change here is conditional compilation in Swift. Source WatchOS 4.3 beta 4 9to5Mac is following the feature changes here. iOS 11.3 beta 4 Again, 9to5mac is following the iOS feature changes here. This new version of iOS suggests Apple Pay transit coming to Beijing and Shanghai and it seems the TV app is coming to Brazil. macOS 10.13.4 beta 4 You can follow the feature changes on 9to5mac. tvOS 11.3 beta 4 As always, feature changes on 9to5mac. Blog post &amp;amp; Articles Solving a Mysterious Heap Corruption Crash This is an investigative tale by Agnes Vasarhelyi (a fellow Hungarian). The post discusses how she found a bug in the App and the process of eliminating it. Spoiler alert: Swift is involved. In the end, she shares what Apple’s Swift team had to say. This is a truly interesting read. Improving your iOS App’s Launch Time This is a guide to improving the launch time of any iOS app. It covers how to analyze your launch time and some strategies we’ve used here at iZotope to make the Spire app launch faster. How to use Swift playgrounds to help with UI development This is a lengthy post about how you can utilize the playgrounds for UI development. This is from the same person that not that long ago showed us how to run an entire project in a playground. If you are looking for a snappy way to develop UI, this is the place to start. Utility Hackterms Hackterms is a crowdsourced dictionary for programming terms. It is basically the urban dictionary for programmers. You can register and contribute to the page. It is a responsive page and it could be a great resource for developers. I know I would have loved this when I was starting out. The Developer’s Toolbox This is a list of all sorts of useful tools for iOS Developers. It lists both UI and Terminal based apps. It goes through all the apps from design to development and testing. My resources An exhaustive guide to the Static keyword AKA Type methods in Swift SwiftCore This week I made a video about the static keyword in Swift. It discusses all the use cases of it. This is part of my SwiftCore series in which I take a Swift concept and I explain it. You can find this content on my website and on youtube.</summary></entry></feed>