DEV Community

Ben Halpern Subscriber for The DEV Team

Posted on • Edited on

Feedback on this new DEV feature?

🚨 Polls are not a functional feature on DEV/Forem. This post purely represents a proof of concept.


Here is a thread I made earlier today:

And before getting into what I've been up to this weekend:

My other answer:

I've been using this weekend to ship some ideas which haven't found their way into the weekday priority bin for me or the rest of the team. Low pressure time to hack on anything I want is my favorite part of the job.

One such feature I just pushed and would love some feedback on:

Polls!

Are polls a good idea for DEV?

Before you get too excited, this feature currently only works for admins, and even for admins, you can't actually create a poll outside of the console.

I'm a stickler for maintaining usefulness and accuracy with polls and surveys, even if these aren't necessarily for scientific use. As such, I think we'll want to collectively come up with good rules around whether articles that contain polls are allowed to be edited after they are published (probably not, right?) and things like that.

We will also want to come up with a good interface for including polls in posts. Two approaches come to mind.

First create the poll in separate UI and then drop in to a post like this:

{% poll e41 %}
Enter fullscreen mode Exit fullscreen mode

Define the poll entirely inline:

{% poll %}
How do you pronounce dev.to?
- dev dot tee oh
- dev dot too
- dev dot toe
- dev toodilydoo
- dev too
{% endpoll %}
Enter fullscreen mode Exit fullscreen mode

How should polls be created?

The poll functionality should be extensible for creation of surveys and other neat things. I think it could be fun and very useful for the industry if we get this right. I also think it would be cool if we created some aggregate data analysis of polling trends as folks use the feature which could be anonymized and released for analysis. It could be a fluid way to help people make better choices about the software they build. Before doing that we'd want to be very clear about how the data would be used and offer simple opt-out options for having your votes included in this kind of aggregation.

I'm not sure when this will ship for general use, but feel free to hop into our repo and improve on anything here. Since this was mostly a weekends feature I'm releasing it as a bit of a surprise, so the rest of the DEV team may be finding out about it via this post. πŸ˜„

Polls currently accept up to 15 options and allow for use of some inline markdown tags like the code element. Option count is pretty arbitrary but maybe we can hammer out all the little details while it is in closed beta. Multi-option polls also seem like a good idea. I left the schema flexible enough to build towards that idea but did not implement it in this push.

Here is a poll that could have been included in the above-mentioned thread about coding on the weekend:

How often do you code on the weekend?

P.S.

Speaking of new things... If you check out the "three dots" menu in the post "reactions" area, you can see new notification settings which allow you to subscribe to comment threads. This will be useful for keeping up to date with interesting discussions, AMAs, etc. depending on the post.

We think folks will find a lot of value in that usage pattern. We want to ship some additional tooling for providing more context within the notification page before we make a big announcement/push about this feature. But as long as you're reading this little weekend announcement I felt like I'd let you in on that as well.

If you follow along in the repo, you might have already known about all of this stuff already.

Happy coding!

Oldest comments (41)

Collapse
 
mazentouati profile image
Mazen Touati

Sounds interesting, Good job Ben. However, it would be great if you implement an error prevention mechanism like giving a chance for the user to undo his choice in a defined interval. I accidentally cast my first vote by clicking out of curiosity.

Collapse
 
ben profile image
Ben Halpern The DEV Team

This makes sense. It probably shouldn't be possible, though, to change your vote once you've seen results. Twitter allows you to click a button and then click submit which limits the surface area for misclicks. That is probably the expected behavior.

I found getting things just right to be outside of the scope of my weekend hack. I hope others will jump in and improve on this whole feature. πŸ˜„

Collapse
 
mazentouati profile image
Mazen Touati

Indeed, Twitter's model may be convenient.

Collapse
 
andrewbrooks profile image
Andrew Brooks πŸ‘¨β€πŸ’»

Another idea maybe is a quick countdown splash with an undo button for like 5 seconds that then changes to the results if undo is not clicked.πŸ€”

Collapse
 
nicolus profile image
Nicolus

Twitter allows you to click a button and then click submit which limits the surface area for misclicks. That is probably the expected behavior.

In any case, the expected behavior of a Radio Button is never to do something irreversible.

If you want to save one click you could probably replace those with a "vote" button or something, then people would understand that clicking would cast their vote.

But radio buttons ? The whole point of a radio button (as anyone who spent time playing with their dad's old stereo as a kid would know) is to play with them and see them pop out when you press another button. If you cast my vote when I press one you completely remove my ability to play with them and enjoy them.

So yeah, a "submit" button would probably be better, especially since it would allow you to have multiple answer polls down the line without rethinking the UI.

Thread Thread
 
ben profile image
Ben Halpern The DEV Team

Yeah, this is valuable feedback.

Collapse
 
pablomayobre profile image
Pablo Ariel Mayobre

Sometimes it doesn't really make a difference, so it could be optional, and the creator of the poll chooses if the vote can be changed or not

Collapse
 
andrewbrooks profile image
Andrew Brooks πŸ‘¨β€πŸ’» • Edited

Love the idea of polls. Small thing I noticed is when tapping a poll response on mobile in dark mode the response selected highlight renders the inner text invisible. Nice weekend feature!

Collapse
 
ben profile image
Ben Halpern The DEV Team

Yeah I saw that too. Did a bad job of accounting for all states in all contexts before pushing. We’ll get that sorted out.

Collapse
 
pulljosh profile image
Josh Pullen

I love this idea!

One fear I have is that polls could result in less discussion happening in the comments. A user who wants to contribute their opinion and who previously might have written an in-depth comment could instead choose to vote and nothing more. This isn't always bad, but it might result in less nuanced conversations.

I'm not sure what the right solution is to this problem. Even without any changes, though, polls definitely seem like a net win for the platform. πŸ‘

Collapse
 
ben profile image
Ben Halpern The DEV Team

Could be neat maybe to have a post-voting prompt to ask users to elaborate on their choice in the comments?

I bet that would work well and be a fun little nudge.

Collapse
 
pulljosh profile image
Josh Pullen

I love that!

Collapse
 
cubiclebuddha profile image
Cubicle Buddha

Yes anything to incentivize conversation. That’s the best part of dev.to! :)

Thread Thread
 
ben profile image
Ben Halpern The DEV Team

πŸ™Œ

Collapse
 
juliansoto profile image
Julian Soto

It think that if you want the users to discuss in comment section, don't post a poll then.

Collapse
 
andypiper profile image
Andy Piper

Yes, this is exactly my thinking and feeling as well. For me, one of the huge attractions of DEV has been the active conversation generated by even the thoughts and questions posted. Polls could lead to more folks using a simple click to engage, and moving on. Interested to see how this might pan out, though!

Collapse
 
cookrdan profile image
Dan

I’ve been meaning to ask about polls. I thought that be a great feature. Thanks for working on it!

Collapse
 
ben profile image
Ben Halpern The DEV Team

Woohoo!

Collapse
 
itsasine profile image
ItsASine (Kayla)

The poll results are grey on grey in dark mode, for what it's worth.

I would have thought step one would have been embedding Google forms or some other poll service and then rolling your own, but you do you :P

I prefer the inline way to make it clearer what will be in the finished article, though what would happen to results if I add an option later or completely edit the existing options like:

{% poll %}
Do you like kittens?
- Yes
- Also yes
{% endpoll %}

edited to

{% poll %}
Who is the best ruler ever?
- Pol Pot
- Hitler
- Other
{% endpoll %}
Collapse
 
ben profile image
Ben Halpern The DEV Team

I'll get the dark mode color issues fixed in a next push.

And yeah, I think once a post with a poll is saved, it should not be possible to edit it.

From an implementation details perspective, the poll would be committed as a record in the database upon publication and not before that, and once published the whole post would not be editable (with a big message warning of this fact). This would help keep both the poll consistent but also ensure the context around the poll doesn't change. So you couldn't this scenario where:

Kittens are great.

{% poll %}
Do you agree?
- Yes
- No
{% endpoll %}

Becomes:

Drowning kittens is great.

{% poll %}
Do you agree?
- Yes
- No
{% endpoll %}

(Sorry for the disturbing visual)

Collapse
 
itsasine profile image
ItsASine (Kayla)

Poor kittens 😿

Sounds like the feature's thought out πŸ‘ Looks like a solid idea :)

Thread Thread
 
ben profile image
Ben Halpern The DEV Team

No kittens were harmed in the making of this feature

Collapse
 
maheshkale profile image
Mahesh K

Loved it! I wonder if we can get option to skin the poll box. Like values for background color of poll and also result section?

Collapse
 
felipperegazio profile image
Felippe Regazio

Nice! Another approach could be: the post card at the timeline has/is the poll, and the post content has/is the text and discussion about it.

Collapse
 
thomasbnt profile image
Thomas Bnt

woaah greaaat!

Collapse
 
juliansoto profile image
Julian Soto

I'd prefer to write polls in like a markdown format to keep it simple and consistent.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.