Live data from Hacker News

Ask HN: What made you change your mind about a programming language/paradigm?

news.ycombinator.com

41–50 of 401 posts

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#41
My opinion about Perl went from "It's hideous" to "It's okay". I tried to learn Perl by just reading code, like I'd learned several other languages (Fortran to Pascal to C). I finally read the Camel book. On page 83 it said "Everything in Perl happens in a context. Until you learn this you will be miserable." I was.

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#42
post #28

Earlier quoted context omitted.

What's the correct way to use typescript when you're directly working with the Dom, and using minimal jQuery? It seems to really not like it if you're explicitly asking for things you know you have in your document, but it reports an error.

> What's the correct way to use typescript... You write TypeScript the same way you write JavaScript. It just enforces a lot of the proper discipline and practices that JavaScript doesn't, and it doesn't let you incorrectly use APIs. > you're explicitly asking for things you know you have in your document, but it reports an error I'm not 100% sure what you're talking about, but I bet you'd get a great answer on Stack…

I'm using jquery for certain layout libraries that I need unless you have another library that provides it. Also I'm using datatables. I don't think there's an alternative to datatables that even comes close to being as well put together.

There's just a huge number of libraries around that depend on jquery, and are rock solid with continuing support. I would prefer to use something proven than something that will be gone in a couple of years or abandoned or the underlying library will end up not supporting a feature that widget requires.

I don't want to come across as unappreciative, but there's still reasons to use jquery.

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#43
Testing.

Unit testing to me seemed akin to drinking 8 glasses of water every day. A lot of people talk about how important it is for your health, but it really tends to get in the way, and it doesn't seem to really be necessary. Too frequently, code would change and mocks would need to change with it, removing a good chunk of the benefit of having the code under test.

Then I started writing integration testing while working on converting a bunch of code recently, and it has been eye-opening. Instead of testing individual models and functions, I was testing the API response and DB changes, and who really cares what the code in the middle does and how it interfaces with other internal code? So long as the API and DB are in the expected state, you can go muck about with the guts of your code all you want, while having the assurance that callers of your code are getting exactly out of it what you promise.

Unit test suites would break all the time for silly reasons, like someone optimizing a function would mean a spy wouldn't get called with the same intermediary data, and you'd have to stop and go fix the test code that was now broken, even though the actual code worked as intended.

Integration tests (mainly) only break when the code itself is broken and incorrect results are getting spit out. This has prevented all kinds of issues from actually reaching customers during the conversion process, and isn't nearly so brittle as our unit tests were.

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#44
Scala.

It really opened my mind up to what I was missing, as a recovering Perl programmer. Perl folk tend to think their shit doesn't stick. But it's the Blub Paradox in full effect.

Types matter. Functional programming matters.

Anyone advocating for dynamic typing in the year 2019 is captain of the USS Blub; and it's sinking.

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#45

Testing. Unit testing to me seemed akin to drinking 8 glasses of water every day. A lot of people talk about how important it is for your health, but it really tends to get in the way, and it doesn't seem to really be necessary. Too frequently, code would change and mocks would need to change with it, removing a good chunk of the benefit of having the code under test. Then I started writing integration testing while…

Just adding to this, for me I think the benefits of testing became really clear in situations where you end up fixing the same bug twice.

Knowing about that bug is really valuable knowledge and not adding a test for it is basically like throwing away that knowledge instead of sharing it for future people working on the project.

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#46
post #16

Every once in a while I search for something I need in Python and find that it only exists in Python 3, but I'm not quite convinced it's worth the effort to transition from 2. However... I've just learned about Python 3's f-strings and they gave me a big smile, and probably the final push I needed :) (Yes, I do know that sounds silly and there are probably much better reasons to transition to Python 3 ¯\_(ツ)_/¯ )

Thanks for pointing f-strings out. I'm transitioning a script with a lot of string manipulation from Python 2 to 3 and this is better than concatenation, % formatting, or str.format().

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#47
post #7

Rich Hickey's "Value of Values"[0] is what finally sold me on the benefits of pure functional programming and immutable data structures. (It remains horrifying to continue working with MySQL in my day job, knowing that every UPDATE is potentially a destructive action with no history and no undo.) [0]: https://www.youtube.com/watch?v=-6BsiVyC1kM

Well put - I came here to say the same :)

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#48
post #10

I used to hate C and thought it was primitive, ugly, dangerous, tedious to write in and annoying to read. While writing a big project in it ( https://github.com/RedisLabsModules/RediSearch/ ) , I've discovered the zen of C I guess. Instead of primitive I started seeing it as minimalist; I've found beauty in it; and of course the great power that comes with the great responsibility of managing your own memory. And wor…

90% of my dislike for C comes from a) that it is too tedious to work with strings and b) the non-existing standardized module/build system. The C language itself is _beautiful_ but I am missing a beautiful standard library! Things which are trivial one-liners in other languages are sometimes 10-20 lines of brittle boilerplate code in C. If the standard library would have a bit more batteries included it would make tr…

You might like zig, it's looking to compete in the C space, while fixing lot's of these kind of issues...

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#49
post #10

I used to hate C and thought it was primitive, ugly, dangerous, tedious to write in and annoying to read. While writing a big project in it ( https://github.com/RedisLabsModules/RediSearch/ ) , I've discovered the zen of C I guess. Instead of primitive I started seeing it as minimalist; I've found beauty in it; and of course the great power that comes with the great responsibility of managing your own memory. And wor…

I also used to hate C and thought it was primitive, ugly, dangerous, tedious to write in and annoying to read. Later, I too, discovered the actual point of C, the beauty and minimalism of it. Then I became a better coder, and once again saw the nature of C as primitive, ugly, dangerous, tedious to write in and annoying to read. I suppose that's what enlightenment feels like.

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#50

Testing. Unit testing to me seemed akin to drinking 8 glasses of water every day. A lot of people talk about how important it is for your health, but it really tends to get in the way, and it doesn't seem to really be necessary. Too frequently, code would change and mocks would need to change with it, removing a good chunk of the benefit of having the code under test. Then I started writing integration testing while…

You need to write a book and then get on the conference circuit with this message. You would be rowing against the tide but there is always hope!
Post reply on HN