Skip to content

Code decomposition question #882

Closed
Closed

Description

@DiskJunky

I've been looking through some of the csharp versions and some lump all the code into a single Program.cs file. While this works, and indeed, is how the originals are organized, it doesn't quite fit the "modern practices" principle for the language.

I'm a little conflicted as to which is the 'best' approach for this project. Would anyone object to having separate files for each class, etc.?

Activity

  1. coding-horror commented on Aug 8, 2023

    @coding-horror
    Owner

    The idea is that most of these were simple single file programs to start with, so breaking them apart, unless it's only 2 files instead of 1, seems to run counter to the original philosphy behind the books.

  2. pgruderman commented on Aug 26, 2023

    @pgruderman
    Contributor

    I really disagree strongly with this point. The programs in the book were written the way they were due to the constraints of the time, not some overriding philosophy. And in many cases, they were written by amateurs and weren't even quality examples of BASIC programs.

    There are so very many resources on the internet to learn the basics of programming. I just can't imagine someone coming here to learn how to write for loops and function calls. If we aren't teaching something useful--something people can actually take away and use in their own projects or at their jobs--then what's the point?

  3. coding-horror commented on Aug 26, 2023

    @coding-horror
    Owner

    You can, just keep it as minimal as possible. E.g. don't create a super complex Enterprise Edition implementation that's overengineered. Whatever feels appropriate to the size and scope of these tiny programs.. keep it simple, but certainly, keep it clean too!

  4. DiskJunky commented on Aug 26, 2023

    @DiskJunky
    Author

    That was kind of what I was driving at. Standard practices of the language without decomposing the code to within an inch of its life. There's a sweet spot to be aimed for, say 3-4 classes/files, not 20-30.

    As a side note, I tip my hat to @pgruderman who didn't split his infinitive in his opening sentence :)

  5. coding-horror commented on Sep 18, 2025

    @coding-horror
    Owner

    I think the guidance is reasonable here.. as simple as it can be to reflect the simplicity of this earlier era of computing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions