Live data from Hacker News

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

news.ycombinator.com

331–340 of 401 posts

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

#331

Earlier quoted context omitted.

The same way everyone else does: fixing other people's broken code. It actually hasn't changed much since 2.2.

It's changed fundamentally since 2.2... Also if you're fixing broken Python code, you're using Python, so no that doesn't really track.

You know, sometimes people have to fix trashfires; that doesn't mean they'd start one.

What fundamental changes do you see since 2.2? If you're talking about the object model; objects in python were garbage before and after 2.2, and as a paradigm, it's mostly useless bureaucracy. Bleeding edge 90s ideas.

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

#332
post #214
post #71

Earlier quoted context omitted.

My first job I wrote c++ for a win32 desktop app. I hated unit testing. My workflow was write the code, compile it, trigger the scenario, step through the code, write some unit tests after I knew it worked. It was the expectation on my team to write UTs so I did it. Fast forward to a different team I learned from a co-worker how UTs can help you influence your design. If you find yourself doing a ton of frustrating w…

My trick question to TDD advocates is how to develop native apps following those principles, after all no GUI change is allowed without a test.

GUIs don't lend themselves to unit testing at all, because the requirements aren't mathematical, but are instead based on human factors.

For GUIs, the proper approach is to unit-test the functionality underneath, not the GUI itself.

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

#333
post #332
post #214

Earlier quoted context omitted.

My trick question to TDD advocates is how to develop native apps following those principles, after all no GUI change is allowed without a test.

GUIs don't lend themselves to unit testing at all, because the requirements aren't mathematical, but are instead based on human factors. For GUIs, the proper approach is to unit-test the functionality underneath, not the GUI itself.

Which leads to convoluted architectures just to be able to follow "only write code which there is a failing test for".

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

#334
post #255

Earlier quoted context omitted.

>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 sor…

> No that's not what the other languages are doing. Is this a claim that people do not indent in other languages and leave it to the dev environment? Yes, those languages don't rely on indentation but people do still manually indent or rely on their environment to indent it for them to make the code remotely readable. I for one cannot read Java without it also being indented correctly. > This frees the developer from…

>people do still manually indent or rely on their environment to indent it for them

Nobody manually indents their code. Almost any language other than Python is unambiguous to indent, so the computer does it for you.

>I for one cannot read Java without it also being indented correctly.

That's easy, just copy paste Java code into an editor and press a button to indent everything. Voila! Good luck if you're dealing with Python code which got misindented somehow (e.g. copying from some social network website which uses markup that doesn't preserve whitespace, which is most of them).

>What tools are you using that don't do indentation for you?

Python code cannot be re-indented unambiguously. So if you copy paste a chunk of Python code from one place to another, you can't just press a button to reindent everything. You have to painstakingly move it to the right level and hope that it still works. In Common Lisp I just press Ctrl-Alt-\ and everything becomes indented correctly.

>The most you have to do is hit backspace after finishing a block.

That works if you only write new code and never have to change existing code.

>There's a reason environments highlight do-end pairs together: because it's hard to know which ones match which.

No, the open/close brackets allow the IDE to highlight them so that the programmer can clearly see the scope of the code block. This is a useful feature of the language. In Python it's almost impossible to see which deindent matches what if the function is long enough/deep enough.

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

#335

Earlier quoted context omitted.

That's relying on distribution package management to save you. Here is what happens when you add libraries in any other context: The library has a dependency on another library, and when you go look at the dependency, it tells you that it needs to use a specific build system. So you have to build the library and its dependency, and then you might be able to link it. But then, turns out, the dependency also has depend…

I guess... though I’ve always found C++ libraries to be light years easier to manage than python. To be honest, the per-language package management seems wasteful and chaotic. I must have a dozen (mutually compatible) of numpy scattered around. And why is pip responsible for building FORTRAN anyway?

You think dealing with C++ libraries is easier than "pip install "?

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

#336

Immutability. I didn't really understand the benefits of having immutable data structures until I tried building a service with no mutations whatsoever... and noticed I didn't get any weird, head-scratching bugs that took hours to reproduce and debug. That led me to go down the Functional Programming rabbit hole - thus changing my entire view on what code is/could be. [edit: spelling]

How do you mitigate overhead from making copies all the time with immutability? By using moves and changing ownership a lot?

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

#337

Earlier quoted context omitted.

It's changed fundamentally since 2.2... Also if you're fixing broken Python code, you're using Python, so no that doesn't really track.

You know, sometimes people have to fix trashfires; that doesn't mean they'd start one. What fundamental changes do you see since 2.2? If you're talking about the object model; objects in python were garbage before and after 2.2, and as a paradigm, it's mostly useless bureaucracy. Bleeding edge 90s ideas.

The addition of type annotations alone makes it a hugely different language.

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

#338
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…

> Then I found out that -white space is important-.

The only time this should ever be an issue is when you're copy/pasting code from a web page or other source that doesn't preserve white space when you copy.

Otherwise, I'll never understand why this is so hard for people. No matter what language you're using, you should be properly indenting code blocks 100% of the time, and if you're doing that, Python's white-space-as-syntax will never be a problem.

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

#339
post #337

Earlier quoted context omitted.

You know, sometimes people have to fix trashfires; that doesn't mean they'd start one. What fundamental changes do you see since 2.2? If you're talking about the object model; objects in python were garbage before and after 2.2, and as a paradigm, it's mostly useless bureaucracy. Bleeding edge 90s ideas.

The addition of type annotations alone makes it a hugely different language.

The annotations that nobody actually uses? Call me back in 2030, when they become halfway popular.

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

#340
post #3

Almost every time I experienced a shift like this in my thinking it was due to experiencing a problem I hadn't experienced until that point. I discovered the value of compile time type checks when I worked on large codebases in dynamic languages where every change was stressful. In comparison having the compiler tell you that you missed a spot was life changing. I discovered the value of immutable objects when I work…

>I discovered the value of compile time type checks when I worked on large codebases in dynamic languages where every change was stressful. In comparison having the compiler tell you that you missed a spot was life changing.

Sounds like me in reverse: I discovered that value when I had to do work in a dynamic language after working only in C and C++. It's like that old saying but not knowing the value of something you have until you lose it.

Post reply on HN