5 ms·
Things from PHP that I want in Django and Rails: - "Just write an HTML file" deployment. I want to be able to dump an HTML file into a directory to get starte
by nostrademons 17y ago
Things from PHP that I want in Django and Rails:
- "Just write an HTML file" deployment. I want to be able to dump an HTML file into a directory to get started, with none of this skeleton directory stuff. Then I could incrementally refactor that file into a template, pull its logic into views and models, customize the paths with a urls.py, and build my app up with baby steps instead of jumping into MVC land immediately.
- Tight integration with webservers. This FCGI/SCGI standalone stuff is a pain, particularly if I also want to serve static files. I want to start with something transparent like PHP's Apache module and then go to FCGI/SCGI/proxying only if I get big enough to add a separate appserver.
- User comments on the documentation. They're occasionally misleading, but usually explain some necessary corner cases.
Things from Java I want in Python:
- A fast JIT compiler.
- JavaDoc. Yes, it's superior to docstrings, mostly because there's a standardized documentation generator for Java and basically all Java projects use it. When I look at a Python project, I have no idea what documentation format they're going to use.
Things from Erlang I want in every language:
- Message-passing concurrency. It's time to ditch threads.
- "Let it crash" mentality. It's virtually impossible to enumerate the ways which your program may fail, so let it die and focus on what you should do to recover from the failure. Then use a supervisor process to make that happen.
Things from Python I want in every language:
- Whitespace-significant syntax. Controversial I know, but I find this drastically reduces clutter in code.
- Doctests. I don't think Python goes far enough; its philosophy is that doctests are documentation and unittests are tests. But with a couple simple extensions, doctests could be tests too, and much more concise, readable, easy tests than the xUnit framework provides.
There're a bunch more I could come up with, but this is already a long post...
- jules 17y agoI would like syntax highlighting for my doctests.
- andreyf 17y agoWith the >>>'s color dependent on whether the test passes.
- cellis 17y agoAs a new php -> python programmer here are a couple other things i'd naively like to add to python: Built in json_encode. Type hinting The only reason i decided to learn python was because of the free quotas on the google app engine. I suppose I'm still kind of reeling from the triple whammy of having to learn Django (ok, its not really hard), Python, and the google app engine with its non-relational db all at once. Unlearning relational stuff is much harder than it looks.
- nostrademons 17y agoPython 2.5 ships with simplejson, and in Python 2.6 it's been renamed to plain old json. I'm not sure on the implementation - one of the problems with Python JSON implementations was fragmentation, so if you wanted the standard implementation you'd use simplejson, but if you wanted the fast one you'd use cjson, yet if you wanted the maximally compatible library there was yet another 3rd-party JSON library. I'd like to think that the json module is fast and standards compliant, but I haven't looked at it. I kinda would like type hinting too, although that's a deeply divisive issue in a dynamic language community.
- itistoday 17y agoIf you're interested in a Lisp-based PHP-like web framework, I've been working on one called Dragonfly for newLISP (http://www.rundragonfly.com http://www.rundragonfly.com), which has some of the things you asked for like a standard doc format and thread-less message-passing concurrency, as well as "just write an HTML file" development. One of my favorite things about PHP though is its documentation, which as you point out allows for user comments. That is something that I would like to see more widespread (and something that Dragonfly unfortunately lacks). I agree with the sentiment of the OP: there are many languages out there, and they each have their own strengths and weaknesses. I also don't thing you'll ever find a language that will please everyone, so say 'no' to language monogamy and pick the one best suited to the task at hand.
- 10ren 17y agoFantastic points! Request for a bunch more, written up. http://www.sinatrarb.com/ http://www.sinatrarb.com/ at least does it with one file (but it's not HTML, which I agree is a lower on-ramp). User comments on docs is brilliant. Flash does this, but moderated, with a long delay (weeks!). So, a reddit/digg/HN/SO voting scheme would fix this. But I agree, that just plain comment - unvoted, unmoderated - would still be a net win. Javadocs is assisted by strong typing. A huge win is hyperlinks for return types and arguments, so you can quickly trace through. A doc-only type-system convention for python would help here. There's also that extreme approach in Haskell of looking up functions entirely by their type signatures. "Let it crash" is cool, but makes sense only for servers, I think. It's moving away from a general purpose language to a specific application. But it's an important one, so why not? I mention this just because it's a bit mind-twisting. EDIT doctest was new to me, and that's fantastic too. http://docs.python.org/library/doctest.html http://docs.python.org/library/doctest.html Years ago, I had the idea of writing unit tests automatically, by capturing the output of a manual test session, and then using it directly as an automated test: so that you get it 100% for free, since you do the work anyway. I didn't realize that python's REPL makes this trivial (uh... so lisp has probably been doing this for 30 years...); and pasting it in the code itself is another cool improvement. It still has the problem of unit tests, of freezing the API; but if you change it, you'll want to test it again anyway. Hey, if you refactor the code, you can probably refactor the REPL session at the same time. As I said: fantastic, request for a bunch more.