Hacker News new | past | comments | ask | show | jobs | submit | ricky_clarkson's comments login

I'm a native English speaker living in Argentina, and yours is the first English writing I've seen by an Argentine that is enjoyable (I read some of your other posts) and doesn't contain errors, and that includes people who were schooled bilingually.

Is there anything in particular that pushed you over the edge beyond fluent?


Thanks. I've been in the US since the 90s, and by now my writing is about the same in Spanish or English. My early schooling in Buenos Aires was bilingual.

Jorge Luis Borges once said "let others brag about the pages they have written; I'm proud of those I've read." What I believe he meant (and I agree) is that a person's writing is a reflection of what they have read. I've read many more books in English than in any other language (including Spanish).


that's weird. Come around reddit.com/r/argentina and you'll see the same kind of writing quality.


Thanks for the link. While that looks interesting I was talking about English writing by Argentines, whereas that subreddit is almost entirely in Spanish.


Sorry for the late reply. Yes, it's 80% in Spanish but now and then some foreigner comes asking questions in English and that gives place to lengthy threads in English, mostly written by argentines.


Having typed since I was 5, I think while typing, and going back and forth in code is the same as thinking for me. I'd expect that most of these amazing hackers are from the era where they wouldn't see a keyboard until being 16 or 18.

I'm not a vim/emacs shortcut freak, but I do appreciate environments that don't make me use a mouse.


Java makes excellent code unreadable.


... and makes it possible to hide some pretty bad code/design among the abstractions.


Well, yes: arguably, that very fact is one of the major wins you get from good abstractions.


I wonder whether Functional Reactive Programming might work better.


You mean like in the original Asymetrix Toolbook, the earlier versions of Macromedia Director or Future Splash? I would say: yes.


OO exists on top of the imperative paradigm, never the functional one. If you disagree, please define OO.


1. OO has no precise and universally accepted definition. http://www.paulgraham.com/reesoo.html

2. Parameterized modules in Erlang can be seen as a form of lightweight functional OOP.

http://www.lshift.net/blog/2008/05/18/late-binding-with-erla... http://www.erlang.se/workshop/2003/paper/p29-carlsson.pdf


http://en.wikipedia.org/wiki/Common_Lisp_Object_System

"Sweeping generalizations are always bad" :)


From what I understand, CL is not a functional language. It can be used as such, but is not necessarily one.


Common Lisp is a multi-paradigm language, but its OO features can be used in a functional style.


Lisp/Scheme are untyped.


No, they're duck-typed. Types are attached to values, not variables, and for example trying to eval (+ 1 "hi") will throw a proper type exception.

You usually don't have to declare types but for example in Common Lisp you can optionally declare types for better performance in speed-critical parts of the code.


They're an implementation of the untyped lambda calculus. What you're thinking of are better named tags, not types.


Yes.


I disagree. Functions as first class values are more important.


Java has a lot of crap, actually. Take a look at Java Puzzlers sometime.


Procedural does not mean "has a main()". It means that the code within a procedure (or method, or function) is always a sequence of steps, i.e., a procedure. OO is a procedural paradigm. doThis(that) is replaced by that.doThis().


Procedural separates procedures from state. OO combines state and functionality into objects. Also, http://en.wikipedia.org/wiki/Message_passing#OOP


I'm aware of that. But then, every program is procedural at some level; show me a program that doesn't execute as a sequence of steps.

The point is, OO does not require that your code be executed any more sequentially than does a functional language.


A Prolog program is not specified in terms of a "sequence of steps", for example. Of course, the implementation involves a sequence of operations (because it is typically going to be evaluated on a Von Neumann-style machine), but that has nothing to do with the semantics of the program.

OO does not require that your code be executed any more sequentially than does a functional language.

If by "OO", you mean mainstream OO languages like Smalltalk or Java, then they absolutely do have a more operational definition than a pure functional language does. Objects send messages to other objects; as a result of receiving a message, the internal state of an object changes.


So, you're suggesting that functional programs are somehow totally stateless? Otherwise, I don't really see your point. All useful programs store state somewhere. The fact that OO programs couple state and code doesn't make them procedural. Functional programs just tend to muss over this detail by using closures and anonymous functions (aka "objects") to keep track of state.

An object-oriented program is not required to be expressed in terms of a "sequence of steps" any more than is a functional program. You can instantiate objects that talk to one another, asynchronously or otherwise, to collaboratively do work.


You originally said that the idea that OO languages are imperative is "silly", and that:

Anyone who has worked with a pure OO language knows that there's nothing inherently imperative about the approach.

Can you provide some examples of how you might write "non-imperative" programs in a mainstream object-oriented language?

An object-oriented program is not required to be expressed in terms of a "sequence of steps" any more than is a functional program

A functional program is not a "sequence of steps"; in principle, it is just a mathematical expression that can be evaluated (via some means) to yield a value (think of a SQL query or a Prolog program).


"Can you provide some examples of how you might write "non-imperative" programs in a mainstream object-oriented language?"

Go back and read my post -- I drew a distinction between "mainstream" OO languages, and pure OO languages. If you want to genuinely understand object-oriented programming, don't look at C++ or Java. Look at Smalltalk or Simula.

"A functional program is not a "sequence of steps"; in principle, it is just a mathematical expression that can be evaluated (via some means) to yield a value (think of a SQL query or a Prolog program)."

I know what you're arguing -- the platonic ideal of the functional program is stateless, and methods within that program have no side effects. In reality, all programs store state somewhere, and even "pure" functional languages store state (albeit at a higher level).

What I'm trying to explain is that object-oriented programming doesn't require side effects. Where functional programs use closures and monads to pass state around, you could just as easily use a functor to do the same thing. Thus, you aren't compelled to write object-oriented code in an imperative style. The difference is that OO code tends to be more explicit about the location of state variables, and calls them what they are. Functional programs, in contrast, just tuck the stateful bits into closures, and pretends that they aren't really state.


You mean that no Haskell programs can do I/O? Given that I've written Haskell programs that do I/O, I'd guess you're wrong.


He never said that. He just said the "Haskell-ish beauty goes out the window," which is arguably true.

In my (limited) experience, Haskell code to do I/O (i.e., Monads) isn't a pretty or elegant as purely functional Haskell code. A lot of Haskell's useful tricks (i.e., its beauty like the ridiculously strong type system or lazy evaluation) don't work on code with side effects.


Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: