Live data from Hacker News

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

news.ycombinator.com

251–260 of 401 posts

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

#251
post #81

Using it as my main language: Python (2.7). How the hell did this thing become so popular? I've used it for all sorts of stuff earlier, less complex than the other. Scripts, devops, ETL... But then I got into a company that is using it for some quite serious stuff, a large codebase. Holly smokes this thing does not scale (in terms of development efficiency and quality) well. I swear at least 70% of our bugs is becaus…

When I looked at Python, it looked interesting. Then I found out that -white space is important-. I thought about what it might be like to worry about that, and decided -not for me-. When CPUs ran at 1 MHz, I wasn't so sure about FORTH with its RPN. But it ran a lot faster than interpreted BASIC, and was a lot faster to write than assembler. Once the world discovers the source of all its woes and goes back to wide-op…

> When I looked at Python, it looked interesting. Then I found out that -white space is important-. I thought about what it might be like to worry about that, and decided -not for me-.

I did the same thing. In fact, this is why I came to comment on this thread: my initial reaction was to turn my nose up at the significant indentation. Then I gave it a try, and I got over it in about five minutes. It just wasn't the big deal I thought it was. I've heard a lot of other people say the same thing.

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

#252

DDD - Domain driven design. My entire career pivoted the day I worked with a team that was building a large financial system (ie: multiple teams around the world, hugely complex set of business domains, zero margin for error). The entire approach to code, thinking, and organisation meant that a code base that could easily be a mess at 1/10th the scale, was maintainable and actually increased velocity of the teams ove…

What language/framework did your team use for that project?

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

#253

Earlier quoted context omitted.

> Then I found out that -white space is important-. I hear this a lot and I think it's a misunderstood statement. Python does not care if you do not have a space in assignments or arithmetic or between commas or parentheses. What Python does care about is the indentation of the source code. The indentation is what guides the structure - which is already what we are doing with most languages that don't care about inde…

>but white space just is not one of them. This position is hard to maintain after you've spent an hour trying to debug a nonsensical error just to realize you opened the python file in an editor that used a different tab/space setting than the file was created in. Significant whitespace is one of the biggest misfeatures in programming history.

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:

https://repl.it/repls/NegativeExemplaryBackups

You'll see that it raises an error:

    TabError: inconsistent use of tabs and spaces in indentation
…and points you to the exact line with a problem.

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

#254

Microservices. They seemed really cool until I worked on a few large projects using them. Disaster so epic I watched most of engineering Management walk the plank. TLDR: The tooling available is not good enough. The biggest cause lies in inter-service communication. You push transaction boundaries outside the database between services. At the same time, you lose whatever promise your language offers that compilation…

I think that the issue is that microservices _require_ good practices and discipline.

These are attributes that 80% of projects and teams lack so when they decide to jump onto the microservices bandwagon the shit hits the fan pretty quickly.

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

#255

Earlier quoted context omitted.

When I looked at Python, it looked interesting. Then I found out that -white space is important-. I thought about what it might be like to worry about that, and decided -not for me-. When CPUs ran at 1 MHz, I wasn't so sure about FORTH with its RPN. But it ran a lot faster than interpreted BASIC, and was a lot faster to write than assembler. Once the world discovers the source of all its woes and goes back to wide-op…

> Then I found out that -white space is important-. I hear this a lot and I think it's a misunderstood statement. Python does not care if you do not have a space in assignments or arithmetic or between commas or parentheses. What Python does care about is the indentation of the source code. The indentation is what guides the structure - which is already what we are doing with most languages that don't care about inde…

>which is already what we are doing with most languages that don't care about indentation!

No that's not what the other languages are doing. They have explicit structure defined in the code (with Lisps being at the extreme end), which allows the development environment to automatically present the code in a way that's easy to read. This frees the developer from the job of manually formatting their code like some sort of caveman.

As someone with 8+ years of experience of programming in Python for a job, I've seen countless of bugs spawned by incorrectly indented code, which is incredibly difficult to spot. I've seen people far more experienced than me make these bugs because they didn't notice something being misindented. To me, the fact that we have to deal with this is laughable. Especially considering it's so easy to fix Python the language so that indentation becomes unambiguous: add an "end" statement for each deindent (aka closing brace).

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

#256
post #88
post #81

Using it as my main language: Python (2.7). How the hell did this thing become so popular? I've used it for all sorts of stuff earlier, less complex than the other. Scripts, devops, ETL... But then I got into a company that is using it for some quite serious stuff, a large codebase. Holly smokes this thing does not scale (in terms of development efficiency and quality) well. I swear at least 70% of our bugs is becaus…

I started using python 3 with mypy, which provides (optional) static typing, and my gosh has it reduced the time I spend looking for stupid problems by orders of magnitude. I got a somewhat direct comparison when I mypy-ified a small program where I used a lot of async and await (basically implementing own event loops and schedulers, it was interfacing very custom hardware that handled very different but interacting…

I suppose you are right. But with a huge code base, migration is not an overnight process...

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

#258

Earlier quoted context omitted.

Tell us what was your starting point and references used to learn FP

First -- over a few years -- I had slowly started writing functional-ish code in Ruby on the backend and React/Redux on the front-end. Ruby is kind of nice in that there's not an easy way to iterate over a list without functional code. You start mapping and reducing pretty regularly, and then discover the power of higher-order array functions, and how it lends itself nicely to functional programming. React/Redux is n…

A "me too" for Elixir. Coming from a Ruby background, picking up Elixir wasn't hard at all (disclaimer: I have done some FP in the past). What I found really good about Elixir is the solid documentation[1], easy comparing of libraties[2], the mix[3] tool that made starting a project really simple.

But what really blew me away were doctests[4]. Basically I ended up writing my unit tests where my code was. That was my documentation for the code, so there was no need to maintain unit tests and documentation separatetly.

[1]: https://elixir-lang.org & https://hexdocs.pm/elixir/Kernel.html [2]: https://elixir.libhunt.com [3]: https://elixir-lang.org/getting-started/mix-otp/introduction... [4]: https://elixir-lang.org/getting-started/mix-otp/docs-tests-a...

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

#259
I was a fan of object oriented programming (and over-engineering for the sake of it) until I came to know the McIlroy pipe for computing a histogram. It was so terse and beautiful that it flipped my world upside down. Since then, I have been hooked onto the unix philosophy.

See here an enlightening read about this programming style: https://www.oilshell.org/blog/2017/01/15.html

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

#260

Earlier quoted context omitted.

Doesn’t that mean you have to use the same language, libraries, and DB for every service?

Is that really so bad? At edX all of our services were Django. After the third service was created we built templates in Ansible and cookiecutter to create future services and standardize existing ones. We created Python libraries with common functionality (e.g. auth). We were a Django shop. Switching to SOA didn’t mean switching languages and frameworks.

If your services were all setup the same, what was the big advantage to have them separate? Wouldn't you get the same scalability from running 10x of the monolith in parallel with a lot less work?
Post reply on HN