4 ms·
Quote: "I want to write Python code that spits out the HTML and JavaScript required for these interfaces and I still want to handle all the logic in Python." S
by aavotins 10y ago
Quote: "I want to write Python code that spits out the HTML and JavaScript required for these interfaces and I still want to handle all the logic in Python."
Substitute Python with PHP and it feels like 2004 again. I think we all agreed a long time ago that decoupling presentation layer from business logic was a good thing, no?
- gaius 10y agoYou can do that with Bokeh.
- andybak 10y agoBokeh has a very interesting approach. It has three levels you can jump between: 1. Just write Python and get interactive graphs 2. Write Python and small snippets of embedded js when (1) is too limiting 3. Write Python to generate the datasets, and proper javascript via bokeh.js if you need to dig in deep. And as the project matures - the number of reasons to jump from 1 to 2 to 3 will become less. I'd like to see a similar approach applied to general UI development. It's a great example of "make the easy things easy, and the hard things possible".
- tluyben2 10y agoBut you can still separate them in the same language. He does not like the html/css/js combi and neither do I. I would like to develop all in 1 language (whatever that language may be); that has nothing to do with decoupling presentation from business logic.
- andybak 10y agoThere's no reason that generating html and css necessarily implies 'coupling' in the bad sense. It does however mean an extra (and potentially complex) layer of abstraction. However that's a deal I'd consider taking if it means I could write more Python more of the time.
- robmcm 10y agoI think the argument is that with "single page applications" you duplicate a lot of your business logic in fat clients. This thinking is essentially a return to circa 2004 but with today's APIs like websockets. I think you will see applications that are quite generic (look and feel) and very chatty, but quick to develop.