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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:56:22+00:00 2026-05-13T14:56:22+00:00

I was once in charged of creating a C# custom user control. It’s a

  • 0

I was once in charged of creating a C# custom user control. It’s a control with a bunch of collapsible sections. The control that user could click on it to toggle between collapse/expand state is a label control. There’s an image control right beside it that would change state to indicate whether the particular section is collapsed or expanded. Somewhere in the control, I need a function to return the state of any particular section. The question is, should the function return the state based on the image control’s state, or should we introduced an additional variable that would store the state, with the additional risk of it being out-of-sync with the current state?

  • 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-13T14:56:22+00:00Added an answer on May 13, 2026 at 2:56 pm

    Most of the time, when people go with a “pure” solution to problems like these, they’re just hiding coupling, not removing it. The coupling usually represents the essential complexity of the problem they’re trying to solve. Since it can’t be removed, it may as well be implemented in a straightforward way.

    Your case is no exception. Unless you think that there’s a decent chance that the getter for the image control’s state will change in the future (not likely if you’re using a stable framework), using an additional variable that’s always supposed to have the same value as the image controller’s state just replaces explicit coupling with slightly hidden, implicit coupling. This gains you nothing and increases complexity and therefore bug potential.

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

Sidebar

Related Questions

Once I created a form builder where user could select any number of fields
I have a form for that a user fills out and submits. Once submitted
Once a user has selected a file with the open file dialog, how can
I'm creating a sitemap and my problem is that all & in links gets
I am creating a custom UITableViewCell to include an UIImageView and some related text.
In the past years I have been working on different projects that required creating
Lets say you have website that keeps balance for each user. You give each
I am creating a custom combobox which can draw separators. So, I override OnDrawItem()
I'm creating an iPhone app that will pull data down from a Web API,
I have a Gui which allows the user to click a button and view

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.