4 ms·
Some random thoughts: I think the documentation for Flask is pretty good. By it's nature, it's not a framework for new web developers, so I don't think all the
by taude 13y ago
Some random thoughts: I think the documentation for Flask is pretty good. By it's nature, it's not a framework for new web developers, so I don't think all the general regurgitated stuff that usually goes into books should be included. It's not for beginners, don't try to make it so.
What I see as being a useful book on Flask:
1) listing and naming common stable plugins (flask-security, flask-login) and how they integrate and work together. There's a good page on the Flask site, but I feel a lot of the plug-ins don't work particularly well together. There's tons of different authentication librarys (especially when dealing with OAuth) that work with varying degree out there. Some guidance around this would be really useful.
2) Different ways to setup a large project. How to structure folders, etc. There's some good topics on StackOverflow about this, but my experience trying to integrate different plug-ins, etc, leads to a more messy solution. Maybe some ideas in abstracting out data access.
3) The Art of building up your tech stack with lego bricks. Choosing which plug-ins to use.
4) Testing patterns.
5) More of a style of "I'm trying to do this", this is how you do it. (Note: there's lots of great questions and solutions on the email list that could/should be culled for ideas and consolidated)
6) Debugging and tracing through 3rd party flask-plugins. This is a huge problem for me as most don't include log comments
7) Writing and structuring a good plug-in/blueprint, with some examples of different ways to include reusable code into the project.
Note: I've co-authored a book in the past that was published by Wiley and I think your schedule is pretty optimistic, especially considering you've still got some learning and research to do. Unless, you're just regurgitating the already pretty in-depth documentation.
Second Note: I'm just reading the O'Reily book on Angular.JS, it's less that 200 pages. It's dense with ideas and explanations on WHY something is. This makes it extremely useful. I really like books that focus on the WHY, because the HOW because much simpler to comprehend. I also appreciate the book because it's not some 600 page tome of regurgitated documentation.
- taude 13y agoI had some more ideas about the plug-in development section: 1) offer guidance on making appropriate configuration guidelines 2) suggestions on how to structure a plugin so the view templates can be easily customized or overwritten. Same with the route logic. Same with the controller. 3) decoupling code with signals and blinker. Generally, how to make a plug-in that provides enough hooks so someone using it doesn't just have to fork their own code off of it.
- taude 13y agoActually, I've thought about this a bit more....there could be a whole book of guidance written about how to create a flask-plugin to be consumed by other users.
- rpicard 13y agoThat's true. It seems like plugin development might be a little out of scope for this book, but it's definitely something I'll keep in mind.
- bsg75 13y ago> ...Flask is pretty good. By it's nature, it's not a framework for new web developers... Curious (and no experience web dev-ing here), why not? Flask and Bottle seem "minimalist", which in my thought process means less stuff to worry about to start simple apps in. This logic could of course be upside down - less framework = more code to write?
- tjr 13y agoI wondered the same thing. I've not used Flask, but perusing the documentation, it looks pretty similar to CherryPy, which is the only web framework I've ever used (and thus, my first). Django looked too confusing! :-)
- MostAwesomeDude 13y agoNeither. Flask presumes that you know Python and that you understand how requests and responses work. This isn't impossible for a beginner, but it's certainly not likely. Flask's main API is heavily based on decorators, and those are a perennial problem for new programmers.
- taude 13y agoWould new programmers have trouble using decorators? With writing them, yes. But I think the idea of "tagging" your function is pretty approachable for even a new-programmer type.
- rpicard 13y agoAs a newcomer I don't think I ever had much trouble with decorators. It took me a little time to understand exactly what was going on, but not too long. Even writing them seemed fairly straight-forward.
- taude 13y agoIt will vary what your definition of simple app is. Simple as in "doesn't do much", or simple as in "minimalistic for a real world use case", in which case session management, login, security, authentication/authorization, template rendering, data access, etc. are all going to be required. I say "mimimalistic for real world use" because I have yet to create an application that didn't include all these things (at a minimum). Of which, you need to be aware of, so you can choose the appropriate library for your application. Flask is like Legos in that you choose the pieces to build onto its minimalist stack. You can use if for lightweight prototyping or full-blown web apps. Since all these things "are a worry", it's probably best for new-comers to web dev to use a full stack that makes decisions for you, that has cohesive documentation across components, and a large contingent of users.
- rpicard 13y agoAs I'm formulating the exact focus of the book I've been finding myself wondering how much introductory material I should include. I think you're right about leaving as much out as possible. When there is prerequisite knowledge for a particular topic, I can just point them to the documentation and avoid cluttering the book with that stuff. Regarding the schedule, since I've gotten I few comments on this I'm starting to think it might have a little weight to it. I'm pretty determined to get it done by that launch date, but my primary concern is writing a really good book. If I must delay launch, I'd rather do that than rush it. I really like the idea of explaining the "Why?" Do you mean explaining why certain practices are preferable, or why the creators of plugins and Flask itself did certain things? Also, your notes are all amazing and I'll be referring to them as I outline the book!