News for hackers. Stuff that matters.
Re:CHVote: Open-source e-voting system from Switzerland by toppy on Wednesday December 14, 2016 @10:39AM (#13176746)
Without a single unit test how can this piece of software be called "system"?
Re:CHVote: Open-source e-voting system from Switzerland by VMG on Wednesday December 14, 2016 @10:45AM (#13176791)
Re:CHVote: Open-source e-voting system from Switzerland by SanFranManDan on Wednesday December 14, 2016 @12:38PM (#13177889)
How they use the singleton is strange also.

https://github.com/vvk-ehk/evalimine/blob/master/ivote-serve...

> Election().count_questions()

> Election().is_hes()

> for el in Election().get_questions()

> Election().is_voters_list_disabled()

Election is a singleton so they keep reinstantiating it every time they want to use it instead of just doing

> election = Election()

at the module level and having a more idiomatic singleton (module variable are singletons). But a singleton design probably isn't the best approach.

The singleton example isn't that bad of code since it assumes that one server will run one election which is a valid assumption, but reading through this code makes me weary about e-voting. I think this proves that OpenSource doesn't always mean good code. There is little incentive for people outside of Estonia to contribute to the project.

Re:CHVote: Open-source e-voting system from Switzerland by jessaustin on Wednesday December 14, 2016 @11:49AM (#13177379)
Haha; this seems pretty dumb:

  if __name__ == '__main__':
      pass
Re:CHVote: Open-source e-voting system from Switzerland by trymas on Wednesday December 14, 2016 @11:15PM (#13182350)
Estonians use a 'black box principle'.

They have some voting system - a black box - and they believe it works and no one has hacked it.