7 ms·
How to build apps pragmatically
- dotnetcore 7y agowhy is this trash got submitted? author picked Django but trash talk PHP. Apple to Apple. shouldn't you compare Django to laravel? Wikipedia, WP, Facebook and countless other site/project have been build with PHP. so...like WTF? HN is going down in quality with trash like this.
- viraptor 7y ago> author picked Django but trash talk PHP. Apple to Apple. shouldn't you compare Django to laravel? I understand that as exactly what was written. Plain old PHP is the old thing here. It could be a PHP vs Laravel comparison instead of PHP vs Django as well.
- withinboredom 7y agoSince when is PHP older than Python?
- viraptor 7y agoThat's not what I wrote though.
- twic 7y agoWhat are "Watcher Views"?
- cerberusss 7y agoI think they mean the following. In Django, a view function, or view for short, is a Python function that takes a Web request and returns a Web response. So a watcher view is probably a view that returns an extremely short response. It's just telling you whether more data is available, or not. They mention websockets as an alternative that's far more complex.
- belzebalex 7y agoYup exactly you've understand it all.
- MaysonL 7y agoFrom the article: "These are views that tell you when a model changed last. Watcher Views are light enough so that you can continuously call them to know whether you should fetch recent data. They're far less complex than WebSockets and avoid the performance costs of continuously polling unchanged data from the API."
- catchmeifyoucan 7y agoDo you still have to poll a Watcher View - if it's an endpoint that tells you if the model is updated or not?
- belzebalex 7y agoYes you do, except that it's much faster for the backend to answer as it just hits a cache instead of doing a db query and serializing the whole model.
- tsss 7y agoLike I'm gonna take advice from someone whose personal website doesn't even work.
- Reventlov 7y agoWhat does not work exactly? Here, everything is as expected.
- anon767 7y agoI got a „rate limit exceeded“ several times actually.
- arexxbifs 7y agoI just think the site's been slashdotted, or whatever the term is on HN. Hackernewsed?
- belzebalex 7y agoSorry, Github Pages was overloaded :/
- dang 7y agoPlease don't be a jerk on HN. You owe the community better if you're participating here. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html Edit: https://news.ycombinator.com/item?id=22064005 https://news.ycombinator.com/item?id=22064005 is another recent example. Continuing to post like this will get you banned here. Would you please read the guidelines and use HN in its intended spirit?
- SirensOfTitan 7y agoMore often than otherwise, I’ve found code duplication preferable over abstraction. I only abstract code when I understand the problem space really, really well (I.e. have solved it before), or when I can have some certainty the wrong abstraction won’t cost me too much time to fix.
- gfodor 7y agoIt does seem that this lesson takes at least a decade to internalize, and as such one can usually estimate the level of experience a person has based upon how much they embrace “DRY” as a hard rule vs a guidepost.
- smoe 7y agoAgreed. Also one can get over-eager with abstractions over things that are not real duplicates. They just happen to look similar at this moment in time. In this category, I would also put premature automation before learning what it actually is you are automating among other things. Or more generally: Don't try to be clever about something you don't (yet) understand.
- chubs 7y agoI once read a guideline (by DHH I think?) "One, Two, Refactor" as in write it once, then duplicate it, and the third time think about refactoring it to be DRY. But yes it's all about discerning what's reasonable given the circumstances, and not being dogmatic.
- vbezhenar 7y agoSome old tools are gold. It's good to know them. You can master regular expressions and they are applicable everywhere, from simple parsers to mass-editing the files. You can master UNIX shell and some tasks will be incredibly easy. You can master vi and you'll be able to edit remote files over terrible ssh connection. Also, IMO, some old tools are not bad, even if they're out of fashion. I can write web application with Java Servlets and JSP like it's 2000 and it'll be fast and performant enough for many use-cases, not everyone have to use React. So if some tools are not that good, but you know them very well, may be it's worth to keep them around.
- cutler 7y ago"To serialize logic, we would just need to represent the AST in a lisp-like syntax". Why not use Hy (http://hylang.org http://hylang.org) and keep your Django.
- belzebalex 7y agoWhy not, but is it portable to other programming language like Go?
- jakelazaroff 7y ago"Use Popular Tools", "Old Doesn't Mean Gold" and "Use The Right Tool" are all kind of contradictory. "Cool" and "popular" are usually correlated. "Old" might correlate inversely with "cool" but directly with the ease of finding plugins, Stack Overflow issues and blog posts. IMO, the criteria to use when evaluating a tool are 1) cost of building it yourself, 2) how well you know the tool, 3) how big the community is, and 4) how well the tool fits the job.
- afarrell 7y ago> "Use Popular Tools", "Old Doesn't Mean Gold" and "Use The Right Tool" are all kind of contradictory. Yes, but that doesn't make them simultaneously good advice. The tension among these three is one of the trichotomies of technical leadership.
- belzebalex 7y agoExactly, it's a balance to find.
- arexxbifs 7y ago> Try to build a complex server-rendered web app with PHP because "It's more inclusive" or "it has better frontend performance". See you in 2030. Like Facebook, WordPress and MediaWiki? Bashing PHP is a popular pastime, but front-end performance and inclusion are not to be scoffed at. Especially not if your target audience has a different standard of living than that of a major European city. Personally, I'm much more worried about optimizing heavily third-party dependent front-end code to perform well on old laptops and cheap phones than I am with scaling up and load balancing a server-rendered site.
- hashberry 7y agoAnd no ones builds webapps in plain PHP anymore... there are high-quality modern frameworks like Symfony or Laravel with dependency injection, unit tests, template engines, etc.
- segmondy 7y agoTons of folks build apps in plain PHP, more so than use frameworks
- dotnetcore 7y agoyeah. he lost me with that.
- belzebalex 7y agoWell yes, like all of them. It's just that building complex apps with a lot of interactions gets messy super quickly when you render everything on the server. It brings a lot of limitations that are hard to deal with.
- paulddraper 7y ago> Like Facebook, WordPress and MediaWiki? Yes, exactly. Facebook, Wordpress, and even MediaWiki have had man-centuries put into them. If you want a polished result in less time, you should consider a different approach than server-rendered PHP for everything.
- AlchemistCamp 7y agoIt's odd the author chose Django because it's "popular" and dismissed PHP because it's "old". Laravel is far newer and more popular than Django and PHP is both newer and more popular for web dev than Python. Why would the author insinuate Laravel (and presumably WP and the rest of PHP) will be dead by 2030? For that matter, is it pragmatic for a startup to worry at all about what the best choice ten years in the future will be?
- axiosgunnar 7y ago> Why would the author insinuate Laravel (and presumably WP and the rest of PHP) will be dead by 2030? I think the author meant that writing a complex server-rendered webapp in PHP would take very long, hyperbolically saying it would take until 2030.
- AlchemistCamp 7y agoAh, ok. That's slightly less strange, but still very strange given the productivity and ecosystem size of Laravel vs that of Django.
- belzebalex 7y agoYou've got it all right!
- joenot443 7y agoTo be fair, per their About page, the author is 18 :)
- viraptor 7y agoI'd add from my experience: decide if you want to have a product at the end or learn something. I've tried a few times to "do this thing while also using X to learn about it". Every time I did learn about X. Rarely did I ever end up with the expected end product though (because learning and trying new things gets in the way of actually completing until I ran out of time/steam)
- streamonline 7y agohttps://superbowl54livestream.com/ https://superbowl54livestream.com/ Super Bowl 2020 Stream: Chiefs vs 49ers Live Stream for free