Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How else can it be done? If you want namespaces you can use them, if not you don't.


Well, obviously, by using them in the language without requiring them on the filesystem? I think you should be able to cat together all the .java files in your project and it should still compile. I guess you could easily do it using a very simple preprocessor.


If you do that you will no longer be able to tell the overall structure of your project at a single glance without using an IDE like Eclipse. Adding and removing packages becomes harder without the IDE. What are the upsides? You've increased the complexity for no good reason.


Easier rapid prototyping and exploratory programming. Edit all the classes of your small/exploratory project in a single file. If the project expands, it should be an automated refactoring to move classes to their own files.

I do this all the time using static inner classes.




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

Search: