With differences in standard libraries, environment specifics and even language features available, I think a far more accurate statement would be "you can sometimes use some code on both the server and client".
2,750 karma · joined February 2, 2011
With differences in standard libraries, environment specifics and even language features available, I think a far more accurate statement would be "you can sometimes use some code on both the server and client".
Here are some interesting resources on the subject:
Alan Kay's elaboration on what he envisioned when he coined the term:
http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay...
Two papers he references:
https://www.rand.org/content/dam/rand/pubs/research_memorand...
http://repository.cmu.edu/cgi/viewcontent.cgi?article=2281&c...
Cool article on failures of OOP:
http://www.smashcompany.com/technology/object-oriented-progr...
Its long and frustrated, but most of the points he makes are true. A lot of the stuff people claim as
I think the original vision of OOP is more valuable than what we call OOP right now. I think a good balance would be writing low-level stuff in functional style and then wrapping it in objects when you need state and cross-library messaging. Also, it seems there is some overlap between the original vision for OOP and what we call "microservices" today.
I used to write for an amateur online magazine with product reviews and analysis of a certain industry. It wasn't big, but the content was good - not just in my opinion, I was told that many times by various readers. In ~2005 we routinely were #1 to #5 in searches related to the products we're covered. Today I often can't find new articles from that website even when I use the exact title as the query. The website is minimalist, fast and has no ads. The articles are extensive and well-conceived. And yet they are buried several pages deep under piles of single-paragraph stub "reviews" on more popular resources.
I assume the same thing happened/happens to a lot, maybe most small-scale content creators these days. Clickbait rules and content doesn't matter nearly as much as the number of incoming links. You can no longer rely on search engines to get you traffic and need to constantly self-promote on other websites (e.g. social networks).
Also, running old games in DOS Box is often a finicky process that requires some tinkering for every game. That's one of the reasons GOG.com took off so rapidly. People are gladly paying several bucks to save themselves the trouble of messing with configs and reading forums about game's quirks.
This isn't a huge deterrent in case of games, but it will be a huge deterrent for retro-browsing, because the whole point to the Web is its interconnectedness. Plus, there are many more websites than there are games.
http://quickenloans.github.io/Behaviors.js/
The code will look extremely non-idiomatic to most frontend engineers. Treat it as a thought experiment (which it is). The important thing isn't the particular implementation, but the ideas I outlined above. There are other, often simpler, ways to implement the same concepts.
One property of these libraries that might not be immediately obvious is that they "automatically" adapt to changes on the page. So you can add an element with a behavior via AJAX or dev tools and it will actually work. This is why using timers and global events is a part of that list.
Another thing is that none of these libraries have an API or modify the global JS namespace. This is part of the thought experiment not directly related to the main concepts. It drives some of the complexity.
Edit: Fixed the link.
It's not a framework or a library, but rather a set of rules and practices of how to do things. It will sounds somewhat weird, but I'll list them anyway. Maybe someone will find it useful:
- Overall mental model: libraries don't implement components, but rather change the behavior of certain elements on the page.
- No library keeps state in JavaScript variables. DOM is your model.
- All configuration is also done through DOM with liberal use of CSS selectors to reference things.
- No library has any direct dependencies on any other.
- Things that need to react to changes should (if at all possible) use timers. If that's not possible, they should register global event handlers, rather than attach them to individual components.
While this might horrify some people, it actually forced me to come up with rather nice, abstract behaviors that capture many common features I had to commonly implement. Also, this plays well with the notion of progressive enhancement. I recommend everyone to try it on some new web-based project of low to moderate complexity. Ir really does simplify a lot things.
If the website is simple, you could use iframes for headers and footers.
Curious. This goes completely against the sentiment in all of the discussions around modern SPA frameworks and JS libraries I've seen on this very website. It seems that for most fronted devs today JS is a natural prerequisite for using their product. Progressive enhancement is often sneered at[1] as impractical and unnecessary. This leads me to believe that there are two mostly disjoint groups of people commenting on this issue in different threads.
---
[1] - Good example: https://www.viget.com/articles/the-case-against-progressive-...
> This is a fallacy, AlphaGo didn't increase very much with additional hardware at all
It did. Please take a look at the page 36 of the original paper. (https://gogameguru.com/i/2016/03/deepmind-mastering-go.pdf) The performance did not grow linearly, but the increases were vert significant.
>it's elo would still have been higher than lee se-dol's elo
I seriously doubt it would win that match. One-GPU version lost to 8-GPU version around 95% of all games.
The paper is somewhat misleading in estimating relative performance of AlphaGo compared to older programs, because (as far as I know) while all of them were run on the same hardware, only AlphaGo used GPU acceleration.
This is a poor example. There are Go programs that work very well and use exclusively MCTS without any neural networks.
There are two types of explainability. One is explaining why the system converges on correct solutions in general. Another is explaining why a particular decision was made the way it was made. Human intelligence is usually very much explainable in the second sense. This is not always true, but such cases are called "intuition" and we tends not to trust such judgements for mission-critical tasks.
Which, BTW, makes them more appealing to me personally. In many real-life cases extra few percent of accuracy matters very little, but ability to just apply something to a problem without much fuss matters a lot.
- HTML for pure information - Something else (template/view?) for layout and (possibly) forms - CSS for styling in terms of fonts, colors, etc.
This would easily handle layouts, but it would also have some NLS-like capabilities where you could switch from one way of presenting information to another without changing the actual docment.
This kind of stuff is why I am an advocate of progressive enhancement. It's not about whether someone has JS disabled or not. It's about using HTML as a semantic representation of information rather than a mere rendering layer. The second option might seem more convenient at times, but the first one opens a lot more doors for innovation in the long run.
>But if I try to revisit this later, it’s impossible. I can remember what I found, but it wasn’t a linear progression, therefore my browser history is useless.
If I want to find a page I visited more than three days ago, seeing a tree of history is not going to help me much more than seeing a linear list. There is just way too much information to sift through manually.
The obvious solution is to add full-text indexing by page content. And maybe even store pages for offline use. Perhaps when you enter special browsing mode akin to "private browsing" (although it would be the exact opposite, since it would retain more information).
I am aware of the complex issues this would require to solve, but those capabilities would qualitatively transform browsing and give users back some modicum of control over their page navigation. These days Google is our history. We remember a few keywords and instead of sifting through a giant list of URLs we simply search. Again, sifting through giant tree is not going to be any simpler. In fact, in terms of visual identification it might be more difficult than skimming a list.
...
Some simple machine learning algorithm that learns to bookmark and auto-tag pages would be an awesome feature/experiment as well.
...
And filtering open tabs by a keyword. Many people use tabs as a sort of dynamic set of bookmakers. Partly because they (sort of) preserve page content locally.
Also, it doesn't cover all the cases properly, because the page with versioned URLs can be cached as well.