Click here to Skip to main content
15,892,298 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Firefox Pin
KarstenK15-Sep-16 23:32
mveKarstenK15-Sep-16 23:32 
GeneralRe: Firefox Pin
W Balboos, GHB16-Sep-16 1:06
W Balboos, GHB16-Sep-16 1:06 
GeneralRe: Firefox Pin
Rage16-Sep-16 1:11
professionalRage16-Sep-16 1:11 
GeneralRe: Firefox Pin
W Balboos, GHB16-Sep-16 1:15
W Balboos, GHB16-Sep-16 1:15 
GeneralRe: Firefox Pin
Rage16-Sep-16 1:30
professionalRage16-Sep-16 1:30 
GeneralRe: Firefox Pin
Richard Deeming16-Sep-16 3:21
mveRichard Deeming16-Sep-16 3:21 
GeneralRe: Firefox Pin
Rage16-Sep-16 3:50
professionalRage16-Sep-16 3:50 
GeneralLearning Custom Types in OOP/New Codebases Pin
TheOnlyRealTodd15-Sep-16 18:31
professionalTheOnlyRealTodd15-Sep-16 18:31 
I love C#. The only time I really struggle is when looking at a new codebase, with datatypes. So, for example, I'm now learning a lot of Identity/OAuth related stuff, and code which is actually quite simple, becomes harder for me to understand when I am not familiar with the data types used. See this example:

C#
public class ApplicationUserManager
   : UserManager<ApplicationUser, string>
   {
       public ApplicationUserManager(IUserStore<ApplicationUser, string> store)
           : base(store)
       {
       }

       public static ApplicationUserManager Create(
           IdentityFactoryOptions<ApplicationUserManager> options,
           IOwinContext context)
       {
           var manager = new ApplicationUserManager(
               new UserStore<ApplicationUser, ApplicationRole, string,
                   ApplicationUserLogin, ApplicationUserRole,
                   ApplicationUserClaim>(context.Get<ApplicationDbContext>()));

           // Configure validation logic for usernames
           manager.UserValidator = new UserValidator<ApplicationUser>(manager)
           {
               AllowOnlyAlphanumericUserNames = false,
               RequireUniqueEmail = true
           };

           // Configure validation logic for passwords
           manager.PasswordValidator = new PasswordValidator
           {
               RequiredLength = 6,
               RequireNonLetterOrDigit = true,
               RequireDigit = true,
               RequireLowercase = true,
               RequireUppercase = true,
           };
           var dataProtectionProvider = options.DataProtectionProvider;
           if (dataProtectionProvider != null)
           {
               manager.UserTokenProvider =
                   new DataProtectorTokenProvider<ApplicationUser>(
                       dataProtectionProvider.Create("ASP.NET Identity"));
           }
           return manager;
       }
   }


What this code is doing is actually very simple, and I get that. But, there are a lot of types thrown around that I'm not familiar with... And then when I learn this particular codebase, the same thing will happen with another when I'm new to it. This was just a small example, but for example with the standard value types like int, double, string, it would be much more straightforward.

That said, my current strategy is usually to just hit ALT+F12 in Visual Studio to take a peak at the code and just try to memorize it... But sometimes, for example, I'll implement something like this and then not even have to mess with it for a while (month or more), then start to forget it... Especially when it is code in a totally customized codebase that is not part of any standard library.

Any tips appreciated!
GeneralRe: Learning Custom Types in OOP/New Codebases Pin
Super Lloyd15-Sep-16 18:37
Super Lloyd15-Sep-16 18:37 
GeneralRe: Learning Custom Types in OOP/New Codebases Pin
Brady Kelly15-Sep-16 19:31
Brady Kelly15-Sep-16 19:31 
GeneralRe: Learning Custom Types in OOP/New Codebases Pin
den2k8815-Sep-16 21:24
professionalden2k8815-Sep-16 21:24 
GeneralRe: Learning Custom Types in OOP/New Codebases Pin
Foothill16-Sep-16 3:45
professionalFoothill16-Sep-16 3:45 
RantWhy is Xamarin so unkind? Pin
Super Lloyd15-Sep-16 18:21
Super Lloyd15-Sep-16 18:21 
GeneralRe: Why is Xamarin so unkind? Pin
Shameel15-Sep-16 20:23
professionalShameel15-Sep-16 20:23 
GeneralRe: Why is Xamarin so unkind? Pin
Super Lloyd15-Sep-16 21:19
Super Lloyd15-Sep-16 21:19 
GeneralIs website redirection at a non-evil website a sign of poor programming? Pin
swampwiz15-Sep-16 14:24
swampwiz15-Sep-16 14:24 
QuestionRe: Is website redirection at a non-evil website a sign of poor programming? Pin
Duncan Edwards Jones15-Sep-16 22:14
professionalDuncan Edwards Jones15-Sep-16 22:14 
AnswerRe: Is website redirection at a non-evil website a sign of poor programming? Pin
Mark_Wallace15-Sep-16 22:53
Mark_Wallace15-Sep-16 22:53 
GeneralRe: Is website redirection at a non-evil website a sign of poor programming? Pin
Duncan Edwards Jones15-Sep-16 22:56
professionalDuncan Edwards Jones15-Sep-16 22:56 
GeneralRe: Is website redirection at a non-evil website a sign of poor programming? Pin
Mark_Wallace15-Sep-16 23:02
Mark_Wallace15-Sep-16 23:02 
GeneralRe: Is website redirection at a non-evil website a sign of poor programming? Pin
Richard Deeming16-Sep-16 3:27
mveRichard Deeming16-Sep-16 3:27 
GeneralRe: Is website redirection at a non-evil website a sign of poor programming? Pin
Rob Grainger16-Sep-16 5:56
Rob Grainger16-Sep-16 5:56 
GeneralRe: Is website redirection at a non-evil website a sign of poor programming? Pin
Mark_Wallace16-Sep-16 22:30
Mark_Wallace16-Sep-16 22:30 
GeneralRe: Is website redirection at a non-evil website a sign of poor programming? Pin
Rob Grainger18-Sep-16 22:26
Rob Grainger18-Sep-16 22:26 
GeneralRe: Is website redirection at a non-evil website a sign of poor programming? Pin
Rob Grainger16-Sep-16 5:52
Rob Grainger16-Sep-16 5:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.