News for hackers. Stuff that matters.
Re:Bottle: Single-File Python Web Framework by heydenberk on Sunday July 17, 2011 @01:46PM (#2773747)
It seems like being single-file is mostly gimmick. What are the drawbacks to creating a folder with an __init__.py and a handful of readably-long files?
Re:Bottle: Single-File Python Web Framework by stevenleeg on Sunday July 17, 2011 @01:55PM (#2773767)
Agreed. The project is ~2700 lines of code all jammed into a single file. Each component is pretty clearly separated from the others with big comment headers, but I don't understand what advantage this has over separate files other than the ability to advertise that it is a single file library.
Re:Bottle: Single-File Python Web Framework by Jach on Sunday July 17, 2011 @02:19PM (#2773826)
Perhaps they're not trying to advertise to the Python crowd but to the PHP and JavaScript crowd who might be suckered in by the "Ooh, I only have to include one file?" line.
Re:Bottle: Single-File Python Web Framework by dpatru on Sunday July 17, 2011 @02:25PM (#2773840)
JQuery is single file too and that's a big part of it's attraction. Simplicity is a huge plus, not only for users, but also for the developer who is forced to be disciplined.

I haven't used bottle yet (just starting), but I'm very impressed with the templating code which seems very powerful and simple. Including the templating system along with the rest of the framework in a single file, forced the developer to think about it more.

Re:Bottle: Single-File Python Web Framework by andybak on Sunday July 17, 2011 @04:24PM (#2774107)
But part of the advantage with jQuery being single-file there is ease of deployment. Python isn't quite as handicapped in this areas as Javascript is. A single line in requirements.txt can add something as complex a complex library to your project without a second thought.
Re:Bottle: Single-File Python Web Framework by lifthrasiir on Sunday July 17, 2011 @11:32PM (#2775006)
And you'll end up with the complexity of dependencies with mismatched and/or incompatible versions. Adding a dependency explicitly to the source code is the ultimate, albeit somewhat inefficient, solution which is often useful. In Python, for example, BeautifulSoup has long recommended this practice.

See also the SQLite amalgamation for another example of a single-file deployment: http://www.sqlite.org/amalgamation.html

Re:Bottle: Single-File Python Web Framework by heydenberk on Tuesday July 19, 2011 @12:09AM (#2779575)
(Client-side) JavaScript doesn't have a simple, builtin pattern for module dependency the way Python does, though.
Re:Bottle: Single-File Python Web Framework by stephth on Sunday July 17, 2011 @04:33PM (#2774124)
I imagine it's about being able to include the whole framework inside your project, without inflating it with a number of files or even having to create a new folder.
Re:Bottle: Single-File Python Web Framework by LeafStorm on Sunday July 17, 2011 @08:52PM (#2774685)
If you are using pip and virtualenv (which are currently understood as "best practice" in the Python world), it's as simple as running "pip install PACKAGE==VERSION" (or, better, adding "PACKAGE==VERSION" to your requirements.txt file). Even if it was expected that people would frequently fork their own version and drop it in their application, a package is still just be a directory with a few .py files. Hardly an issue for version control systems or even setuptools, and it has the advantage that your application code is separated from the forked framework code.
Re:Bottle: Single-File Python Web Framework by jpr on Sunday July 17, 2011 @04:34PM (#2774130)
Looking at the source is just one search away, instead of having to navigate many files or build a tag file or whatever. Also provides an incentive to keep shit tidy.
Re:Bottle: Single-File Python Web Framework by defnull on Sunday July 17, 2011 @07:12PM (#2774477)
"Also provides an incentive to keep shit tidy." This :)