Live data from Hacker News

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

news.ycombinator.com

391–400 of 401 posts

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

#391

Earlier quoted context omitted.

I've been writing Python for over 20 years, and I don't think this has happened to me one single time. I'm not some kind of super programmer; I make as many mistakes as anybody else and spend too long debugging stupid mistakes occasionally. I've mixed spaces and tabs before on a handful of occasions, and it's always told me straight away what the problem is. Here is an example of mixed spaces and tabs for indentation…

Here's an example of an incomprehensible error related to mixing whitespace, where its not obvious its a mixed whitespace issue: https://repl.it/repls/MotionlessLustrousScan

Are we seeing the same thing?

    IndentationError: unindent does not match any outer indentation level
The very first thing I would look at is the indentation if I got an error like that. You hardly need to "spend an hour trying to debug a nonsensical error" when you see an error like that.

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

#392

Earlier quoted context omitted.

Here's an example of an incomprehensible error related to mixing whitespace, where its not obvious its a mixed whitespace issue: https://repl.it/repls/MotionlessLustrousScan

Are we seeing the same thing? IndentationError: unindent does not match any outer indentation level The very first thing I would look at is the indentation if I got an error like that. You hardly need to "spend an hour trying to debug a nonsensical error" when you see an error like that.

Does "indentation error" immediately scream check for a whitespace mismatch to you? Because it doesn't to me.

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

#393

Earlier quoted context omitted.

Are we seeing the same thing? IndentationError: unindent does not match any outer indentation level The very first thing I would look at is the indentation if I got an error like that. You hardly need to "spend an hour trying to debug a nonsensical error" when you see an error like that.

Does "indentation error" immediately scream check for a whitespace mismatch to you? Because it doesn't to me.

"Indentation error" screams "fix the indentation", and code is indented with whitespace, so yeah.

When something tells you "indentation error", where's the first place you would look, if not the indentation? When you know you have a problem with the indentation, what do you think you have to change, if not the whitespace? There isn't a lot of opportunity to go in the wrong direction here.

Don't get me wrong, Python definitely has unexpected, difficult to debug behaviour for newbies (e.g. mutable default arguments). But this in particular isn't one of them. This is 2+2=4 level stuff.

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

#394

Earlier quoted context omitted.

Does "indentation error" immediately scream check for a whitespace mismatch to you? Because it doesn't to me.

"Indentation error" screams "fix the indentation", and code is indented with whitespace, so yeah. When something tells you "indentation error", where's the first place you would look, if not the indentation? When you know you have a problem with the indentation, what do you think you have to change, if not the whitespace? There isn't a lot of opportunity to go in the wrong direction here. Don't get me wrong, Python d…

This is a strange response. The only thing I can say is that "indentation issues" does not imply "mixed whitespace issues". Your responses are implicitly conflating the two.

>what do you think you have to change, if not the whitespace?

Note that the same error shows up when you have an inconsistent number of spaces to indent a block.

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

#395

Earlier quoted context omitted.

"Indentation error" screams "fix the indentation", and code is indented with whitespace, so yeah. When something tells you "indentation error", where's the first place you would look, if not the indentation? When you know you have a problem with the indentation, what do you think you have to change, if not the whitespace? There isn't a lot of opportunity to go in the wrong direction here. Don't get me wrong, Python d…

This is a strange response. The only thing I can say is that "indentation issues" does not imply "mixed whitespace issues". Your responses are implicitly conflating the two. >what do you think you have to change, if not the whitespace? Note that the same error shows up when you have an inconsistent number of spaces to indent a block.

> > What do you think you have to change, if not the whitespace?

> Note that the same error shows up when you have an inconsistent number of spaces to indent a block.

And what would the solution to that be, if not changing the whitespace?

Every single piece of information available is strongly pointing in the same direction here.

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

#396

Earlier quoted context omitted.

This is a strange response. The only thing I can say is that "indentation issues" does not imply "mixed whitespace issues". Your responses are implicitly conflating the two. >what do you think you have to change, if not the whitespace? Note that the same error shows up when you have an inconsistent number of spaces to indent a block.

> > What do you think you have to change, if not the whitespace? > Note that the same error shows up when you have an inconsistent number of spaces to indent a block. And what would the solution to that be, if not changing the whitespace? Every single piece of information available is strongly pointing in the same direction here.

I swear its like we're speaking two different languages. I really don't see the utility in further effort trying to find common ground.

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

#397
Many things have changed my mind. Most recently it's been the move towards thinking in terms of data processing. Solving problems by transforming data structures.

The gateway drug was transforming json with lodash/underscore/ramda. Clojure cinched it.

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

#398

Earlier quoted context omitted.

We actually tried this as well. It never made it out of testing. We ended up with copies of data in many places, which was annoying. We duplicated a lot of work for consuming the same events across multiple services and making sure they updated the "projection" the same way. However a much larger problem was overall bad tooling. Specifically the data storage requirements for an event stream eclipsed our wildest proje…

I appreciate you sharing this. I'm considering embarking on this approach with my team, and everything you are mentioning is what I was worried about when I first started reading up on the microservices architecture. Now I'm seriously considering a somewhat hybrid approach: Collect all of my domain data in one giant normalized operational data store (using a fairly traditional ETL approach for this piece), and then h…

There's two main approaches to handling "events". Using event sourcing vs direct RPC. After our disaster I highly recommend Google's approach, A structured gRPC layer between services with blocking calls. You might think you don't have much data, we didn't either, but when Kafka is firehosing updates to LoginStatus 24/7 data cost gets out of control fast.

I'm going against the Martin Fowler grain hard here, but Event Sourcing in practice is largely a failure. It's bad tooling mostly as I mentioned, but please stay away. It's so bad.

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

#399

Earlier quoted context omitted.

I'll would like to watch you running around and trying out everything when integration tests fails and you don't know which part of the code base caused the failure, while I just run all the specs and figure out the exact unit of code that is causing the problem.

That would not happen because each of my integration test cases are properly isolated form each other. If any specific test case starts failing, I just disable all other test cases and start debugging the affected code path; it usually only takes me a few minutes to identify even the most complex problems. Also, because I use a TDD approach, I usually have a pretty good idea about what changes I might have made to th…

Apologies sir...! When I said unit tests, I mean a specific unit of code (in TDD manner).

I mistunderstood your Integration tests. I understand them as something like checking from the end user contract. If so, without TDD, it won't be possible to track down the bug easily as with TDD.

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

#400

Earlier quoted context omitted.

If you’ll open https://reactjs.org/ you’ll read right on their main page: > Build encapsulated components that manage their own state, then compose them to make complex UIs. Components managing their own state is a textbook definition of OOP. They even use inheritance in their example on the main page: > class HelloMessage extends React.Component

React isn't really object-oriented. Components rarely pass messages to each other. Instead, the way that data flows is through function/constructor arguments. You can directly invoke a method on a component, but that's only really used as an escape hatch. It's inconvenient, and IMO, a code smell. For the React that I write, class components are used only when there's some trivial local state that I don't want to put…

Calling a function of another component is a way of passing a message to another object, no matter what that message is, be it the data flows you mentioned, or anything else.
Post reply on HN