|
|
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:
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>()));
manager.UserValidator = new UserValidator<ApplicationUser>(manager)
{
AllowOnlyAlphanumericUserNames = false,
RequireUniqueEmail = true
};
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!
|
|
|
|
|
It is just a fact of life.
Nobody expect you to hit the ground running when you are dropped in a totally new project!
|
|
|
|
|
I understand and sympathise with you being dropped in the deep end, but creating and using custom types, or classes, is a very fundamental rennet of OOP. Even C allows the use of custom types via the use of struct , even if that is miles from OOP.
Do what thou wilt shall be the whole of the Law. - Liber AL vel Legis 1:40, Aleister Crowley
|
|
|
|
|
That is the real complexity in any project. It's not the 40ish C++/Java keywords or the standard Bohm-Jacopini flows, nor usually are the algorithms.
It's the net of data types and their relationships, which must be learned and should be well documented.
GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver
When I was six, there were no ones and zeroes - only zeroes. And not all of them worked. -- Ravi Bhavnani
|
|
|
|
|
TheOnlyRealTodd wrote: 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.. It is for this reason that I am really starting to like Sandcastle. It requires a lot more effort when writing XML comments but the end product is worth it. I love having a code documentation website with the exact look and feel of MSDN but features my code. It even links forward to the official documentation of .Net classes.
if (Object.DividedByZero == true) { Universe.Implode(); }
Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016
|
|
|
|
|
I got so many deploy / debug issue (as in: app not building, app not deploying, app not debugging) every time a new version comes out..
I had hope they do a better job since acquired by Microsoft, but latest version were even more problematic...
|
|
|
|
|
Super Lloyd wrote: since acquired by Microsoft
There you have the answer
|
|
|
|
|
Not really, when did a .NET framework update caused you any trouble?
Yeah, I can't remember either....
|
|
|
|
|
I use Firefox and the only setting there is concerning redirection is an all-or-nothing checkbox in which when selected any attempted redirection causes there to be a bar added at the top allowing the user to select Allow (or close the bar to not allow). Because I typically do not notice this bar, I logically do not get informed of the redirection. For most websites, all that happens is I don't see whatever part of the website I was supposed to see and just presume that the website is broken and I move on. However, just today I was at my financial institution's website trying to access a feature and it resulted in a redirection that the all-or-nothing setting blocked, and since I did not notice the top bar asking to Allow the redirection, I became frustrated, almost to the point of calling up the institution to do what I wanted to do with the feature by a representative. (I eventually did notice the bar and once I allowed it, everything worked fine.) I should say that I don't remember this feature being blocked in the past.
So my question is whether there is ever a legitimate reason to do a redirection that Firefox would catch (i.e., if the selection were to do so), or if having such a redirection is the result of poor programming somehow. I understand perfectly that an evil website would want to do such redirection, but obviously I do not want to have that be done.
|
|
|
|
|
swampwiz wrote: (I eventually did notice the bar and once I allowed it, everything worked fine.)
Do you still have money in the account this morning? (I'd be very disappointed if my online bank had a redirection in it)
|
|
|
|
|
Duncan Edwards Jones wrote: I'd be very disappointed if my online bank had a redirection in it I'd be very surprised if they didn't.
E.g. try bookmarking a page of its site after you've logged in. If you try to open that bookmark later, you'll be redirected.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Ah - I'd assumed the OP meant off-site redirection. Maybe not so serious then.
|
|
|
|
|
Even off-site redirections are pretty normal, because even smaller companies can own multiple domains, e.g. one for marketing & sales material, one for a shopping cart, and another to actually book orders/deliveries.
I've no idea why FF is jerking its knees at redirections, but it doesn't seem wise to make it non-configurable.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Mark_Wallace wrote: ... it doesn't seem wise to make it non-configurable.
Which would be why it is configurable.
The OP even mentioned that there's a checkbox you have to tick if you want the warning: Options ⇒ Advanced ⇒ Warn me when websites try to redirect or reload the page. It's not selected by default.
It's intended to be an accessibility feature, so that users with screen-readers don't get confused when the page they've loaded automatically reloads a different page.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
In my experience, they are all under one domain. I would expect my browser to warn me of anything redirecting to a different domain. Its a big warning sign. If my bank did that kind of thing (or any site that involves financial transactions), I would use another.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
So when you go to amazon and pay with paypal or by bank transfer, it's all under one domain?
I kinda doubt it.
And I suppose you completely boycott google, because they use (and redirect you between) around 2500 domains -- the toy security tool in FF won't tell you when that happens, though, because the FF guys kowtow to even the lowliest google employee.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
That's a bit different - I click on a link, knowing and expecting to be transferred to a different domain. A redirect is done without user interaction.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
I would be very, very concerned if my bank used redirection. To the extent of changing bank.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Just got back from a wonderful vacation in Estonia and Saint Petersburg!
I really dislike airplanes. My left ear is blocked since the plane took off in Sint Petersburg this afternoon (and yes, I've tried all known remedies, but they didn't work). At least the searing pain of my brain trying to escape by splitting my skull in half is gone. Somehow my head really can't handle the difference in pressure
Anyway, good to be back! The best part of a vacation is always coming home
Hard to believe that I was visiting the Church of the Savior on Blood[^] this morning and that I'm off to my own bed in the Netherlands in a few
|
|
|
|
|
Yes, I'll bet you really missed the hutspot, stampot, snert, and two-slices-of-bread-with-a-slice-of-cheese.
OK, OK, so there are times when even I would find the use of a sarcasm emoji appropriate (not to advise, mind, but to overkill).
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Mark_Wallace wrote: hutspot, stampot, snert I never eat those actually!
Mark_Wallace wrote: two-slices-of-bread-with-a-slice-of-cheese Cheese on bread is such a waste of cheese! The two really don't compliment each other (although it seems that's quite an unpopular opinion)
Speaking of bread, the only bread I've ever really liked is the good old Dutch bread
|
|
|
|
|
Sander Rossel wrote: the good old Dutch bread
Which sort? The sort that tastes like it was made of sawdust or the other one that is more neutral and does not taste like much at all?
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
The one that bends without breaking. Foreign breads don't do that
Lots of sourdough in other countries
|
|
|
|
|
Sander Rossel wrote: Cheese on bread is such a waste of cheese!
Depends on the bread, depends on the cheese!
The world is full of cheeses, from Cheddars through Stinking Bishop to unpasteurised Brie. It's not all Gouda that feels and tastes like bicycle inner tube!
And breads...ah, breads! From Olive breads, Ciabatta, Baguettes, Soda Bread, Wholemeal, bagels, crumpets, proper muffins, cotton-wool-white rubbish, to a fresh loaf straight from the oven!
And then, there is that Maestro of the cold-day-quick-lunch: Cheese on Toast! Or it's slightly more refined variant Welsh Rarebit!
Bread and cheese are a marriage made in heaven, if you get the right ones!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|