Live data from Hacker News

How A Pull Request Rocked My World

clayallsopp.com

101–110 of 158 posts

Re: How A Pull Request Rocked My World

#101
Ruby is so unique. Back when I was also surprised by Ruby's reflection and metaprogramming features. So much easier than it was in the languages I had used before.

Nowadays I see people wanting to change Ruby to be more like those other languages. Needless to say, Ruby is best when all of Ruby is available. Putting restrictions on it wouldn't begin to turn it into what some people want.

On the server-side, people can use all kinds of languages, with no restrictions on choices. That's why these languages can flourish. On the client-side we are more restricted. The industry gets to dictate what goes on the client-side more.

Sigh.

I'm trying to use Dart lately which compiles to Javascript. While it can seem a bit like Ruby in OO and dynamic typing, it's a world of difference in other regards. Languages like Ruby that can evolve while breaking backward compatibility have more chance to be useful out of the box.

Re: How A Pull Request Rocked My World

#102

Earlier quoted context omitted.

I think this comment is a little unwarranted. Polymorphism wasn't the concept he discovered - the idea of generating the classes (metaprogramming) and the "clever" (well, some would say so at least) was interesting to him. I also don't like how your comment tries to make fun of his efforts to learn something new.

> I also don't like how your comment tries to make fun of his efforts to learn something new. The problem is not that he's learning, he's teaching.

[deleted]

Re: How A Pull Request Rocked My World

#103

The article is very humble, but in my view, seems to go a little too far. "You can reuse code with inheritance. Absolutely crazy. Brilliant. All of this blew me away." Honestly?

I didn't get that from the article. What I heard was the guy was amazed that someone took the time to attempt to better his code and (in his opinion) made it much better.

I agree with that a large extent - that's something that always amazes me about open-source. You're slogging along doing your thing, and then all of a sudden someone drops a huge patch on you that makes so much sense.

With that said; I did go back and re-read it, and your reading could be correct, it's hard to say. Does have a bit of humble brag to it for sure.

Re: How A Pull Request Rocked My World

#104
Can you imagine how much more pleasant participating in HN, GitHub, etc. would be if all programmers were this pleasant and open-minded?

Regardless of the particular merits of the technique he talks about here, I think we can all learn a lesson from this guy about appreciating the work and ideas of others.

Re: How A Pull Request Rocked My World

#105
post #70
post #64

Earlier quoted context omitted.

== Programming sucks nowadays. There is not even a consensus on what is good in programming! Take a look at other professional cultures: people work extremely hard to develop the skills that everybody else in their profession have. What does a software developer do? Whatever they like on their own, there is no professional culture whatsoever: "Don't give a crap about the humankind's experience, I'll invent everything…

The nature of programming is that any consensus solution can be automated. That's a good thing.

I'm always amazed though the extent to which that isn't followed through on. Consider the code for logging in and storing user credentials. The level of collaboration on this is at the level of a list of best practices. Why are we still letting anyone (re)write this code?

Re: How A Pull Request Rocked My World

#106
post #88

Earlier quoted context omitted.

A lot of programmers are insecure. They were the nerds in school, not popular, not good at sports, etc. Programming is the one thing they can do where they feel in control, and confident. So they naturally tend to be defensive about it.

> A lot of programmers are insecure. You mean a lot of persons? If you don't, I wonder where you got this from. Personal experience maybe? Anecdotic: I have always been good at sports, popular, and confident, and I criticized this article because he used a kind of link-bait title (should have been "Today I learned about inheritance and it's awesome", something like that), and he also turned out to be selling programm…

So he didn't know some aspect of polymorphism. Is that pertinent to his book? It's not as if using if/else constructs is bad or wrong. In some fields of development it would be preferred, for blatant clarity.

Does it follow that his book is bad or wrong because it was not written with understanding of this aspect of polymorphism?

Re: How A Pull Request Rocked My World

#107
post #56

Novice programmer: Uses simple if/else. Adept programmer: Discovers polymorphism. It's great, uses it for everything. Master programmer: Realizes that in many cases, it makes the code less clear and more verbose, reverts back to if/else until the flexibility is actually needed. Same story repeats itself many times on different fronts: metaprogramming, recursion, exceptions, macros, etc.

One more step: Master programmer realizes that they're still a Novice programmer - repeats the cycle.

Re: How A Pull Request Rocked My World

#108
post #64

Earlier quoted context omitted.

+1 for Good programming is not an objective concept.

== Programming sucks nowadays. There is not even a consensus on what is good in programming! Take a look at other professional cultures: people work extremely hard to develop the skills that everybody else in their profession have. What does a software developer do? Whatever they like on their own, there is no professional culture whatsoever: "Don't give a crap about the humankind's experience, I'll invent everything…

I would have thought www.swebok.org (Software Engineering Body of Knowledge) represents some consensus on what is good in programming?

Re: How A Pull Request Rocked My World

#109
post #15

On the first glance it seems great, but much more complex to understand and debug. The if tree was certainly not pretty, but straightforward - it did its thing. It was something that could be given to an average developer to work on and improve. The refactored code will require someone that's not just an average developer - if only because you need to read the article to understand it if you're not familiar with java…

This is not written in javascript, it is ruby. And I think your developer is way below average if he can't understand the pattern used in the refactored code.

If you have a ruby programmer who can't understand this, fire them. And get a new one. This type of stuff is all over ruby code.

Re: How A Pull Request Rocked My World

#110

Earlier quoted context omitted.

I don't believe that its terribly antiquated. Pretty much everything bases itself off of this book. Edit: drafted iPad - fixed spelling. Trilby - does anyone even use that word anymore?!?

It has a couple of patterns that have been more or less rejected by modern OO leaders: 1. "Singleton" (enough said) 2. "Template method" is more or less "inheritance over delegation" There's also a couple like Flyweight that are of such narrow applicability that they hardly merit placement on the short list with classics like Composites and Factories, and a few new items like Dependency Injection are surely worth a m…

What is your recommended introduction to design patterns? I've been meaning to read the original but I do get that old-school clunky Java feel from it. I'd be very interested in an updated Design Patterns for OO languages with mild functional capabilities like C++11, C#, Python.
Post reply on HN