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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:01:48+00:00 2026-06-06T06:01:48+00:00

I’m reading Petzold’s free (.PDF) WP7 book, and he says that he always changes

  • 0

I’m reading Petzold’s free (.PDF) WP7 book, and he says that he always changes “EventArgs e” to “EventArgs args” in event handlers (which makes sense to me, as “e” sometimes conflicts with what I want to name the Exception object); but he also says he removes the accessibility modifiers that are automatically prepended sometimes.

I’m wondering why he does so, and:

1) Should I adopt the same practice
2) If that's a better way (Petzold is no wet-behind-the-ears greenhorn), why doesn't MS create these methods that way by default?
  • 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-06-06T06:01:49+00:00Added an answer on June 6, 2026 at 6:01 am

    (I’m assuming this is a matter of removing the private access modifier from a method. If it’s removing (say) public then that’s a semantic change, and a different matter.)

    It’s definitely a matter of personal preference. I used to favour removing the access modifier when it was the default, but these days I prefer to be explicit.

    Benefits of leaving it implicit:

    • Less clutter (important when writing books, which may well be relevant here)
    • As the default is always “the most private you can express explicitly” it makes it more obvious which members have been “promoted” to have wider access

    Benefits of making it explicit:

    • Readers who don’t know the language as thoroughly are left in no doubt
    • It introduces one more mental reminder that you need to actively think about this. (I’m sure people often leave things in a default way without further thought otherwise – I see relatively few virtual methods in C# compared with Java, just because of the defaults.)
    • Assuming you follow mental reminders, it shows the reader that this was a deliberate decision.

    If you want an “appeal to authority” you may be interested to know that Miguel de Icaza favours (vehemently) the former approach, and Eric Lippert favours the latter.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I know there's a lot of other questions out there that deal with this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

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.