Wednesday, January 22, 2020

Çocuğum mutlu olsun yeter

Bir tanıdığım televizyondaki eğitim programında şöyle bir diyaloğa şahit olmuş:
Veli: Çocuğuma matematikten özel ders aldırıyorum, ancak matematiği sevmediği için zorlanıyor, ne yapmalıyım?
Uzman: Çocuğunuz hangi konularla ilgileniyor?
Veli: Tarihi seviyor.
Uzman: Çocuğa tarihten özel ders aldırın, böylece vasat bir matematikçi olacağına üst düzey bir tarihçi olma şansını yakalar.
Bu diyalogda sorunlu bulduğum nokta tamamen çocuğun neyi sevdiğine odaklanılması. Çocuk matematiğe ilgi duymayabilir, ancak matematik önemli ve çocuğa "bunu zorlukların üstesinden gelme becerini geliştirmek olarak gör, bu beceri her alanda önemli" denilebilir. İlgi duyduğu alanlarda zaten çocuğun çok az desteğe ihtiyacı oluyor, örneğin internette nereye bakması gerektiğini göstermek yetiyor, gerisini kendi getiriyor zaten.

Çocukların ilgileri sık sık değişiyor; bir gün zoolog olası geliyor, bir gün piyanist, bir gün astronot. İlgilendikleri alanlarda çaba gösterdikçe desteklenmeliler. Örneğin piyanoya ilgi duydu diye hemen piyano alınmaz, çocuk aylarca kendi isteğiyle kursa gittikten sonra hala istiyorsa alınır. Evler atıl durumdaki piyanolarla dolu!

Sık sık duyduğum bir cümle "çocuğum mutlu olsun yeter", sanki mutlu olmak çok kolay bir şeymiş gibi... Mutlu olmanın en garantili yolu başkalarının işine yaramaya odaklanmaktır. İşe yaramak için seçtiğin konuda uzman olmalısın, uzmanlık da 10 bin saat (5-10 yıl) tecrübeyle edinilir. Sevdiğin bir alanda dahi çalışırken zamanının çoğu zorlukları aşmakla, işin sıkıcı kısımlarının üstesinden gelmekle geçer. Zorlukları aşabilmek için antrenmanlı olman gerekir. Sadece sevdiğin şeyleri yapmaya alışmışsan sıkıcı/zor noktalarda büyük olasılıkla vazgeçersin.

İşe yararlığın yanında gelire dönüşme olasılığı da çok önemli. Para her sorunu çözmez ama parayla ilgili sorunları çözer(!) Tipik mesleklere bir bakalım:

Eğitim = Öğretmenlik
Sağlık = Doktorluk
Üretim = Mühendislik
Eğlence = Müzisyenlik

En yararlı meslek öğretmenlik ancak ne yazık ki eğitimin çok karmaşık bir alan olmasından dolayı çoğu veli kendi çocuğuna en uygun eğitimin nasıl olması gerektiğinden bihaber ama bildiğini sanıyor. Neyin doğru, neyin yanlış olduğu ayırt edilemiyor, eğitim sistemi içinden çıkılmaz bir hale geliyor, bu da iyi öğretmenin motivasyonunu çok düşürüyor. İnsanlık aydınlanma çağına ulaşana kadar öğretmenlik bence hobi olarak yapılmalı, profesyonel halinde sizi hayal kırıklıkları, ağır çalışma koşulları ve düşük gelir bekliyor. Ben ekmeğimi yazılım mühendisliğinden kazanıyorum, öğretmenliği de hafta sonları gönüllü olarak çocuklara robotik ve kodlama anlatarak yapıyorum.

Doktorluk ve mühendislik yarar-gelir dengesinin iyi olduğu meslekler, uluslararası geçerlilikleri var.

Eğlence alanı da insanların hayatına renk ve anlam katması açısından çok yararlı. Ancak piyasada az sayıda insana yer olduğundan birkaç sanatçı gelirin çoğuna sahip oluyor, geri kalanlar fakirlik sınırında yaşıyor.

Özetlersek, çocuklara en başta kazandırmamız gereken beceri zorlukların üstesinden gelmektir (persistence). İkinci olarak yararlı olmaya odaklanmalarına yardımcı olmalıyız. Çabayla destekledikleri bariz bir yetenekleri yoksa mümkünse doktor veya mühendis olsunlar (hangisini daha çok seviyor ya da hangisi daha az eziyetli geliyorsa). Bu meslekler dışında tutkuları varsa onu da hobi olarak yapsınlar. Ayrıca her meslek yeterince tecrübe kazanıldığında danışmanlığa, organizasyon ve şirket kurmaya, nihayetinde pasif gelire açık, ömrünüzü hep aynı şeyi yaparak geçireceksiniz diye bir kural yok.

Müzik: Survivor - Eye Of The Tiger

Thursday, January 09, 2020

Effect of good software design on maintenance and innovation

If the design of a complex software project is poor, a lot of effort has to be spent to maintain the system. If design is good, more time will be freed up for innovation instead of wasting time to keep the product barely working.

Music: The Stable Song - Gregory Alan Isakov (Peanut Butter Falcon soundtrack)

Wednesday, January 01, 2020

Future of car maintenance

Cars are equipped with more and more sensors which are connected to the cloud. For example, you might get a call from your car company when your airbags are activated and they'll ask you if you need help.

As instrumentation increases, it becomes possible to identify root causes of car malfunctions by correlating failures to sensor data. This is exactly what AI (neural networks) is good at. The car cloud knows the history of each specific car and can notify the user of probable failures before they happen. As data increases, so does the reliability of predictions. This is a form of predictive maintenance.

Ideally, high resolution data and machine learning could lead to servicing cars only when risks of failure pass a threshold, reducing unnecessary part changes and making periodic service visits a thing of the past.

Another interesting use case: Advanced Automatic Collision Notification

Tuesday, December 31, 2019

Solving inheritance ambiguity with composition

Let's say you have the following C++ classes, making use of the observer pattern:

In implementation of class A, you call Notify(T) of CObservable.

When you compile, you will get a message that there is ambiguity in calling Notify(), because the compiler does not know if it should call Notify(T) with class T1 as a parameter or T2.

The solution is to remove CObservable from inherited classes and introduce a field, i.e. using composition over inheritance. You also need to have a registerT2Observer() method that in turn calls the register method of CObservable:

Letters to a novice programmer

Dear novice, this time it has been a short while, isn't it? When you have a dll that you call from both a Java app and C++ app with the same inputs but the outputs differ, do not suspect that there might be something wrong with the operating system or JNI. Your problems will always be due to something you did wrong.

You should write some debug code inside the C++ dll that prints dll inputs to a file. Run the dll from Java and C++ and compare dll inputs. I guarantee you that you will see a difference there because most probably you did something wrong before passing the inputs to dll like using a wrong index or making an erroneous unit conversion.

Another tip: When comparing files, never trust your eyes, always use a comparison tool like Total Commander's "Compare by content" or Beyond Compare.

Thursday, December 26, 2019

Letters to a novice programmer

Dear novice, it has been a while since my last letter. Today I want to stress the importance of revisiting your code every couple of months or so and asking yourself "could I achieve the same functionality with less code?". In other words, be your own garbage collector. If you do this a couple of times, your code might graduate from being miserable to being tolerable. And who knows, one day it might even attain the coveted status of being "elegant"?

Today's example concerns avoiding unnecessary local variables to reduce clutter:

Wednesday, December 25, 2019

Lessons from teaching my kid math for 10 months with Khan Academy

I have been teaching my 7 year old child mathematics with Khan Academy since February 2019. Everyday at about 19:00, we have a 15 minute session. Right now we are at 85% of 4th grade. During this time, I discovered that the difficulty of math does not lie in concepts, but in the high degree of attention it requires. Contrast a reading assignment with a math problem; In reading, you might omit a few letters, even words and still get the essence of the text and be able to answer questions correctly. With a math problem, if you misread even one symbol, you will be completely wrong. In this respect, math resembles software development.

During our problem solving sessions, I saw again and again that my son had no problem with the subject matter but was usually missing a bit and getting the answer wrong. When I helped him just a little by telling him to be more careful, he was able to solve most of the problems.

I suspect many students who are bad at math struggle due to a lack of attention. Unfortunately, improving attention requires one on one care, which the education system cannot provide. Parents have to help their kids.

Other lessons learnt:
  1. It is frustrating to witness that your child forgets the math rule you explained a minute ago. Be patient and repeat as much as necessary.
  2. Only advance to the next subject when your child can solve all of the end of chapter questions without any assistance from you. You might be dismayed by how many times he might have to repeat that test. As an example, my child solved all 18 questions of Understanding Decimals unit test in one sitting on his 13th try. It took him almost two weeks of frustration and tears! This sharpened his attention and cured his false sense of self-confidence(!)
  3. Every couple of months, revisit older subjects by re-solving their unit tests.
  4. My son is impatient and wants to solve problems quickly in his head. This works for simple operations but once you get to problems involving multiple steps like 12*17, you have to force him to use pencil and paper and show each step clearly to you.
  5. Since every child is different (and also rapidly changes with time), progress and tactics will be different. You have to constantly observe and adapt to the learning/teaching challenges you and your child will face.
  6. Persistence is key and the hardest part. It is easy to teach a couple of times, but most parents struggle to do it consistently.
How am I able to keep him marching on through this difficult journey? First, I have earned his respect and trust by being useful to him in subjects he cares about like video games, internet and sports. Second, I do not refrain from punishing him by reducing his video game time if he gets out of line.

Music: Chumbawamba - Tubthumping