lunes, 27 de abril de 2020

Pair Programming


This technique has been in my repertoire since the beginning of my career as a software developer and is the cornerstone of many of my projects. Therefore I am well versed in what it involves, benefits, challenges and so on.

I agree on what the authors are saying in this article mostly and I am kinda glad that I read it because I noticed some stuff that they say it is wrong and that I do a lot of the time when I am giving classes or I am working on a collective project.

Like for example the micro managing part.

In my entire carrier I never understood what that term meant and it describes almost perfectly what I have been doing most of the time in my projects. Most of the time I assume the role of navigator while pair programming either in a project or during a class, I would think it is because I consider myself a very good programmer, and because my mind most of the time already knows or imagines what must be done in order to solve the problem I always tell the driver exactly what to do. And sometimes the driver is just so, sooooo slow. And rather frequently I just tell them to change places with me and let my code.

Because of my impatience I can see now that I have been doing this stuff wrong. I mean sure, I have been a rather good navigator a lot of the time, but also I have been a prick most of the time. And I am sure that I have made some people very, very angry.

Thanks to this article I will improve my soft skills, because being a good programmer isn’t enough in the modern world to be successful. You must also be a good team player.

JVM Garbage Collectors


I really liked the phrase that the author put in his presentation. “Garbage Collector is really hard, and we get it for free”.

This phrase really gets to me because I'm a big pusher of Open-source. And he is right, this kinda stuff is hard and there are people pushing the limits of code in order to make our codes better. And I love that.

The author explained a lot of stuff of how a GC (Garbage Collector) works, and the benefits it brings having one always checking what you don’t need anymore inside your code.

What I found most important is the different techniques and philosophies that implementing a GC involves.

My opinion is that a GC needs to run in the background as a separate thread from the main app, and must not interrupt the functionality, because it would be very user experience-wise deficient and tedious. Therefore my believe is that a GC should be run on a different thread and use a technique with which it will compact as much as possible the info in the heap and at the same time will prevent memory leaks in a way that doesn’t interrupt the user experience.

Of course this is no easy task and maybe in some way ,because I (of course) am no expert in the subject, might be impossible to achieve. But that is the wonder of Open-source. In the section above it was described that the newest GC that the JVM uses at the moment is the Shenandoah, which was invented by de Red Hat Linux organization as a open-source gift to the world.

The fact that the most brilliant minds in the world are all working together in order to further improve the algorithms and processes that everybody else write is wonderful and necessary. This is the philosophy of Open-source and free software, and I love it.

lunes, 13 de abril de 2020

Roots of Lisp


What a find remarkable of the paper that I just read, is the idea of creating such a powerful language, with its own language. To me that is such an elegant solution.

I didn’t get to use Lisp in a professional environment due to it being such an old language. However I do take some lessons from the way it was programmed. The fact that a language can be written using itself to compile itself is remarkable and really shows a great abstraction from the part of the author in a way that for 1960 was never seen before.

Here is why, this resembles a lot the idea of recursion, which for Lisp and languages like Clojure, which I will be touching on in minute, are the main way of “iterating” through some stuff in order to get to a result that cannot be immediately obtained from a math formula. And is truly amazing that this idea was implemented not only as one of the necessities of any programming language, but as a way to compile the language itself.

But there is something that I cannot overlook, now that I know Clojure and Lisp I understand the difference between the two and where Clojure got the inspiration from. And from the file itself I get the idea that lisp isn’t simply a programming language, but a family of languages called lisps. And the doubt that pops into my head is; What is the difference between the lisps?

Of course if I take the time to do some research I could get the answer but for me it would be pretty obvious that if someone like Richard Hickey (Clojure Creator) developed Clojure as a modern and more powerful lisp I don’t see the necessity for any of the other lisps that were referenced.

domingo, 5 de abril de 2020

Rich Hickey on Clojure


It is interesting to hear the creator of a language talking about how the language came to be.

As he describes it, he created Clojure as a way to update, and optimize a Lisp in order not to become mainstream, like Python, Java, C, etc, but to be a powerful tool so scientists can perform important work in an elegant and simple way.

For instance he describes the way the information is being manipulated in a very optimized and simple way. Basically by sacrificing memory space he optimized de speed upon which the operations are executed in a way that makes the information persistent, immutable, and fast.
Although not very optimal for space, this increases speed by a lot. Also the innate implementation of data structures such as atom and Java libraries for big numbers. Makes the mathematical implementation of complex and big operations super easy for scientists and specialists to develop important work.

I agree with Dick, Clojure is a powerful language, and in some ways with the analogy that he gives, about if you had to explain someone a code in Java, it would be really difficult and we just have accepted that reality, and because of this most of us, me included, dismissed it almost immediately because it looked weird and in my indoctrinated eyes it did not look like a normal language.
Most of the times I still think looks weird and get frustrated about the syntax. However, I must admit is a very powerful language with a unique implementation. And it has given me a new interest in how to program efficiently and abstractly. High order functions have been always been present in my repertoire ever since I started programming in C. And multithreading is something I consider personally very important for a program to be perfect. And this language already has native implementation, more than surprised I am impressed.

sábado, 28 de marzo de 2020

Dick Gabriel on Lisp


It is certainly fascinating how a language like Lisp can do so much stuff I didn’t even know about.

I personally have never used Lisp and probably never will due to being such an old language. Although I am learning to use a language called Clojure which is a descendant of Lisp. And hearing what Dick Gabriel said of what Lisp has to offer I wonder if more modern languages, Lisp descendant or not, have taken some of the features of Lisp.

The part that called my attention the most was the fact that Lisp used to be used for AI research.
Today AI has mostly turned in the direction of Machine Learning and data analysis, which is certainly not a bad thing of course, however it was fascinating to learn that Lisp had a way of compiling code of itself and that it in theory was possible to create a Machine that could write code of itself, compile it, and test it to solve complex problems. Even in the 1980’s this idea was considered to be possible.

Personally I don’t particularly like functional programming languages because they require a little more effort to produce good code, functional and efficient code, than in other programming languages like imperative languages. However the fact that I don’t like it or that it gets a little bit complicated for all the parenthesis it involves, doesn’t mean I don’t see the power a functional language provides.

In the podcast I don’t remember hearing if the new languages they mention like Java or Ruby have these interesting features Lisp had and I really hope they do. Because I am really interested in studying AI, and not only machine learning. I mention this because it would be so sad this features disappeared of modern languages because they were dimmed unnecessary or unpractical. I mean Lisp is complicated but efficient and powerful. And just because something is complicated or a little bit hard to use, doesn’t mean we should abandon it. We should learn how it works, take it and implement it in some other way it is way easier for everybody to use.

sábado, 7 de marzo de 2020

Women & Programming

It is really sad to read about all the great things that humans can do collectively, and take the credit for themselves for something as stupid as gender or sex.

Specially when you hear about what happened in the computer science field. I personally didn’t know that women were so involved in the field that in fact a very big chunk of the programmers of the time were female. And that progressively due to discrimination or some stupid thing like that, women were becoming less interested in pursuing a career as programmers.

Speaking from experience I know my fair share of women who are really smart, some even smarter than myself. And it is sad and frustrating to think that women like that will never even consider a career as programmers because of the discrimination.

This also applies for all fields of engineering as gender roles tend to influence the girls to do girly things as playing with dolls and so on. Which in some sense is not wrong, but, I believe that if any body show a desire to study maths or computers, regardless of their gender, we should encourage them to do so because it is way better to have engineers than a lack of them. Besides women aren’t stupid by any means. Due to their meticulous nature and special ability to pay attention to details is that they would be better at debugging and looking for mistakes in code or math formulas or procedures or something like that.

In fact at the beginning of the article it comes an interesting fact that the idea of break-point for debugging code, was actually the idea of a woman.

In conclusion, as a culture we should encourage all people to enrol in math and computer related subjects, regardless of gender. Not let history define the future of science because if women in the past were way better than some men at the time. Why now that shouldn’t be true?

sábado, 29 de febrero de 2020

The promises of Functional Programming


The promises of Functional Programming

I’m a computer science enthusiastic and I love the idea that a programming language can be specifically designed to fit all the needs for computer science to advance faster.

However I am still very sceptic about functional programming.

While it certainly makes some good points about the use of recursion and the extra feature of not needing the locks for parallelism and so on, I don’t think is such a great feature. Rather I would consider it a miss from part of the creators or some trick to avoid data corruption. I mean it certainly works and in practice makes it much easier to avoid data corruption.

But I would argue the next analogy to explain my point of view on the matter.

Imagine a highway, on which there will be thousands of high speed vehicles travelling at all times.
I would argue that the feature functional programming provides of not needing to worry about data corruption, because you cannot write data would be like building this hypothetical highway with multiple levels each specially designed for each vehicle.

Each thread running on their own highway uninterrupted and undisturbed because there is no way of interacting with one another.

I see this as cheating cause the whole point of having parallel programming is to execute a little part of a big task while other thread executes other little part of the task.

I believe the perfect parallel program should be able to time perfectly how much to “slow down” a thread without necessarily freezing it completely in order for it to miss another threads writing or reading or processing of data.

Instead of making a safer highway, the drivers should become better so the highway remains the same but the drivers are so smart, advanced and well trained that the same level of efficiency can be achieved while having the feature of sharing information.