News for hackers. Stuff that matters.
Re:Ask HN: What programming concepts do/did you find hard to... by vanilla-almond on Wednesday April 21, 2021 @05:35PM (#26895739)
I'm a mediocre programmer at best and I still struggle with Object-Oriented Programming (OOP). I understand the ideas, but I simply find it to be an 'unnatural' way of programming. Millions of other programmers are successfully coding with OOP, but I'm not one of them.

I've tried many OOP languages and Ruby and Crystal felt that they had the friendliest approach. Why do I struggle? I think some of it is to do with the thick layers and unnatural wordiness of the way it is implemented in many languages: constructors, instantiating, getters, setters, public, private, unattractive syntax etc.

As I said earlier, I am not a great programmer (but try to improve :-) and my opinions on OOP reflect that.

As an aside, the stranglehold that OOP has had over the profession seems to have loosened. New languages like Julia, Go, Rust and Nim do not describe themselves as object-oriented although they have object-like features. Back in 2019 I asked Hacker News: "Why do new(ish) programming languages eschew OOP features?"

https://news.ycombinator.com/item?id=20320752

Re:Ask HN: What programming concepts do/did you find hard to... by eigenspace on Wednesday April 21, 2021 @06:15PM (#26896115)
My feeling is that 'Object Oriented' has basically become a dirty word among forward looking programmers. I don't really think this is because of a problem with the idea of object oriented programming, so much as a GIGANTIC problem with the most prominent languages which describe themselves as object oriented.

IMO, object orientation does not need to involve things like single-dispatch classes, concrete inheritance, and other bad ideas promulgated by the prominent OO languages which newer languages are trying to distance themselves from.

Re:Ask HN: What programming concepts do/did you find hard to... by tacostakohashi on Wednesday April 21, 2021 @02:29PM (#26893607)
I found regexes pretty baffling (i.e., took me a long time to understand at all) when I first encountered them. And, even now, complicated regular expressions can be difficult to work on.

The main challenge is that you can't see which part of some huge pattern isn't matching, or insert a breakpoint / printf in the middle, it's just an opaque black box that either works or doesn't... and if it doesn't you need to break it all the way down to something that does, then work back up again from there.

Re:Ask HN: What programming concepts do/did you find hard to... by simonblack on Wednesday April 21, 2021 @08:29PM (#26897182)
Recursion.

I can write a factorial-computing program, but I'm slow at it.

I think my biggest problem is working out those instances when I should use a recursive function.

Re:Ask HN: What programming concepts do/did you find hard to... by thedevindevops on Wednesday April 21, 2021 @04:31PM (#26895054)
I worked on a piece of software that made use of Simulated Annealing and I'm still not entirely sure I understand how it worked.
Re:Ask HN: What programming concepts do/did you find hard to... by giantg2 on Wednesday April 21, 2021 @04:01PM (#26894676)
Regexes, some 3rd party java annotations, quantum concepts, even some patterns of OOP that involve a lot of abstraction.
Re:Ask HN: What programming concepts do/did you find hard to... by girishso on Wednesday April 21, 2021 @02:11PM (#26893358)
I found it very hard to understand functional programming after more than a decade of OO. Was lucky to find Elm.
Re:Ask HN: What programming concepts do/did you find hard to... by Dracophoenix on Wednesday April 21, 2021 @03:05PM (#26894061)
What's difficult about it to you exactly?
Re:Ask HN: What programming concepts do/did you find hard to... by girishso on Wednesday April 21, 2021 @11:31PM (#26898415)
FP is a completely different paradigm for computing, my OO brain took some time to get a hang of it. In particular, I found it very hard to figure out how to model the system, just by using functions.

It was very hard until I figured it out.

Re:Ask HN: What programming concepts do/did you find hard to... by pknerd on Wednesday April 21, 2021 @08:52PM (#26897341)
Recursion Abstract Classes Pointers, thanks to Golang I don't feel so insecure anymore.
Re:Ask HN: What programming concepts do/did you find hard to... by LandR on Friday April 23, 2021 @10:00AM (#26914862)
Continuations and call/cc
Re:Ask HN: What programming concepts do/did you find hard to... by AgoRapide on Wednesday April 21, 2021 @05:48PM (#26895879)
Regular expressions.

Functional programming.