News for hackers. Stuff that matters.
Re:What is the best way to solve an Objective-C namespace co... by SoftwareMaven on Saturday May 19, 2012 @11:50PM (#3997880)
As much flak as Java gets, at least they got namespaces right. Python got better, but it's still not what I would call great.
Re:What is the best way to solve an Objective-C namespace co... by fleitz on Sunday May 20, 2012 @12:27AM (#3997940)
At first glance yes, but as always with Java when you dig under the hood you see tight coupling to bad ideas from the early 90s. Given the OO/Java mantra of decoupling I'm not sure why the namespace is a consequence of the filepath they seem far too tightly integrated.
Re:What is the best way to solve an Objective-C namespace co... by eropple on Sunday May 20, 2012 @01:46AM (#3998061)
Agreed - C# fixed this, though (by default it maps to the directory structure, but you can change this). Scala encourages Java-style packages but lets you put them wherever you want.
Re:What is the best way to solve an Objective-C namespace co... by lmm on Sunday May 20, 2012 @04:56AM (#3998337)
I find that an irritating pain with scala, actually. I move a file from one directory to another, then spend ten minutes trying to figure out why lift still can't find the class, before the facepalm moment where I realise I didn't change the package declaration in the file.
Re:What is the best way to solve an Objective-C namespace co... by eropple on Sunday May 20, 2012 @11:55AM (#3999089)
I agree that it's actually sort of stupid to allow it--I used the word choice I did intentionally, because C# 'fixed' it (its strong IDE support makes having files in different places pretty much impossible unless you want it to happen), but Scala isn't so lucky. At least I get it when I use IntelliJ, which doesn't even tell me before updating the package declaration. :)

I use Play or a home-rolled solution based on vertx, though. so I don't have to worry so much about finding them.

Re:What is the best way to solve an Objective-C namespace co... by lmm on Monday May 21, 2012 @08:21AM (#4002484)
I hate magic package names; I'd far rather be using wicket, but I wanted good comet integration for this particular project.
Re:What is the best way to solve an Objective-C namespace co... by masklinn on Sunday May 20, 2012 @03:08AM (#3998182)
Haskell's hierarchical modules extension is also very, very good. Amongst other things, it fixes Python's issue of lacking independent "namespaces" (mapping namespaces to packages or modules directly means you can't have two packages living in the same namespace easily)

Still has one failure though: the default import is both qualified and unqualified, I think it should have been qualified only.

Re:What is the best way to solve an Objective-C namespace co... by pjmlp on Sunday May 20, 2012 @03:31AM (#3998215)
Any language with namespace/modules support has this right.

Only C and Objective-C don't, and force everyone to come up with prefixes.

And when collisions do happen, you have to resort to preprocessor tricks to work around it.