Feedback on this new DEV feature?

Ben Halpern on June 15, 2019

Here is a thread I made earlier today: Do you code on the weekend? How often, whatโ€™s your routine... [Read Full]
markdown guide

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.


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. ๐Ÿ˜„


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.


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


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.๐Ÿค”


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. ๐Ÿ‘


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.


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!


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


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 %}

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 %}


Drowning kittens is great.

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

(Sorry for the disturbing visual)


Poor kittens ๐Ÿ˜ฟ

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

No kittens were harmed in the making of this feature


I probably wouldn't use a poll if it meant that the article couldn't be edited.

I'm always going back to make minor revisions (e.g. commas, fixing code typos, adding things people mentioned in the comments and tagging them).


I wondered about that too, though I do see why Ben is concerned with editing after a poll is published.

It looks like a couple of people have suggested allowing editing and letting users see post revisions to compensate for this concern. That would definitely promote good behavior.


That sounds like a perfect solution. I would feel more comfortable editing my articles if readers could see the history ๐Ÿ‘


whether articles that contain polls are allowed to be edited after they are published (probably not, right?)

Edited article is a different problem on its own, IMO. Whether or not they contain polls, allowing users to edit articles is tricky. I saw your example with kittens poll down below, but IMO that could be applied to any articles, say, well-received article with dozens of likes about users' pets then the author edited the article's title and description to, "List of animals that poop too much". I'm not saying anyone did/would do this, but it is possible.

If I may, shouldn't disallow users to edit articles with polls as much as always allowing users to edit articles on any circumstances. That would make it consistent. What could be improved, though, is telling users that an article has been edited.

Discourse has the entire history of the post changes recorded for the readers to compare versions, which IMO what is lacking in most of the content creating platform. Probably it's there because us devs (at least me) love this style of version comparison. (example, click the pencil icon next to the date Nov '18). And I think we all know other platforms that did this as well: Wikipedia, Google Docs, to name a few.

Sorry for going on a tangent like this, it's always something that bugs me too much, even giants like Medium isn't doing it well IMO. I'm not sure if it's already in the roadmap or if it's going to be implemented, just my two cents. I can also foresee that some people would see this as a nice-to-have, which I'm fine with that.

As for the polls, yes, it looks great. But it's true what others mentioned that polls could 'kill' the conversation, because typically polls can simply stand on its own. People might be discussing more on the results rather than the poll itself. But, as an add-on to what is already a great content creating platform, why not?


This is all really valuable feedback. We've had the idea of displaying past changes to a post as something we'd want to add in general. This could let us implement that feature with polls in mind as a use-case.

Definitely will add a feature to prompt conversation post-vote. I think this can be dealt with through design choices and we'll see if we can split test to make sure we're having a good impact here.


You can do what Stackoverflow does: They have a grace period of 5 minutes where you can edit your post and it will not show in revision history (which is great for fixing typos and stuff like that), but any edit after that period is visible to anyone that clicks the "edited" link.


Polls are fine, so long as those using and reading them understand that these are not scientific and only get a vague sense of how the community feels.

Highly unlikely that any article will get a sufficiently random sample though. But again, it's fine so long as they're not treated as scientific.


I think polls would be better as surveys with more questions.

Other platforms have polls and people tend to either just use them for fun or use them to get unhelpful stats.

"Do you use Photoshop Yes/No" isn't helpful unless you know the demographic, so having other questions like "are you a graphic designer" in the mix would be really cool. You could either do this as a single object or by linking all the polls in a single post as if they were related.
We could pull out some really nice stats and a little graph or something. That would be such a cute feature compared to, say, Twitter surveys.


Yep, had similar thought in mind. Iโ€™m thinking that this functionality could sort of be like a progressive enhancement on top of the basic poll functionality.


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!


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.


I love this! โค๏ธ
I understand to keep it for admins only for now but hope to see it available for everyone soon.

If I knew that DEV was already working/planning on something like this I wouldn't have made my blog post a couple weeks ago ๐Ÿ˜‰


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


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?


What if I want to see the results and only then cast my vote? That's usually a valid option in most online polls I've seen...


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


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.


As a Content Creator

I like how I've seen in Facebook posts where you can leverage reactions to be the voting mechanism.

I think if I wanted a poll, I would create two comments in my post and then direct people to heart the one to cast their vote. This is how I would work within the limitations of the current system if I wanted polling functionality.

I think I would much rather have a liquid tag to support a third party polling system that an integrated polling system in Which third-party polling service? Uncertain.

As a Developer

The codebase is unwieldy and putting on my Solutions Architect hat I would hope this polling feature would be an isolate micro-application powered by lambdas (serverless functions) and the dat store elsewhere (DynamoDB) than part of the Rails codebase and schema.

The serverless functions could still sit within the repo just not as a Rails application.

When I saw the launch of listings, I thought, this too would benefit by being its own isolate application. I have yet to check if its part of the single Rails codebase or is isolated.

I hope to see improvements over the core-functionality over new features and wish I had more time to work on these on boring tickets.


Feedback super welcome as always Andrew.

As it currently stands, we're definitely a team shaped to implement the majestic monolith approach, but as we evolve it's certainly a possibility that we would break things up into services where appropriate.

This feature could have been done that way but I think we're about a year away from being able to adjust our overall architecture approaches (if I were to guess).

As a company that has to keep taking some chances and maintaining momentum on new features as well as ironing out existing functionality, we have to take educated guesses and hope to be right on average most of the time.

We're at a place where our state of "core functionality ironed out and bug-free" status is better than ever, and we will have to maintain balance as we land on new plateaus in our evolution.

You definitely bring a lot of good insight when you dip into the code with opinionsโ€”and it's sometimes tough to balance "finding the right approach" with "settling on the practical approach in the moment". Your ongoing feedback and contribution is definitely welcome.

code of conduct - report abuse