Hacker News new | past | comments | ask | show | jobs | submit login

> Once real systems (like UI frameworks) are written with FP, we can compare apples to apples. Until then...wtf? OO actually works well for scaling complexity, much better than toy immutable functions do.

Seems like we are working on very different kinds of systems. Right now I'm working on Hadoop-based data pipeline. While Hadoop itself is mostly written in Java, many recent tools like Spark or Kafka are created in Scala instead. Yes, they still use some kind of OOP where necessary, but it works as a helper tool, not as principal paradigm. At the same time, ideas from FP are used extensively.

Do you consider Hadoop-based systems not "real"?

But ok, let's take something different. Python for example. Python with its main web framework - Django - is really shiny. I would say, it is one of the best web frameworks ever. What about OOP in Django? Controllers are just functions on module level, models are just "poor" records for storing data (no behaviour), ORM is singleton-based. So I would say it's procedural, not object-oriented, at least, not in Java sense. And still sites like Instagram or Washington Post use Django.

Do you consider Instagram not a "real" system?

Ok, maybe it's just web. Java was never good for web, actually. Let's take one another example area, say, scientific computations. Science is something that is really complex, right? Even simple statistical algorithm involves tricky numerical computations, optimization methods, probability models, etc. Matlab is good at these. R is good at these. Python (SciPy) and Julia are good at these. C and Fortran are not very convenient, but fast and thus used extensively. What about Java? Is Parallel Colt best possible choice? Not very impressive. Ok, maybe Matlab, Python, C, etc. are really good only for little experiments and are not really scalable? Hmm, have you ever wondering what software Mars Curiosity is using? It's 2.5 million lines of C code with tests in Python [1]. And nothing about Java or OOP.

So, do you consider Curiosity software not a "real" system?

I'm pretty sure Java is good for some sort of applications. I've heard a lot of good things about using OOP for UIs. But Java is not the only language used for complex systems, and UIs are not the only "real" kind of systems.

[1]: http://programmers.stackexchange.com/questions/159637/what-i...




What about OOP in Django? Controllers are just functions on module level, models are just "poor" records for storing data (no behaviour), ORM is singleton-based. So I would say it's procedural, not object-oriented, at least, not in Java sense.

Strongly disagree. The internals of Django are full of inheritance and mixins (a form of multiple inheritance), and so are the class-based views and the forms.

The CBV class hierarchy is complex enough that someone had to make this site to help everyone keep them straight: http://ccbv.co.uk/

If you only write FBVs and implement your own views and forms from scratch you can keep your code fairly procedural, but I would say that Django heavily [ab]uses the OOP features of Python.


> The CBV class hierarchy is complex enough that someone had to make this site to help everyone keep them straight: http://ccbv.co.uk/

It's funny how your comment compromises OOP - even in Django class-based views make things complicated :)

Anyway, I didn't mean that Django doesn't use OOP at all or forbids you to do so, but rather that it provides another approach (mostly procedural) and pretty successfully. Most people outside the OOP dome actually know that this paradigm is good for particular tasks. But what people under the dome don't know is that there are many other approaches that work not worse, and often even better than OOP.


For scientific computation, libraries such as JAMA or la4j performs much faster than scipy on matrix operations or common linear algebra operations : http://martin-thoma.com/matrix-multiplication-python-java-cp... https://code.google.com/p/java-matrix-benchmark/wiki/Runtime...


Sorry, but both of these benchmarks are terrible. First link compares run time of the whole programs, including start-up time, time for parsing file and printing out resulting matrix. I'm pretty sure matrix multiplication was the fastest of all these operations. I haven't read details of second benchmark (in fact, I've got lost in all these XXXFactories and couldn't find where things are actually happening), but I see no Python sources to compare with. So it's quite useless in this discussion too.

Also note, that performance was not the only point of my comment. In fact, my point was in simplicity of designing complex scientific systems. In Python you have excellent stack: NumPy + SciPy + Scikit-* + Pandas + Numba + Cython + Theano + Pylearn2 +... The list is endless, and all these tools may easily be used together. In R you have CRAN with everything you may ever be wanting. In Matblab you have a number of both - open-source and proprietary libraries. Julia community is also growing quickly. (Note, none of these libraries uses OOP as its primary paradigm.) And what about Java? Java has a little disjoint set of libraries that neither solve large set of problems, nor interoperate with each other well.


> Python with its main web framework - Django - is really shiny. I would say, it is one of the best web frameworks ever

For small sites, maybe. Once the codebase gets large, it becomes much harder to maintain than a Java webapp of similar complexity written in a sane framework.


Intagram's website is small? Ok, so show me the large one written in Java. But let's agree: this should really be web site/web interface, not some back-end service in large distributed system like Twitter or LinkedIn, because in such systems there's a great mixture of the whole bunch of different languages.

So far list of websites written in what I used to think of "sane Java framework" (Spring Web) is not very impressive [1] compared to Instagram, Washington Post or Reddit.

[1]: http://spring.poweredsites.org/top


Really? I heard the same claims about Perl, but didn't see much evidence of it when I worked on a large Perl app.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: