Live data from Hacker News

Wikileaks To Leak 5000 Open Source Java Projects

steve-yegge.blogspot.com

31–40 of 140 posts

Re: Wikileaks To Leak 5000 Open Source Java Projects

#31

Does Java have something similar to .Net's reflection?

As a (mostly) .Net developer, I was curious, so I looked it up. Yes, you can use reflection in Java to invoke private methods and access private fields in much the same way you can in .Net

Re: Wikileaks To Leak 5000 Open Source Java Projects

#32
post #25
post #11

In a global header long time ago, a friend of mine (and big "C" lover) did this to his best buddy once (a C++ and especially boost lover): #define class struct #define private public #define protected public

continued "fun" (read dangerous) redefines: #define true false #define false true #define true 0 #define false !true #define if while #define continue break :)

#define struct union

Re: Wikileaks To Leak 5000 Open Source Java Projects

#33
post #4

Christ, this guy never ceases to amaze. His talk at I/O a couple years ago was absolutely fantastic: http://www.youtube.com/watch?v=BttI-y9VzXQ

One of the points he makes is that VMs are obvious for the purpose of language interop. Seems like C and Lisp (and D, another language he mentions) have been interoperating with each other without a VM in common for quite a while.

Re: Wikileaks To Leak 5000 Open Source Java Projects

#35
post #18

Earlier quoted context omitted.

The issue is less about encapsulation and more about language-enforced encapsulation. Encapsulation is good, but encapsulation that's enforced by the language is debatable.

If the language isn't enforcing the encapsulation, how is it encapsulated? For me, encapsulation comes down to "What I hide, I can change. What I expose, other types may couple to in an inappropriate way."

Most dynamic languages use convention, which seems to work pretty well in practice. My take is that if other developers are accessing the encapsulated parts of your library, then your API or your documentation is broken - possibly both - and you should, like, fix that. Not use language features to lock them out.

Re: Wikileaks To Leak 5000 Open Source Java Projects

#36
post #23

"If I buy you a house and put the title in your name, but I mark some of the doors 'Employees Only', then you're not allowed to open those doors, even though it's your house. Because it's really my house, even though I gave it to you to live in." Love it!

Yeah, it's fine for our software but not their music

Is open source music a particularly big phenomenon?

Re: Wikileaks To Leak 5000 Open Source Java Projects

#37
post #11

In a global header long time ago, a friend of mine (and big "C" lover) did this to his best buddy once (a C++ and especially boost lover): #define class struct #define private public #define protected public

I have an innate fascinated horror of the C preprocessor already, but this really drives home exactly how horrible it can be!

(While being quite funny, mind you!)

Re: Wikileaks To Leak 5000 Open Source Java Projects

#40
post #18

Earlier quoted context omitted.

The issue is less about encapsulation and more about language-enforced encapsulation. Encapsulation is good, but encapsulation that's enforced by the language is debatable.

If the language isn't enforcing the encapsulation, how is it encapsulated? For me, encapsulation comes down to "What I hide, I can change. What I expose, other types may couple to in an inappropriate way."

> If the language isn't enforcing the encapsulation, how is it encapsulated?

What do you mean by "enforce"? Java's private modifier doesn't enforce encapsulation. Javascript's objects do not have a private modifier, but still provides encapsulation via closures. It's hard to have a meaningful discussion when loose terms like "enforce" are thrown around.

Post reply on HN