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 985385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:09:20+00:00 2026-05-16T05:09:20+00:00

For a program I’m making I’m using object to hold the value of HTML

  • 0

For a program I’m making I’m using object to hold the value of HTML attributes. There’s a bunch if things I do with these values in the whole program. So I would basically like to create an alias for object whenever is used to hold values of HTML attributes to something like AttrValue just to make the program more clear, and to be able to easily add functionality if needed. These objects are used on critical-performance parts of the program, so I’m not sure if making a class instead of a struct would be the best idea. What would it be the best solution here, if performance is the main concern (more than clearness actually)?

  • 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-16T05:09:21+00:00Added an answer on May 16, 2026 at 5:09 am

    You can create a type alias like using AttrValue = System.Object;. However, this alias will only exist in your source code. There’s nothing stopping you from using, say, object or string where you need an AttrValue. You won’t be able to add properties or methods onto your AttrValue alias: it will be an alias for object and not a class in its own right.

    You’re probably better off introducing AttrValue as a class in its own right, presumably as a wrapper for a value of type object. It might have a single field (of type object), and a constructor that takes one object parameter.

    Regarding struct vs. class, I wouldn’t worry about this. You almost never need a struct in .NET code: the garbage collector is capable of handling lots of small class instances without noticeable overhead, and structs have their own oddities (mainly because what looks like the same instance in source code can easily end up being two separate copies at run time).

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

Sidebar

Related Questions

Program that calculates and shows the value of (2 to the 10th power) This
Program I'm making has a simple configuration file looking something like this. @overlays =
Program : List all C files in the current folder using execlp() system call:
/*Program to merge to arrays using pointers in descending order, when the first array
class Program { static object test = new object(); static void Main(string[] args) {
program to output all 4 digit numbers where no prior digit is greater than
Program returns an error of, expected PWideChar instead of string procedure TForm1.Button1Click(Sender: TObject); var
Program runs once and it both throws data to the pipe and gets it
This program builds a dictionary out of a list based on what two index
My program is showing it is a leap year for every output. Please let

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.