News for hackers. Stuff that matters.
Re:Build Your Own React by leetrout on Thursday November 14, 2019 @12:12PM (#21537147)
Very, very nice.

His presentation library is available as well!

https://codesurfer.pomb.us/

https://github.com/pomber/code-surfer/blob/code-surfer-v2/re...

Re:Build Your Own React by jermaustin1 on Thursday November 14, 2019 @01:54PM (#21538197)
I love this effect, I was actually just writing a blog post that I didn't save before my tab crashed. I'm actually now GLAD it didn't!

This is a lot more effective a medium for the content!

I even went ahead an set up a monthly donation to their open collective project [1] because it is so beautiful.

1: https://opencollective.com/code-surfer

Re:Build Your Own React by pomber on Thursday November 14, 2019 @03:58PM (#21539328)
hey, thanks a lot for the donation!
Re:Build Your Own React by jermaustin1 on Thursday November 14, 2019 @04:03PM (#21539382)
No problem, the tutorial was great and the code-surfer package looks great. Keep up the good work!
Re:Build Your Own React by spectramax on Thursday November 14, 2019 @10:07PM (#21541908)
Please don't perpetuate this type of animated presentation style. Why?

1) Vertical layout is easier to scroll

2) Vertical layout puts the code blocks in-line to know where they belong in the text

3) Author's presentation style has animations that slow down user's ability to scan quickly

4) Scroll position determines the code block's visibility (!!! WTF)

5) Either have the entire page white or black. The contrast changes between reading the document and then reading the code tires the user

6) Scroll wheel feels highjacked because the left pane is static

I could go on and on. I strongly discourage people from using this type of documentation. Your users, will get tired of the novelty and when push comes to shove, they will want something like this:

https://golang.org/pkg/

Re:Build Your Own React by chvid on Friday November 15, 2019 @04:21AM (#21543487)
Boo - this is clearly excellent work by someone with both engineering and design skills. If no-one pushes the envelope then what a sad and boring world we would end up in.
Re:Build Your Own React by jsf01 on Friday November 15, 2019 @01:44PM (#21547496)
It’s the best presentation for this style of content that I’ve ever seen. Having a description of what’s going on with a particular code block, plus highlighting the relevant parts, and moving that highlight or swapping out specific parts of it as I go through the content made it much faster for me to grasp what was important and what changed between blocks than would have been the case if the author used traditional static sections of code. This isn’t documentation, it’s a follow-along tutorial, and for that purpose this presentation style is 100% appropriate.
Re:Build Your Own React by taude on Thursday November 14, 2019 @10:57PM (#21542089)
I think static documentation (your link) is a different use case than an interactive tutorial (not documentation). I didn't find the presentation horrible, but it's likely just looking nice and perfect on my computer hooked up to big monitors, and not on a phone or something....
Re:Build Your Own React by spectramax on Friday November 15, 2019 @12:09AM (#21542350)
I think everyone is saying that but presentation or documentation is essentially presenting sequential information to the user, whether it is a word document, a slide deck or a scrolling html page.

Also, there is nothing interactive about it - I can't change code on the left side, nor can I do anything with the right side. It is just scrolling, I guess you can call that "interaction".

Re:Build Your Own React by xmprt on Friday November 15, 2019 @02:19AM (#21542950)
You're dismissing scrolling as if it doesn't do anything but when I scroll I can see the code at a point in time as opposed to a point in space.
Re:Build Your Own React by spectramax on Friday November 15, 2019 @02:45AM (#21543055)
That’s precisely the problem - if both sides were moving together, in time it would be a slide deck, in space it would be a scrolling document. Here, we have the left and right side, changing in time and space, respectively, and burdening the user with cognitive dissonance.
Re:Build Your Own React by Silhouette on Friday November 15, 2019 @02:57AM (#21543104)
if both sides were moving together, in time it would be a slide deck, in space it would be a scrolling document

There is a fundamental difference between reference material, where only the final version is relevant, and tutorial material, where the evolution is also important. You keep making similar comments in this discussion where you compare this tutorial/exposition format to typical reference documentation, but they're solving different problems and reasonable assumptions in one case don't necessarily hold in the other.

In particular, presenting this sort of tutorial/exposition material as you suggest could make the document much longer, but worse, the reader would have to keep looking at almost the same code snippet and figuring out what changed at each step instead of having it demonstrated by the animation effect. That is a significant mental overhead, and it's a recurring pain point when teaching programming subjects that can be remedied by using something that actively shows the progression. I've used similar techniques where some example code evolves with simple animations in both presentations and private documentation, and it generally seems to be effective at communicating the intended ideas and well received by the target audience.

Re:Build Your Own React by ath92 on Friday November 15, 2019 @07:14AM (#21544196)
Exactly. This presentation style made it much easier for me to see what was being added to the code. I don't like having to continually scan different blocks of code to see what changed, and try to make sense of how the changes fit in the bigger picture.
Re:Build Your Own React by Silhouette on Friday November 15, 2019 @08:08AM (#21544437)
I don't like having to continually scan different blocks of code to see what changed, and try to make sense of how the changes fit in the bigger picture.

Indeed.

Visual diff tools were invented for a reason, and using a side-by-side layout with some sort of colour coding and some attempt to align equivalent code is now close to universal. No-one would suggest doing code reviews by printing out the last two versions of a source file and comparing them on paper any more.

In presenting tutorial material like this, IME the two most effective formats have been either something like that side-by-side diff, often with some extra annotations like chunky labelled arrows to highlight the specific areas or changes of interest, or something like the style here, with the changes at each step being highlighted and/or animated so it's easy to follow along. Both of these work for code but also other illustrations.

Re:Build Your Own React by gcj on Saturday November 23, 2019 @09:52PM (#21618043)
I do agree with you. I found it amazing to look at, but not very usable if you just wanna look at the code.
Re:Build Your Own React by mgalgs on Friday November 22, 2019 @12:59PM (#21608105)
documentation =/= presentation
Re:Build Your Own React by oraphalous on Friday November 15, 2019 @02:03AM (#21542884)
I love it...
Re:Build Your Own React by stockkid on Thursday November 14, 2019 @06:51PM (#21540880)
Yeah the presentation effect on code is super cool. Yet on mobile I didn't feel that it was particularly helpful as it covered about half the screen height and I couldn't clearly skim the content.
Re:Build Your Own React by agumonkey on Thursday November 14, 2019 @02:10PM (#21538345)
This might even become standard for most documentations.
Re:Build Your Own React by piotrkubisa on Thursday November 14, 2019 @03:12PM (#21538925)
> This might even become standard for most documentations.

I hope not, because slow, meaningless animation makes me tired and something inside me wants escape that page. Also it affects scrolling, especially noticeable when I am scanning a text instead of reading - you might lose context (note how the presentation reacts on pressing "page-up" / "page-down"). Kindle and all e-reader hates animations[0][1] - any animations (they are just huge black holes for battery). IMHO any documentation SHOULD be able to printed out on paper and sorry - paper is not interactive.

However, I will warmly welcome some interaction in dedicated docs section but it would be great if it could be duplicated as a rich-text article.

[0]: Not saying about the reader mode in browsers (e.g. Firefox)

[1]: Please think also about people that are disabled or use VoiceOver/NarratorMode to be more productive / are just lazy to read text using their eyes :)

Re:Build Your Own React by agumonkey on Thursday November 14, 2019 @04:48PM (#21539840)
No worries, i understand, but I felt it told the code History in a valuable way. I usually stay away from shiny presentation.
Re:Build Your Own React by regular_person on Thursday November 14, 2019 @04:21PM (#21539575)
I found it very slick and cool-looking but not really conducive to absorbing information.
Re:Build Your Own React by spectramax on Thursday November 14, 2019 @09:53PM (#21541850)
I couldn't disagree more. This is not what a documentation should be like.

Unnecessary animations, fixed scrolling, and just useless "snazzy" aspects of user interface has no place in code documentation.

I hope this does not become the standard.

Re:Build Your Own React by ckrailo on Sunday November 17, 2019 @02:45PM (#21559632)
It's a good thing the post is a teaching tool and not documentation!
Re:Build Your Own React by fishnchips on Friday November 15, 2019 @04:13AM (#21543449)
I don't think it would work well for documentation where you may only look for a very specific piece of information and maybe a little bit context. This style of presentation would, in my opinion, work best for tutorials where every new concept builds on top of previous ones, and context is king.
Re:Build Your Own React by ghego1 on Thursday November 14, 2019 @05:03PM (#21539964)
Is it just me or on mobile it does not render properly?
Re:Build Your Own React by palerdot on Friday November 15, 2019 @10:16AM (#21545463)
This is basically unusable in mobile ... but looks nice in desktop though ...