Live data from Hacker News

Wikileaks To Leak 5000 Open Source Java Projects

steve-yegge.blogspot.com

81–90 of 140 posts

Re: Wikileaks To Leak 5000 Open Source Java Projects

#81
Some context:

WalterGR commented on reddit that this rant is actually in response to this tweet by Marco Tabini:

-------------------------

"@ijansch Private has absolutely no useful role in open-source code." ( http://twitter.com/mtabini/status/18867470296 )

-------------------------

Marco is the co-founder of "a consulting firm that specializes in information architecture, code and security auditing, large-scale deployments and optimization".

More information:

http://www.reddit.com/r/programming/comments/cusyw/wikileaks...

Re: Wikileaks To Leak 5000 Open Source Java Projects

#82

Earlier quoted context omitted.

A big part of OO languages is encapsulation. Private fields encapsulate state and private methods encapsulate implementation details. The intention there is to make the code more robust to restrict the way collaborating classes can interact with it. Example, if you have a type representing a game score, you may want to implement a public Increment() method instead of letting other types access the score value directl…

Thanks for the response, but can you not see the source code of these private methods? And wouldn't that allow you to re-write them yourself to behave however you want?

And than you will accept that either you're now forked it and won't be able benefit from future releases as in drop in replacements, or you'll have a hard time implementing the same changes you did before over and over again for each new release.

Re: Wikileaks To Leak 5000 Open Source Java Projects

#83
This reads to me as "let's make all state mutable and remove all indication as to which bits of the code are the interface, and which are implementation details". I like immutability and minimal interfaces, they make it easier to reason about what the code will do, freeing brain cycles to work on more interesting things than "but what if someone modifies foo between invocations of bar".

If you need access to a library's private or final fields, the library API is badly designed. Or, if you're that keen on wanting to change how the library works, fork it. That's kind of the point of open source.

Re: Wikileaks To Leak 5000 Open Source Java Projects

#84
post #24

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

Considering the history, don't you mean "Does .NET have something similar to Java's reflection?"

I don't understand the up-votes on this. He asked a reasonable question and phrased it with respect to his knowledge base. Your reply assumes he knows the answer to the question he's asking. Huh?

Re: Wikileaks To Leak 5000 Open Source Java Projects

#85
post #78

Earlier quoted context omitted.

This actually reminded me of Apple...

The difference between phones, and all other products, is that phones don't work unless you're currently in a business relationship with some telecom or another. It's a bit more like selling someone a nuclear reactor—they're beholden to your rules as long as they have no other source of fissile materials.

In 15 minutes, with 15 euros, I could be out the door and have a new 'business relationship' with a different telecom provider. It's not that big a deal: you just pop in a new sim card.

Sure, in the US people have all these locked up phones, but that's the price you pay for getting subsidized hardware.

Re: Wikileaks To Leak 5000 Open Source Java Projects

#86
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 :)

[deleted]

Re: Wikileaks To Leak 5000 Open Source Java Projects

#87
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 TRUE random()%2

Re: Wikileaks To Leak 5000 Open Source Java Projects

#88
post #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!)

Immense power and immense horror go hand in hand.

Re: Wikileaks To Leak 5000 Open Source Java Projects

#89
post #43

Earlier quoted context omitted.

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.

But it's not a many to many mapping, that's the point he was making. Lots of languages interop with C, but you can't just import a ruby module into a python script very easily. In fact if you want to link to C libraries from D you have to modify the C header files to turn them into D modules.

I think Microsoft actually did a reasonable job with the "original" COM (ie OLE 2.0 - the stuff that let you put an Excel 95 spreadsheet into a Word 95 document).

It had a bit too much bolted on, probably due to its origins in OLE, and I think "dynamic OLE" was a tragic mistake. And its reference counting approach was a lot more appropriate in the early 90s than it is today (where a compacting GC may be the smart choice, performance-wise). But for making calls between objects in C, C++, VB6, Delphi, and pretty much every other language that lived on the Windows platform, it worked really well.

Re: Wikileaks To Leak 5000 Open Source Java Projects

#90

This reads to me as "let's make all state mutable and remove all indication as to which bits of the code are the interface, and which are implementation details". I like immutability and minimal interfaces, they make it easier to reason about what the code will do, freeing brain cycles to work on more interesting things than "but what if someone modifies foo between invocations of bar". If you need access to a librar…

You've got a point, but I think final class modifier which prevents extension often hinders Unit Testing and never adds much value.
Post reply on HN