vhb | 6 years ago | on: Why OO Sucks by Joe Armstrong (2000)
vhb's comments
vhb | 6 years ago | on: Why OO Sucks by Joe Armstrong (2000)
Appreciate it :)
> There is a key distinction: If I have two subsystems that use the same data in different ways, I can keep those concerns separate by putting the functions for each concern into a different module. Binding all the functions to the type mixes the concerns together and creates objects with way too much surface area.
This is where composition helps. Now, historically, indeed OOP programmers have not been the best at using composition. Now, looking at more recent projects, this has got a lot better.
> Also, most OO langs make a big ceremony out of each new type: create the class file, create the test file, blah blah blah. I want types to be cheap so I can make them easily and capture more meaning with less work.
Totally agree with that, the ability to define a type in one line and have it reflected though the entire code base through type inference is the one thing that I miss the most in C/C++.
vhb | 6 years ago | on: Why OO Sucks by Joe Armstrong (2000)
> Objection 1. Data structure and functions should not be bound together
Well, in my experience, in every almost every code-base (either from functional, or imperative programing), we end up with modules, witch are a set of function taking the same type as a parameter. This is very close to binding the functions and the types...
> Objection 2. Everything has to be an object.
I don't get the example. The only thing that this show, is the benefits of having a range type built in the language. Then it's just type aliases.
"There are no associated methods.", yes, but you will need functions to manipulate those types (just translate one type into another), at the end, it's going to a module, which is almost an object.
> Objection 3. In an OOPL data type definitions are spread out all over the place.
That's true. It also makes thinking about the data layout complex. That's why other paradigm have been developed (DOP), on top of OOP. Now you can also think that having those defined together makes dependency management easier.
> Objection 4. Objects have private state.
False. Objects can have a private state. This a problem with mutability, not oriented object programing. You can have non mutable OOP.
> Why was OO popular?
>> Reason 1. It was thought to be easy to learn.
The past 20 years have shown how easy it is. In fact, I actually think it's too easy, people rely too much on abstraction, without even trying to understand what's going on. I my opinion, it promotes a lazy mindset (This is my biggest criticism about OOP).
>> Reason 2. It was thought to make code reuse easier.
I would like an evidence that it's not.
>> Reason 3. It was hyped.
True, but that does not make it bad. People tried to hype every technologies... Some stayed, some went away.
>> Reason 4. It created a new software industry.
How has OOP created a software industry that would not have existed if functional programing had "won the fight"?
vhb | 7 years ago | on: The drug debate in Japan (2018)
2) According to the WHO, Korea only drinks marginally more that the US, and Japan less: https://www.who.int/gho/alcohol/en/. TBH, this is a bit of a stereotype.
I'm confused by how to interpret 3. Are you saying:
- "If it's only for medical use, then it will not worsen the situation". I would overall agree with you on this.
- "Even if it's freely available it will not worsen the situation". I don't believe this. I don't see how going from a situation where smoking is 1: illegal, 2: actually complex (unlike in Europe/North America), 3: extremely risky on the legal side, 4: socially taboo, to a situation where you can have shops on the street would not worsen drug issues. I can't find any studies has been conducted in any comparable societies, so we are both speculating, but I just find your point absolutely unbelievable.
vhb | 7 years ago | on: The drug debate in Japan (2018)
In the US/Europe, I totally agree with you. The benefits of making it legal far exceed the cost and the associated risks, so if I was asked to vote, I would vote for legalizing cannabis. But this is not a vote to cannabis, it's a vote against the criminal networks that are profiting from cannabis.
Now, what you are saying, is that a country that does not have a cannabis problem should still legalize it. Call me old fashioned, but I do not think that a society that smokes weed is better than a society that does not. Saying "yes, but alcohol/tobacco is worst" does not make is good.
Your point basically is: "these countries should allow weed because in the West, we do have an issue with the criminality associated with it". I believe on the contrary that Japan, Korea (and a few others, such as Singapore) should be very proud of not having a drug problem, keep one working towards not creating one, while at the same time focusing on solving their tobacco / alcohol one.
vhb | 7 years ago | on: Why Asians wear surgical masks in public (2014)
The societal pressure on appearance is so high, that just going to the grocery shopping without makeup is seen a socially unacceptable. The simplest way around it is to hide your face, and the best way to do so is to wear a surgical mask.
On a side note, in Korea, this is not reserved to women, lot of men wear makeup as well.
vhb | 7 years ago | on: Alternative code styles
I've been told that the guy who wrote this believe that the brain only has a limited buffer to compute source code. So he is trying to use the shortest code possible everywhere.
vhb | 7 years ago | on: Alternative code styles
vhb | 7 years ago | on: Saudi Aramco’s $2T Zombie IPO
Right now, his main focus is to make sure the Iran does not develop it's O&G infrastructure, that could challenge KSA's position. One part the the article does not explore, is "what did the US gave in exchange of the OPEP increasing their production?". Could it have something to do with the WH ending the Iran deal?
One part that is extremely true is that investing in the GCC is extremely risky, due to the way regulation can change within weeks. Most people that I know over there thinks that without a good, personal relationship to the royal family (or equivalent), having high stake investments is probably a mistake.
Also, i'm highly skeptical with the 20% marginal rate this article talks about. I remember reading that the cost of production of a barrel in KSA what about 3$.
vhb | 8 years ago | on: Ask HN: What's a good response to “It's fine, I've got nothing to hide online”?
vhb | 10 years ago | on: Ask HN: I'm starting a new job as a PHP developer tomorrow
Now, with the hindsight, it was a big mistake : it did make me loose so much time ! I did had to fix one script out of 2, the build system was not working properly, etc... And linux and Os X are not that different !
Don't do that... Use the tools that you company gives you, and try to fit in the company. Otherwise, you will be seen as the guy who does not want to do stuff the same way as the others. Even if everything goes well with your coworkers, you will end up waisting time every day.
You can install vim on windows (and sublime text does have quite a few almost decent vim plugins). You will miss i3wm a lot, but you don't need it to do good work.
Learn how to use the most efficiently the tools your company gives you (Windows and PHP). If you want to change something (at least for your first couple of month), try to change something that will make everyone life easier, not more complicated.
Encapsulation is "if you have a state, you should encapsulate it". It does not ask you to have a state (even less a mutable one). I quite often use object to represent a logical piece of code, without any attributes.
> I'm not sure functional programming has lost yet. I haven't worked with it personally, and so can't speak to its merits or demerits, but have heard a lot of buzz around it recently.
As much as i really enjoy FP, I don't think it has more than 1% of the market share of software engineering. And I've been hearing the "heard a lot of buzz around it recently" for more than 10 years.