Humanize Your C# Code with the Humanizer NuGet Package

  Рет қаралды 21,196

IAmTimCorey

IAmTimCorey

Күн бұрын

Converting values in code can be tricky. For example, if you rank something, you would say that the top pick is in first place, not in 1 place. Those types of conversions are simple for humans to do but tricky for software to do. Fortunately, the Humanizer package makes these types of conversions easy. From converting 4:30pm to half past four to knowing how to transform a string to be a specific enum value, this package seemingly does it all.
Full Training Courses: IAmTimCorey.com
Source Code: leadmagnets.app/?Resource=Hum...
Mailing List: signup.iamtimcorey.com/

Пікірлер: 62
@CoderboyPB
@CoderboyPB Жыл бұрын
Wow, this package is amazing. Thanx for introducing it to us 🙂
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@EliasLoveL
@EliasLoveL Жыл бұрын
Happy Nowruz Tim.📣📣📣🤗 Wish you a great and amazing year full of wealth and opportunities and wishes to come true ,not this year but for a lifetime😍😊
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thank you!
@marcoguerra6349
@marcoguerra6349 Жыл бұрын
Nice Tim, didn't feel it very useful at first but glad I stayed until the end. I can definitely use the DateTime conversion in one of my apps.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Glad it was helpful!
@wonderverse99
@wonderverse99 Жыл бұрын
Love it. Thanks for the tutorial 😀
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@newmonengineering
@newmonengineering Жыл бұрын
Pretty cool, the heading thing could be useful for a weather app. This is pretty cool. Not sure I have an immediate use case currently but I will keep it in mind in the future. Thanks for showing it.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@stephan_smit
@stephan_smit Жыл бұрын
This is simply amazing.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Great!
@svmandryk
@svmandryk Ай бұрын
thank you for this useful video!
@IAmTimCorey
@IAmTimCorey Ай бұрын
You are welcome!
@pawel89pawel
@pawel89pawel Жыл бұрын
Wow you can do some really cool stuff with that might some good ideas where to use it in my app 🙂. As always great video. Thank's for sharing.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@spicedream7449
@spicedream7449 Жыл бұрын
Thank you from Germany.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@Keen959
@Keen959 11 ай бұрын
Thats cool. Thanks for bringing this up. I would like to see if it can dehumanize "previous Saturday" to date value.
@IAmTimCorey
@IAmTimCorey 11 ай бұрын
You are welcome.
@MiningForPies
@MiningForPies Жыл бұрын
This package will be really helpful on my timeline screen that shows you, well a timeline. Although I am a bit freaked out by your pronunciation of enum 😂
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Glad you will get value out of it.
@rikudouensof
@rikudouensof Жыл бұрын
I used substring, for the truncate, and I had to create a class library to do the ' humanize' time. This is a great solution!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Great!
@DarrenTAnims
@DarrenTAnims Жыл бұрын
This looks like it could be a useful library. Usually, I'd write these kinds of converters myself, to get exactly the output I expect, but this could be a shorthand, especially for the enum converters. However, for me, there's a few (small) issues: - Sentence case isn't really creating sentence case. The 2nd sentence didn't start with a capital letter. - Title case wasn't title case. It was just changing the 1st letter of each word to a capital. It should ignore conjunctions and smaller words in the middle of the sentence. - Time. For the UK, we don't say, "a quarter to five". We'd say, "quarter to five". Is there a UK language version? There might be. Otherwise, I'd have to add my own extension to fix this. - For consistency with the other methods, to convert the sizes, I'd expect .Megabytes & .Terabytes to be: .ToMegabytes & .ToTerabytes or even: .AsMegabytes & .AsTerabytes
@IAmTimCorey
@IAmTimCorey Жыл бұрын
I addressed sentence case in the video. It isn't about grammar, it is about programming norms. Title case is title case. That's what it is in programming. Don't think of this as fixing grammar. Think of this as getting the data to conform to a programming principle. There are differences when you use your specific region, yes.
@DarrenTAnims
@DarrenTAnims Жыл бұрын
@@IAmTimCorey Thank you for replying. And thanks for these videos. It's great to get this kind of detailed insight of new tech.
@codefoxtrot
@codefoxtrot Жыл бұрын
BEWARE, for me, turning on the beta UTF-8 option, Control Panel -> Region -> Administrative tab -> Change system locale -> "Beta: Use unicode UTF-8 for worldwide language support", resulted in Outlook sending really strange emails on my end. For me, it was emails that contained quoted text, when accepting or declining a calendar invite based on an MS-Teams meeting. Very strange, but ultimately had to turn off this feature, due to the problem. My team and I were able to reproduce it and trace the problem back to enabling that feature in Regional settings, from my most recent watch of another excellent Tim Corey video!
@codefoxtrot
@codefoxtrot Жыл бұрын
In the interest of completeness, I've filed feedback to Microsoft, with screenshots and steps to reproduce the problem. Hopefully something comes out of the feedback so others don't experience this problem!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Interesting. Thanks for sharing and thanks for filing the bug report.
@HouseWashing
@HouseWashing Жыл бұрын
I'm glad to say that I contributed for Tamil language.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Awesome!
@sathishck
@sathishck Жыл бұрын
Excellent 👌
@SantoshKishor
@SantoshKishor Жыл бұрын
Awesome bro
@dereklomax161
@dereklomax161 Жыл бұрын
Thanks. I agree the Dehumanize name is unfortunate. I would have Robotize or Computerize.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@Brofbrofs
@Brofbrofs Жыл бұрын
Useful
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Great!
@dianajdanj
@dianajdanj Жыл бұрын
Its a lot of fun, but not always deterministic, a lot lot like natural language.
@billy65bob
@billy65bob Жыл бұрын
Words cannot begin describe how much I detest relative timestamps.
@ogheneroonoruvwe8994
@ogheneroonoruvwe8994 Жыл бұрын
While its very interesting and very useful to me... its ironically sad cos i just created code library that does most of these... wish i saw this few months ago; would have saved a tone of time. Thank you very much... still totally usefull.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Bummer. At least you gained some experience doing it yourself.
@ogheneroonoruvwe8994
@ogheneroonoruvwe8994 Жыл бұрын
Sure! And this Humanizer does a lot more.
@davedontmind
@davedontmind Жыл бұрын
@25:06 - the "and" is a British thing - I'd always say "one hundred and twenty two", not "one hundred twenty two" as my US colleagues would. I'd imagine the authors speak British English.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
It's also common in the US, it just isn't correct (or it wasn't when I went to school - language evolves over time).
@bbrazen
@bbrazen Жыл бұрын
Eh-Noom!
@senaris
@senaris Жыл бұрын
But we really need a third party library for this? Can't you just create a function for that particular 'pretty' result?
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Absolutely. But at some point, you have to evaluate how many wheels you want to reinvent. There is a balance here. You could drop this in your project and have the solution now. Or you could dedicate time to building one of your own including time to debug it, handle edge cases, etc. Every time you use something from someone else, you create a dependency you have to manage. Every time you build something yourself, you add complexity you have to maintain.
@AhmedMohammed23
@AhmedMohammed23 Жыл бұрын
linux user a gigabyte is a gigabyte a 1000 is a 1000 thank you for all the tutorials
@IAmTimCorey
@IAmTimCorey Жыл бұрын
That's not how gigabytes work. A gigabyte is 1024 megabytes. If something reports it as 1,000, it is incorrect.
@AhmedMohammed23
@AhmedMohammed23 Жыл бұрын
@@IAmTimCorey more like gibibyte
@MichalMadej-20
@MichalMadej-20 Жыл бұрын
@@IAmTimCorey It depends - one GB is defined as 1000³ (1,000,000,000) bytes and one GiB as 1024³ (1,073,741,824) bytes. That means one GB equals 0.93 GiB.
@mbpoblet
@mbpoblet Жыл бұрын
@@MichalMadej-20 A KB has been 1024 bytes since the concept of bytes was invented, and will continue to be so as long as computers use binary code. No one (or at least no one that can be trusted) uses this malicious GiB nonsense. The only reason anyone would attempt to claim that 1TB is 1000.000.000.000 bytes is to try to scam people into buying a 931GB drive for the price of a 1TB one.
@sanjeevsjk
@sanjeevsjk Жыл бұрын
First
@IAmTimCorey
@IAmTimCorey Жыл бұрын
👋
@rockymarquiss8327
@rockymarquiss8327 Жыл бұрын
Rather than "Console.WriteLine(Book.ScienceFiction.Humanize().Transform(To.TitleCase));" - doesn't "Console.WriteLine(Book.ScienceFiction.Humanize(LetterCasing.Title));" do the same thing?
@scrapperdudeGA
@scrapperdudeGA Жыл бұрын
A lot of great info. Kinda hard for my ADHD brain to watch sometimes. Gets real wordy with explanations. Like his discussion of transforming to titlecase. All he had to say was that titlecase capitalizes the first letter of each word. That's it. All this stuff about acronyms and everything is meaningless.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
I get that, but the stuff about acronyms wasn't meaningless. It was something that behaved differently than you might expect, so I explained why.
@scrapperdudeGA
@scrapperdudeGA Жыл бұрын
@@IAmTimCorey Well, I am also a bit narcissistic so my comment was more about my frustration with my brain sometimes. You have a lot a great info and you're very thorough. I just have a tendency to grasp concepts quickly and feel my mind constantly trying to scream forward. It's a blessing and a curse.. Keep up the good work. 😁
@Zjyslav
@Zjyslav Жыл бұрын
I haven't tried the language-specific version yet, but the core seems to have some issues if system language is not set to English. I'm using Windows in Polish and when I try to humanize DateTime.Now.AddHours(3.5) I get an exception: System.ArgumentException: „The resource object with key 'DateHumanize_MultipleHoursFromNow' was not found Arg_ParamName_Name”. Also, ToClockNotation returns "a quarter to cztery" (cztery is four in Polish, but in context of time it should be czwarta - fourth, so it's a little far from correct). It's a shame that the environment in which it runs can so easily break it.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Interesting. Sounds like a good issue to post on their GitHub page.
@Zjyslav
@Zjyslav Жыл бұрын
@@IAmTimCorey When I googled the error I saw 2 open issues from 2019 on their page - one about Polish, one about Czech.
Intro to Regular Expressions - How to use Regex in C#
55:52
IAmTimCorey
Рет қаралды 36 М.
Creating NuGet Packages the easy way with .NET Standard in C#
1:14:57
Don’t take steroids ! 🙏🙏
00:16
Tibo InShape
Рет қаралды 28 МЛН
Зомби Апокалипсис  часть 1 🤯#shorts
00:29
INNA SERG
Рет қаралды 6 МЛН
Follow @karina-kola please 🙏🥺
00:21
Andrey Grechka
Рет қаралды 13 МЛН
Intro to GitHub - Commits, Issues, Pull Requests, Releases, and more
1:09:28
Code Snippets in Visual Studio
5:38
Stephen Samuelsen
Рет қаралды 2 М.
C# Nuget Packages You Need to Know About!
23:20
jondjones
Рет қаралды 1,6 М.
OpenAI’s GPT-4o: The Best AI Is Now Free!
9:14
Two Minute Papers
Рет қаралды 188 М.
C# Logging with Serilog and Seq - Structured Logging Made Easy
1:07:56
30+ String Manipulation Techniques in C#
1:44:07
IAmTimCorey
Рет қаралды 100 М.
Intro to MediatR - Implementing CQRS and Mediator Patterns
1:21:50
IAmTimCorey
Рет қаралды 213 М.
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 746 М.
Don’t take steroids ! 🙏🙏
00:16
Tibo InShape
Рет қаралды 28 МЛН