Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6902273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:46:40+00:00 2026-05-27T07:46:40+00:00

I inherited some source code that I am just starting to dig though, and

  • 0

I inherited some source code that I am just starting to dig though, and i found the previous owner has made some use of the using directive as an alias for a List<T>, but I’ve never seen this specific approach before.

namespace MyNamespace
{
    using pType1 = List<type1>;
    using pType2 = List<List<type1>>;

     // classes here
}

Both of these elements are used quite heavily within the code and are also return types from several of the key methods within the code. I get what he was trying to accomplish with using a simple name rather than repeating List<type1> and List<List<type1>> over and over again. I’m debating whether to create a real type to replace the using statements, but before i spend the time, I was wondering if there were any pros/cons to keeping the current implementation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:46:41+00:00Added an answer on May 27, 2026 at 7:46 am

    Generally, if a data structure represents some entity in your application’s domain model it should get its own type; it makes the code much clearer and understandable. On the other hand, if you just need a List<List<string>> for intermediate data processing there’s no real benefit in making a proper type for that.

    In your case, since the original dev went to the trouble of making an alias for the type it’s logical that it would be used a lot, which points to the “represents an entity” scenario. If so, definitely go ahead and create a new type for the structure (possibly something more appropriate than bare lists and usually something defined in terms of interfaces rather than concrete classes, but that depends on what you ‘re actually modelling there).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking on some source code I've inherited, there's a snippet of code that calls
I've inherited some code on a system that I didn't setup, and I'm running
I've inherited some windows-mobile code that I've been bringing up-to-date. I've come across a
I have inherited some code which involves a scheduled task that writes data (obtained
I've inherited some iOS code which opens a source PDF and creates a CGContextRef
I am trying to write a program to check that some C source code
Ive inherited some code which started out as an Android project but really is
I have inherited some legacy PHP code what was written back when it was
I have inherited some HTML code and have been asked to align the two
I have inherited some code: Process p = new ProcessBuilder(/bin/chmod, 777, path).start(); p.waitFor(); Basically,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.