6 ms·
What is a Web Framework?
- blt 13y agoCool post. I would be interested in a follow-up post about how web frameworks handle user registration, authentication, and sessions.
- est 13y agoand forms, file uploads, etc.
- ritchiea 13y agoI love stuff like this that talks about web basics in precise detail. Too much of the stuff out there for beginners glosses over the basics of the web. In the midst of receiving tons of info about HTML & CSS & Javascript & whatever scripting language beginning devs have trouble knowing at all times what level of the stack they are operating at, what's the execution context. Can I write Javascript here? Can I write Ruby/Python? Does it have to be interpolated? This stuff is seemingly simple but is actually so complicated when you're thrown into the ocean that beginners have trouble keeping track of it. And it really doesn't help when more experienced devs, or non-web programmers shame people about web dev being dead simple because it's not. It's a different kind of programming, it may even be easier than writing C and managing memory explicitly and not having garbage collection. But if it is easier, it's only easier once you've mastered it and have a really strong grasp of what is happening at all times. Until you get there, it's easy to get lost in the endless list of technologies you must be familiar with to write even a simple web application. And I know this because I see it in beginners that I have taught and/or worked with.
- saturdayplace 13y agoI recently decided to write from some tutorials[1] (maybe eventually a book) that assumes zero knowledge and works its way up. I'd like to eventually go all the way up through SQL, basic httpd administation, etc. It's a long row to hoe but I think it may be valuable. [1] http://trevorhunsaker.com/ http://trevorhunsaker.com/
- ctidd 13y agoI would strongly recommend reviewing your 101 WRT what you're calling tags and clarifying that tags represent elements that are interpreted and rendered by the browser. (The browser does not render tags.) Also, the distinction of semantics and styling should be cleared up a little. Less emphasis on how elements are styled by default, and more on what they represent. I like the approach of assuming no knowledge, but this requires extra care to introduce concepts without using improper or misleading terminology. As a beginner, there's not much worse than hearing simplifications and thinking they're the whole story. Good luck with continuing your series!
- saturdayplace 13y agoThanks for the feedback! I'll make sure to review for improper simplifications.
- nswanberg 13y agoBoth your site and the original post are great starts. Anyone reading or writing these sorts of fundamental web programming tutorials should look at Philip Greenspun's books Philip and Alex's Guide to Web Publishing and Software Engineering for Internet Applications, both available free online (The latter is a stripped down version of the former, written for goal-oriented MIT students who don't want anecdotes or pretty pictures). They are around a decade old, so they aren't a good source for copy-paste-ready code, but the ideas in the books have aged quite well (from simple things like using "abstract URLs"--URLs without extensions like .aspx and .php, to focusing on the website's data model and user interaction instead of the programming language). The most interesting part of these books is that they explored creating web applications for a purpose, not as an end in themselves. They were written for the sort of people who evaluated their past year not on what their manager wrote in some HR form and the raise they got, but on what they were able to accomplish, like creating http://scorecard.goodguide.com/ http://scorecard.goodguide.com/. (What's funny is that in Greenspun's ITConversations interview (around 4:20 http://web.archive.org/web/20130729213414id_/http://itc.conversationsnetwork.org/shows/detail94.html http://web.archive.org/web/20130729213414id_/http://itc.conv...), he said that the parts of Phil and Alex's Guide that aged were not the technology, but the rampant idealism in the book that web applications would unleash a new age of enlightenment, like the academics who had believed television would be used to broadcast Harvard lectures around the world). Here are the chapters on HTML: http://philip.greenspun.com/panda/html http://philip.greenspun.com/panda/html http://philip.greenspun.com/seia/html http://philip.greenspun.com/seia/html And the closest to describing HTTP and frameworks: http://philip.greenspun.com/panda/server-programming http://philip.greenspun.com/panda/server-programming http://philip.greenspun.com/seia/basics http://philip.greenspun.com/seia/basics (It just occurred to me that Philip's interview above is one day short of being 10 years old, and his assessment might be worth revisiting. The internet still contains volumes of crap, but the internet as only grown as a teaching and community building tool, with sites like Meetup and Facebook organizing learners and teachers, Khan Academy and Udacity doing organized classes, and StackOverflow collaboratively solving specific problems).
- the1 13y agomeh, no websockets?
- interstitial 13y agoA framework is a weasel word for a Massively Coupled System. The trappings of orthogonality and modularity are given lip service, while actually creating some of the most anti-modular footprints in human systems design history.
- burntsushi 13y agoI generally agree. But I think there exist good "frameworks" out there. I'd cite Bottle[1] as one. And while it's still new, I think Martini[2] has the beginnings of something great. Both of them heavily rely on principles of composition. [1] - http://bottlepy.org/ http://bottlepy.org/ [2] - https://github.com/codegangsta/martini https://github.com/codegangsta/martini
- interstitial 13y agoI agree, I think there is a movement afoot (if not named) that new frameworks will be truly decoupled -- being designed by war-worn veterans. The first frameworks were all massively coupled bells and whistles. The whole point of RoR is a pseduo-OO skin over a massively coupled Active Record system that can't really be extended without hula hoops. And Rails gurus love hula hoops.
- mattgreenrocks 13y agoOne problem: users of open source love oodles of features, no matter how useless. Witness the sheer number of people who admit the primary way they choose a library is the last commit date and features list. So if you write a solid library with just the right number of features, then it might get less consideration because you're not always duct-taping over poor design choices. This is what happens when we glorify Internet Time. It becomes more about shipping and less about quality.
- codegangsta 13y agoThis is very true. It is a real issue in the open source world. http://github.com/codegangsta/martini http://github.com/codegangsta/martini tries to pride itself on minimalism. Thankfully the modularity of the project allows me to tell people to add features via other packages and repositories. Even though the product is solid it is difficult to communicate that the project is still active without having so many commits. This is one of the reasons that I find the Golang package management philosophy refreshing in theory. "Master should never break" really prevents feature creep from coming in and promotes the use of solid packages that aren't always being actively worked on. Of course there are some major drawbacks wrt lack of versioning in Go, but I think the philosophy there overall is a very good thing for open source development.
- daGrevis 13y agoRead all of the post. I was expecting some enlightenment at the end or something useful for me, but nothing. This stuff is mandatory for each and every programmer who writes web-apps and I wouldn't call them web-programmers if they wouldn't know these basics.
- brickcap 13y agoWell I think the purpose was to teach people who are not web programmers. Or at least those who are new to web programming.
- blhack 13y agoI disagree with the sentiment of this blog post, because it implies (unless I missed something) that you need to use some complicated web framework to make the internet go. You don't, and I've recently been encountering a LOT of very confused would-be devs who get stuck behind some tangled mess of django installation. The "simplest" web application could look like this: #!/usr/bin/python import cgi form = cgi.FieldStorage() name = form.getvalue("name", none) print "content-type:text/plain\n" print "Your name is %s" % (name) Or maybe you want to get fancy: #!/usr/bin/python import MySQLdb db=MySQLdb.connect(user=user,passwd=pass,db=test) c.execute("select something from sometable") results = c.fetchall() print "content-type:text/plain\n" #hey look, CSV data! for line in results: print ",".join(line) etc. etc. I encountered a dev the other day (I guess I'm a shitty dev, then?) who asked me how my application handled URLs. uhh...apache? "No, how does it handle URLs, though" "Apache. WTF are you talking about?" "No, like if you go to example.com/foo/bar/, how does it know what to send me?" "...?" I swear half the devs I meet lately are more concerned with javascript frameworks and rewriting their own webserver than they are about actually serving content to users. Imagine a baker who was more concerned with building ovens than baking bread. Keep in mind what your goals are when you're working: are you looking to write a javascript framework, or are you looking to write a web application? Then evaluate what path you want to take from "not having an application" to "shipping a product". Sometimes (probably many times), you don't need to make it as complicated as you're making it, and apache will work just fine.
- scarecrowbob 13y ago"Imagine a baker who was more concerned with building ovens than baking bread." I'd imagine that at some point, it's hard to make enough bread without considering the ovens.
- couchand 13y agoGood point. The metaphor is much stronger than the grandparent realized: a great baker should spend some time to find the best oven, install it in their bakery, then (hopefully) never think about ovens again.
- dorfuss 13y agoThanks, you helped me a lot :) Does anyone know a similarly straightforward article on TCP/IP?
- simonw 13y agoBeej's guide to network programming is great http://beej.us/guide/bgnet/ http://beej.us/guide/bgnet/ - it's pretty deep, but it's very clearly written.
- jebblue 13y agoI wasn't able to open the article, it was hanging on a call to disqus.com and I have that IP banned in my firewall (iptables): http://www.tcpiputils.com/browse/ip-address http://www.tcpiputils.com/browse/ip-address 108.168.209.242
- pacoverdi 13y agoI don't know if this qualifies as a framework as it is really minimal: http://jflask.net http://jflask.net In short: java, inspired by flask, uses the http server included in the JRE. Perfect for embedding a small webapp in a java program (jar size < 20k, no external deps). Probably not suited for big scale apps. Edit: homepage
- dfgeheht 13y agoIt has been heartening to read so many of the comments here pointing how absurd web development has become with the endlessly more rigid frameworks prescribing their world view onto the developer, effectively reducing them to module install muppets, rather than empowered developers.
- mattgreenrocks 13y agoIt's incredibly stifling once you get experience under your belt. FWIW, I think Rails has a great design aesthetic, and yet it feels like a straightjacket once I get near it. I want to just write Ruby.
- bsaul 13y agoPart that took me the most time to understand is the different way to have an execution context for dynamic pages ( cgi, wsgi, fastcgi, servlets). I think that should definitely be a part of a "what is a web framework".
- ZeroGravitas 13y agoThe first two chapters of this online book cover similar ground, but for PHP and the symfony framework: http://symfony.com/doc/current/book/index.html http://symfony.com/doc/current/book/index.html
- jebblue 13y agoI thought it was a good article, there are a lot of different programmers out there, not all do web programming. This provides necessary coverage of the core web stuff you need to know if you want to get into it.
- jmgtan 13y agoInteresting discussion. Any thoughts on Spring and Spring MVC? Could Spring be considered monolithic as well?