# Object Oriented Code in the Gnus Newsreader
Eric Abrahamsen
[[!template id=vid src="https://mirror.csclub.uwaterloo.ca/emacsconf/2020/emacsconf-2020--32-object-oriented-code-in-the-gnus-newsreader--eric-abrahamsen.webm"]]
[Download .webm video, 720p, 285M](https://mirror.csclub.uwaterloo.ca/emacsconf/2020/emacsconf-2020--32-object-oriented-code-in-the-gnus-newsreader--eric-abrahamsen.webm)
The venerable Gnus newsreader has evolved over the years to interface
with many different types of news- or mail-like backend programs,
presenting all of them using a unified interface. This sort of
software often calls for an object-oriented architecture, at least as
regards polymorphism, yet Gnus was written well before Emacs lisp
acquired the object-oriented tools and libraries – largely borrowed
from Common Lisp – that it boasts today.
Yet Gnus needed something "object-oriented-like", and so nnoo.el was
born: a rather amazing (and frankly terrifying) implementation of
object-oriented behavior using functional code.
This talk will be a brief introduction to how this existing system
works, and to the ongoing, incremental effort to port it over to newer
Elisp tools like generic functions, structs, and objects.
<!-- from the pad --->
# Questions
## Q3: Have you done any other projects using EIEIO and/or defstruct?
Right, EBDB is super deep into EIEIO, and was kind of written as a
project for learning it, and the new gnus-search library is a more
restrained usage. The search engines are defclasses, and much of the
code is shared, which works quite well.
## Q2: Is there may activity on maintenance of Gnus today? (and is Lars involved/aware of this work?)
Yes, there's still development going on. I don't think Lars is very
focused on Gnus right now, but I run all changes by him first. He
fixes bugs, but as far as I know, I'm the only one adding features
right now, which is a terrifying thought.
## Q1: How much of this 90's funny code :) can be replaced and how much will have to stay forever?
Eventually I think we can get most of it out of there. I was happy to
be able to replace obarrays-as-hashtables with real hashtables, though
that was a very painful process
# Notes
Famous last words: "Sometimes the only thing that's worse than not
knowing why something doesn't work is not knowing why it does work."