Content Developer II at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
121735 stories
·
29 followers

Apple’s new AI model hints at how AI could come to the iPhone

1 Share
An illustration of the Apple logo.
Illustration: The Verge

Apple has been quiet about its plans for generative AI, but with the release of new AI models today, it appears the company’s immediate ambitions lie firmly in the “make AI run locally on Apple devices” realm.

Researchers from Apple released OpenELM, a series of four very small language models on the Hugging Face model library, on Wednesday. Apple said on its Hugging Face model page that OpenELM, which stands for “Open-source Efficient Language Models,” performs very efficiently on text-related tasks like email writing. The models are open source and ready for developers to use.

It has four sizes: 270 million parameters; 450 million parameters; 1.1 billion parameters; and 3 billion...

Continue reading…

Read the whole story
alvinashcraft
33 minutes ago
reply
West Grove, PA
Share this story
Delete

Leading in the era of AI: How Microsoft’s platform differentiation and Copilot empowerment are driving AI Transformation

1 Share

A Copilot on every desk, every device and across every role is core to Microsoft’s mission to empower every person and every organization on the planet to achieve more. By bolstering the services customers know and love with our Copilot capabilities across the Microsoft Cloud, we are enabling zero-shot innovation — the ability to effectively gain value out of the box — for their businesses to increase productivity, creativity and inclusive collaboration. ISVs, digital natives, startups and the rest of our partner ecosystem are leveraging our Copilot stack to build AI solutions that are reshaping business processes across industries. We continue co-innovating directly with customers on our open cloud platform to bend the curve on innovation by identifying AI design patterns; then integrating and applying data to solve their most pressing challenges faster and more efficiently than ever before. Underpinning it all is the need for a strong cybersecurity foundation, and the work we are doing to ensure this critical imperative is met. No one is immune from bad actors, and we remain committed to transparency and trust in our approach to protecting customer and partner data. By empowering organizations with industry-leading cloud and responsible AI solutions, paired with our focus on security, we are helping them unlock opportunities that deliver pragmatic business outcomes. I am proud of the work we have done this past quarter that exemplifies our approach to enabling AI Transformation, and the success of our customers and partners across industries who have embraced it.

Just this week we announced our strategic partnership with The Coca-Cola Company to accelerate AI Transformation enterprise-wide as well as across its global network of independent bottlers, and shared news of our partnership with Cognizant to drive enterprise AI adoption for millions of users. We are expanding our work with G42 to accelerate responsible AI innovation in the United Arab Emirates and beyond while accelerating digital transformation securely across the Middle East, Central Asia and Africa with expanded access to services and technologies. We are also building on our relationship with Cloud Software Group to bring joint cloud solutions and generative AI capabilities to more than 100 million people.

We continue to shape the future of industry alongside our customers to help them differentiate their businesses. At CES, we showcased how our customers and partners are innovating across the automotive and mobility industry with generative AI to solve deep business problems and create new opportunities, and revealed the Copilot key for Windows 11 PCs. At NRF, we shared new copilot templates to help retailers incorporate generative AI across the shopper journey while enhancing the experience for store associates and making AI implementation more accessible. Just recently at HIMSS, we announced Microsoft’s role as the technology enabling partner for the Trustworthy & Responsible AI Network, a consortium of healthcare leaders aimed at operationalizing responsible AI principles to improve the quality, safety and trustworthiness of AI in healthcare.

Air India plane in flight
Air India harnesses AI for operational excellence with Copilot for Microsoft 365.

Enabling pragmatic AI innovation with Copilot capabilities to deliver immediate value

Companies like Amadeus, AAMI, TotalEnergies and Cushman & Wakefield are leveraging Copilot for Microsoft 365 to enrich customer interactions and advance high-priority projects. Visa employees are transforming how they work to better serve the needs of their clients and Banca Transilvania is boosting efficiency and innovation while delivering the highest quality of customer service. Emirates NBD engineers are solving their most complex problems while remaining within their development environments, and 96% of early adopters at CommBank have shared that Copilot is making them more productive. Colombia-based Cenit is experiencing rapid adoption of Copilot to empower employees to be more creative, productive and collaborative. U.K.-based law firm Clifford Chance is helping employees automate daily tasks like meeting notes, email drafts and inbox management with AI and natural language processing, while Air India built a plugin to gain real-time access to flight and operations data to empower better decision-making.

With Copilot for Dynamics 365 Customer Insights, Northrop & Johnson achieved a 250% increase in charter bookings while helping team members save time, boost productivity and enrich the quality of engagement with their customers. Using Power Platform and Microsoft Copilot Studio, Cineplex is saving employees over 30,000 hours annually in manual processing times and reducing ticket refund handling time from 15 minutes to under a minute. Northern Trust is using Microsoft Copilot for Service to modernize its client relations organization, streamline employee processes and elevate the client experience. Teams at EPAM Systems are leveraging Microsoft Copilot for Sales to improve sales processes and better support its business strategies, while freeing up time to spend with customers.

Worker at Blue Yonder
Blue Yonder optimizes supply chain orchestration with Azure OpenAI Service.

Building AI design patterns that bend the curve on innovation and intelligently reason over data to solve business challenges

Icertis is leveraging Azure OpenAI Service and its proprietary AI models in conjunction with its extensive data lake to uncover cost savings, enhance compliance and reduce risk across millions of legal contracts. Insurance company FWD Group is using the service to enhance customer experiences and operations across its lines of business, and Singapore-based CapitaLand Investment has saved 1 million Singapore dollars and 10,000 work hours per year with data-driven AI models. With Azure OpenAI Service as the secure foundation for its supply chain platform, Blue Yonder is harnessing AI and machine learning to provide real-time decision making for businesses across 78 countries. Homes & Villas by Marriott Bonvoy and Publicis Sapient are making it easier for travelers to find the right vacation homes through natural language search powered by large language models within Azure OpenAI Service, and Miral is curating some of the most sought-after leisure, entertainment and tourism activities with a 24/7 AI-powered concierge. Using several AI models, Australian retailer Coles developed an edge computing platform that makes 1.6 billion informed predictions each day so customers can find exactly what they are looking for across its 850 stores.

With Microsoft Fabric, Melbourne Airport is synchronizing flight bookings and ground transportation data to project demand while maintaining efficiency, reliability and safety of its operations. Rail freight operator Aurizon is deriving better data insights from 400 sensor-equipped locomotives to enhance cost efficiency, scalability and predictive maintenance. Seair Exim Solutions is increasing export-import trade data ingestion speeds by 90% to empower its global shipping industry customers with improved insights more quickly with help from Mandelbulb Technologies, while Dener Motorsport is using Fabric and real-time analytics to help automotive engineers detect and resolve car issues within minutes — down from nearly half an hour. By hosting its data within Azure Kubernetes, Windstream is improving its custom GPT platform to help employees find the information they need faster across 100,000 indexed documents. To promote financial inclusion, Trusting Social focused on a strong data foundation paired with AI services to enable the development and deployment of solutions that assist more than 130 financial institutions across Asia. Sasfin Bank worked with Legal Interact to implement a unified document management system to analyze contract clauses and streamline legal operations and workflows using Azure Cognitive Services and Azure SQL. TomTom has deployed GitHub Copilot to its developers, resulting in 85% of the company’s engineers feeling more productive and 70% saying it enables them to focus on more satisfying work. Meesho — a leading online marketplace in India — is using a generative AI chat agent to increase inquiry resolution by 40% and customer satisfaction by 25%, while leveraging GitHub Copilot to streamline code delivery and testing for its 200+ developers.

Grupo Bimbo plant
Grupo Bimbo bakes in end-to-end data security and compliance with Microsoft Purview.

Strengthening cybersecurity foundations with industry-leading cloud and responsible AI solutions

Microsoft’s Secure Future Initiative (SFI) reflects our commitment to continually advancing the built-in security of our products and services. We recently announced the general availability of Microsoft Copilot for Security — the industry’s first generative AI solution designed to help security and IT professionals do their work with greater speed and accuracy. In our latest Copilot for Security economic study, security analysts using the Copilot were 22% faster and 7% more accurate across all tasks, with 97% saying they want to use it again. Our ability to offer this solution to customers is bolstered by more than 100 partners such as Capgemini, Cisco and Darktrace who are committed to working with us to deliver trusted, responsible AI solutions. In collaboration with TC1 Labs, Pacifico Seguros has become the first company in Latin America to implement Copilot for Security with a Zero Trust approach, strengthening its security defenses and confidently preparing the company for future security challenges. Security professionals at Enverus are saving hours per day on low-value tasks with Copilot, allowing them to focus on strategic work and help elevate the impact of their security team. Wipro is using the solution to help employees save time and act quickly to improve outcomes across its business.

Using the Microsoft Defender security stack, Del Monte Foods increased security visibility and coverage across its IT environment, reducing security risks by 50% and improving its security response and remediation capabilities. To streamline its security operations, Jones Lang LaSalle implemented Microsoft Defender for Endpoint with help from Tanium, reducing cybersecurity spending by 20% and enhancing protection for nearly 90,000 endpoints. Türkiye-based Demirören has adopted a Zero Trust security model by unifying its security solutions to protect essential business data and enhance threat detection and response capabilities. Paytronix, a provider of customized digital experiences for restaurant and convenience store guests, improved its security profile by seamlessly migrating data for 250 million user accounts to Azure without interruption. The Audi Group’s IT department is simplifying endpoint management and safeguarding its hybrid workforce across 12 countries with enhanced security using Microsoft Intune. To ensure robust data protection and seamless access for authorized personnel, SLT-MOBITEL is using Microsoft’s AI-powered security products to fortify end-user devices and services while simplifying information security and compliance. Oregon State University and Grupo Bimbo are utilizing Microsoft data security solutions to safeguard their environments and confidently prepare for their continued adoption and deployment of AI.

Embracing AI Transformation has become a priority for organizations around the world seeking to unlock AI opportunities. Whether helping our customers adopt and scale AI with our Copilot capabilities or building unique AI strategies leveraging our open platform and partner ecosystem, we are humbled to work with you to drive pragmatic business outcomes and differentiated industry leadership. Our commitment to your success is unwavering. We will continue building upon our trusted relationships and our focus on responsibility and security so you can move forward with confidence in your AI journey. I remain inspired by what we have done — and what we will do — to help our customers and partners achieve more.

The post Leading in the era of AI: How Microsoft’s platform differentiation and Copilot empowerment are driving AI Transformation appeared first on The Official Microsoft Blog.

Read the whole story
alvinashcraft
34 minutes ago
reply
West Grove, PA
Share this story
Delete

Node.js 22 is now available!

1 Share
Read the whole story
alvinashcraft
34 minutes ago
reply
West Grove, PA
Share this story
Delete

Join us for Azure Developers - .NET Day on April 30!

1 Share

We’re excited to announce the upcoming Azure Developers – .NET Day! Join us on April 30th for a full day dedicated to .NET developers and the Azure ecosystem. This online event is packed with expert-led sessions that delve into AI advancements, app development efficiencies, cloud-native capabilities, and much more.

Event Date: April 30, 2024
Time: Starting at 8:00 AM PST / 16:00 UTC


Save the Date!

Why Attend?

Azure Developers – .NET Day 2024 is an essential event for .NET developers aiming to elevate their cloud development capabilities. This day-long online event offers an unparalleled opportunity to discover the latest and greatest Azure features tailored for .NET applications. You'll engage with cutting-edge cloud development techniques that not only save time and money but also optimize customer experiences.

Hear directly from the experts behind Azure's most sought-after services for developers, covering key areas such as AI, app development, data services, serverless computing, cloud-native computing, and boosting developer productivity. Don’t miss out on this chance to interact and engage with the team throughout the day, taking your cloud development skills to the next level.

Speaker Lineup and Sessions

This year’s event features a diverse lineup of topics and speakers:

  • AI Coding Techniques with Bruno Capuano: Dive into practical AI coding sessions that add intelligence to your .NET applications.
  • GitHub Copilot for SQL Development by Subhojit Basak: Learn how to integrate AI into your database development processes for faster, more reliable outputs.
  • Redis & .NET Apps with Catherine Wang: Enhance your applications' consistency and smart capabilities using Redis.

  • Change Data Streams with Azure SQL by Brian Spendolini: Quickly set up change data streams with .NET, showcasing real-time data manipulation and analysis.

  • Data API Builders on Azure with Frank Boucher and Jerry Nixon: Auto-generate and deploy data APIs on Azure Static Web Apps effortlessly.

  • gRPC on App Service by Jeff Martinez and Byron Tardif: Host your gRPC workloads efficiently using .NET on Windows-based Azure App Services.

  • Event-Driven Architectures by Davide Mauri: Implement event-driven solutions with .NET and Azure Functions for responsive, scalable applications.

Enhancing Developer Productivity

  • Azure API Center by Justin Yoo: Unlock new levels of productivity with Azure API management tools.
  • VS Code Project Setups by Ori Bar-ilan: Master your project setups and streamline your development workflow using Visual Studio Code.

Learn and Connect

Join us online via the Azure Developers YouTube and Twitch channels to transform your ideas into exceptional solutions with .NET and Azure.

We look forward to seeing you there. Let’s build something amazing together!

Read the whole story
alvinashcraft
35 minutes ago
reply
West Grove, PA
Share this story
Delete

Thoughts on Primary Constructors in C#

1 Share

Primary constructors seems to be one of those polarizing features in C#. Some folks really love them; some folks really hate them. As in most cases, there is probably a majority of developers who are in the "meh, whatever" group. I have been experimenting and reading a bunch of articles to try to figure out where/if I will use them in my own code.

I have not reached any conclusions yet. I have a few examples of where I would not use them, and a few examples of where I would. And I've come across some scenarios where I can't use them (which affects usage in other areas because I tend to write for consistency).

Getting Started

To get started understanding primary constructors, I recommend a couple of articles:

The first article is on Microsoft devblogs, and David walks through changing existing code to use primary constructors (including using Visual Studio's refactoring tools). This is a good overview of what they are and how to use them.

In the second article, Marek takes a look at primary constructors and adds some thoughts. The "Initialization vs. capture" section was particularly interesting to me. This is mentioned in David's article as well, but Marek takes it a step further and shows what happens if you mix approaches. We'll look at this more closely below.

Very Short Introduction

Primary constructors allow us to put parameters on a class declaration itself. The parameters become available to the class, and we can use this feature to eliminate constructors that only take parameters and assign them to local fields.

Here's an example of a class that does not use a primary constructor:


public class HomeController : Controller
{
    private readonly ILogger<HomeController> _logger;

    public HomeController(ILogger<HomeController> logger)
    {
        _logger = logger;
    }
    
    public IActionResult Index()
    {
        _logger.Log(LogLevel.Trace, "Index action called");
        return View();
    }
    // other code
}

In a new ASP.NET Core MVC project, the HomeController has a _logger field that is initialized by a constructor parameter. I have updated the code to use the _logger field in the Index action method.

The code can be shorted by using a primary constructor. Here is one way to do that:


public class HomeController(ILogger<HomeController> logger) 
    : Controller
{
    private readonly ILogger<HomeController> _logger = logger;
    
    public IActionResult Index()
    {
        _logger.Log(LogLevel.Trace, "Index action called");
        return View();
    }
    // other code
}

Notice that the class declaration now has a parameter (logger), and the separate constructor is gone. The logger parameter can be used throughout the class. In this case, it is used to initialize the _logger field, and we use the _logger in the Index action method just like before. (There is another way to handle this that we'll see a bit later).

So by using a primary constructor, we no longer need a separate constructor, and the code is a bit more compact.

Fields or no Fields?

As David notes in his article, Visual Studio 2022 offers 2 different refactoring options: (1) "Use primary constructor" and (2) "Use primary constructor (and remove fields)". (Sorry, I couldn't get a screen shot of that here because the Windows Snipping Tool was fighting me.)

The example above shows what happens if we choose the first option. Here is what we get if we chose the second (and remove the fields):


public class HomeController(ILogger<HomeController> logger) 
    : Controller
{
    public IActionResult Index()
    {
        logger.Log(LogLevel.Trace, "Index action called");
        return View();
    }
    // other code
}

In this code, the separate _logger field has been removed. Instead, the parameter on the primary constructor (logger) is used directly in the class. A parameter on the primary constructor is available throughout the class (similar to a class-level field), so we can use it anywhere in the class.

Guidance?

Here's where I hit my first question: fields or no fields? The main difference between the 2 options is that a primary constructor parameter is mutable.

This means that if we use the parameter directly (option 2), then it is possible to assign a new value to the "logger" parameter. This is not likely in this scenario, but it is possible.

If we maintain a separate field (option 1), then we can set the field readonly. Now the value cannot be changed after it is initialized.

One problem I ran into is that there is not a lot of guidance in the Microsoft documentation or tutorials. They present both options and note the mutability, but don't really suggest a preference for one over the other.

The Real Difference

Reading Marek's article opened up the real difference between these two approaches. (Go read the section on "Initialization vs. capture" for his explanation.)

The compiler treats the 2 options differently. With option 1 (use the parameter to initialize a field), the parameter is discarded after initialization. With option 2 (use the parameter directly in the class), the parameter is captured (similar to a captured variable in a lambda expression or anonymous delegate) and can be used throughout the class. 

As Marek notes, this is fine unless you try to mix the 2 approaches with the same parameter. For example, if we use the parameter to initialize a field and then also use the parameter directly in our code, we end up in a bit of a strange state. The field is initialized, but if we change the value of the parameter later, then the field and parameter will have different values.

If you try the mix and match approach in Visual Studio 2022, you will get a compiler warning. In our example, if we assign the logger parameter to a field and then use the logger parameter directly in the Index action method, we get the following warning:

Warning CS9124  Parameter 'ILogger<HomeController> logger' is captured into the state of the enclosing type and its value is also used to initialize a field, property, or event.

So this tells us about the danger, but it is a warning -- meaning the code will still compile and run. I would rather see this treated as an error. I pay pretty close attention to warnings in my code, but a lot of folks do not.

Fields or No Fields?

I honestly have not landed on which way I'll tend to go with this one. There may be other factors involved. I look at consistency and criticality below -- these will help me make my decisions.

Consistency and Dependency Injection

A primary use case for primary constructors is dependency injection -- specifically constructor injection. Often our constructors will take the constructor parameters (the dependencies) and assign them to local fields. This is what we've seen with the example using ILogger.

So, when I first started experimenting with primary constructors, I used my dependency injection sample code. Let's look at a few samples. You can find code samples on GitHub: https://github.com/jeremybytes/sdd-2024/tree/main/04-dependency-injection/completed, and I'll provide links to specific files.

Primary Constructor with a View Model

In a desktop application sample, I use constructor injection to get a data reader into a view model. This happens in the "PeopleViewModel" class in the "PeopleViewer.Presentation" project (link to the PeopleViewModel.cs file).


public class PeopleViewModel : INotifyPropertyChanged
{
    protected IPersonReader DataReader;

    public PeopleViewModel(IPersonReader reader)
    {
        DataReader = reader;
    }

    public async Task RefreshPeople()
    {
        People = await DataReader.GetPeople();
    }
    // other code
}

This class has a constructor parameter (IPersonReader) that is assigned to a protected field.

We can use a primary constructor to reduce the code a bit:


public class PeopleViewModel(IPersonReader reader) 
    : INotifyPropertyChanged
{
    protected IPersonReader DataReader = reader;

    public async Task RefreshPeople()
    {
        People = await DataReader.GetPeople();
    }
    // other code
}

This moves the IPersonReader parameter to a primary constructor.

Using a primary constructor here could be seen as a plus as it reduces the code.

As a side note: since the field is protected (and not private), Visual Studio 2022 refactoring does not offer the option to "remove fields".

Primary Constructor with a View?

For this application, the View needs to have a View Model injected. This happens in the "PeopleViewerWindow" class of the "PeopleViewer.Desktop" project (link to the PeopleViewerWindow.xaml.cs file).


public partial class PeopleViewerWindow : Window
{
    PeopleViewModel viewModel { get; init; }

    public PeopleViewerWindow(PeopleViewModel peopleViewModel)
    {
        InitializeComponent();
        viewModel = peopleViewModel;
        this.DataContext = viewModel;
    }

    private async void FetchButton_Click(object sender, RoutedEventArgs e)
    {
        await viewModel.RefreshPeople();
        ShowRepositoryType();
    }
    // other code
}

The constructor for the PeopleViewerWindow class does a bit more than just assign constructor parameters to fields. We need to call InitializeComponent because this is a WPF Window. In addition, we set a view model field and also set the DataContext for the window.

Because of this additional code, this class is not a good candidate for a primary constructor. I have tried different approaches, but I have not found a way to do it.

Consistency

I place consistency pretty high on my list of qualities I want in my code. I learned this from a team that I spent many years with. We had about a dozen developers who built and supported a hundred applications of various sizes. Because we had a very consistent approach to our code, it was easy to open up any project and get to work. The consistency between the applications made things familiar, and you could find the bits that were important to that specific application.

I still lean towards consistency because humans are really good at recognizing patterns and registering things as "familiar". I want to take advantage of that.

So, this particular application, my tendency would be to not use primary constructors. Constructor injection is used throughout the application, and I would like it to look similar between the classes. I emphasize "this particular application" because my view could be different if primary constructors could be used across the DI bits.

Incidental vs. Critical Parameters

When it comes to deciding whether to have a class-level field, I've also been thinking about the difference between incidental parameters and critical parameters.

Let me explain with an example. This is an ASP.NET Core MVC controller that has 2 constructor parameters:


public class PeopleController : Controller
{
    private readonly ILogger<PeopleController> logger;
    private readonly IPersonReader reader;

    public PeopleController(ILogger<PeopleController> logger, 
        IPersonReader personReader)
    {
        this.logger = logger;
        reader = personReader;
    }

    public async Task<IActionResult> UseConstructorReader()
    {
        logger.Log(LogLevel.Information, "UseContructorReader action called");
        ViewData["Title"] = "Using Constructor Reader";
        ViewData["ReaderType"] = reader.GetTypeName();

        IEnumerable<Person> people = await reader.GetPeople();
        return View("Index", people.ToList());
    }
    // other code
}

The constructor has 2 parameters: an ILogger and an IPersonReader. In my mind, one of these is more important than the other.

IPersonReader is a critical parameter. This is the data source for the controller, and none of the controller actions will work without a valid IPersonReader.

ILogger is an incidental parameter. Yes, logging is important. But if the logger is not working, my controller could still operate as usual.

In this case, I might do something strange: use the ILogger parameter directly, and assign the IPersonReader to a field.

Here's what that code would look like:


public class PeopleController(ILogger<PeopleController> logger,
    IPersonReader personReader) : Controller
{
    private readonly IPersonReader reader = personReader;

    public async Task<IActionResult> UseConstructorReader()
    {
        logger.Log(LogLevel.Information, "UseContructorReader action called");
        ViewData["Title"] = "Using Constructor Reader";
        ViewData["ReaderType"] = reader.GetTypeName();

        IEnumerable<Person> people = await reader.GetPeople();
        return View("Index", people.ToList());
    }
    // other code
}

I'm not sure how much I like this code. The logger parameter is used directly (as noted above, this is a captured value that can be used throughout the class). The personReader parameter is used for initialization (assigned to the reader field).

Note: Even though it looks like we are mixing initialization and capture, we are not. The logger is captured, and the personReader is used for initialization. We are okay here because we have made a decision (initialize or capture) for each parameter, so we will not get the compiler warning here.

To me (emphasizing personal choice here), this makes the IPersonReader more obvious -- it has a separate field right at the top of the class. The assignment is very intentional.

In contrast, the ILogger is just there. It is available for use, but it is not directly called out.

These are just thoughts at this point. It does conflict a bit with consistency, but everything we do involves trade-offs.

Thoughts on Primary Constructors and C#

I have spent a lot of time thinking about this and experimenting with different bits of code. But my thoughts are not fully formed yet. If you ask me about this in 6 months, I may have a completely different view.

I do not find typing to be onerous. When it comes to code reduction, I do not think about it from the initial creation standpoint; I think about it from the readability standpoint. How readable is this code? Is it simply unfamiliar right now? Will it get more comfortable with use?

These are all questions that we need to deal with when we write code.

Idiomatic C#?

In Marek's article, he worries that we are near the end of idiomatic C# -- meaning a standard / accepted / recommended way to write C# code (see the section "End of idiomatic C#?"). Personally, I think that we are already past that point. C# is a language of options that are different syntactically without being different substantially.

Expression-Bodied Members

For example, whether we use expression-bodied members or block-bodied members does not matter to the compiler. They mean the same thing. But they are visually different to the developer, and human minds tend to think of them as being different.

var

People get too attached to whether to use var or not. I have given my personal views in the past (Demystifying the "var" Keyword in C), but I don't worry whether anyone else adopts them. This has been treated as a syntax difference without a compiler difference. But that changed with the introduction of nullable reference types: var is now automatically nullable (C# "var" with a Reference Type is Always Nullable). There is still a question of whether developers need to care about this or not. I've only heard about one edge case so far.

Target-typed new

Another example is target-typed new expressions. Do you prefer "List<int>? ids = new()" or "var ids = new List<int>()"? The compiler does not care; the result is the same. But humans do care. (And your choice may be determined by how attached to "var" you are.)

No More Idiomatic C#

These are just 3 examples. Others include the various ways to declare properties, top level statements, and whether to use collection initialization syntax (and on that last one, Visual Studio has given me some really weird suggestions where "ToList()" is fine.)

In the end, we need to decide how we write C# moving forward. I have my preferences based on my history, experience, competence, approach to code, personal definition of readability, etc. And when we work with other developers, we don't just have to take our preferences into account, but also the preferences and abilities of the rest of the team. Ultimately, we each need to pick a path and move foreward.

Happy Coding!

Read the whole story
alvinashcraft
35 minutes ago
reply
West Grove, PA
Share this story
Delete

Biden signs TikTok ‘ban’ bill into law, starting the clock for ByteDance to divest it

1 Share
Photo collage of the TikTok logo over a photograph of the US Capitol building.
Cath Virginia / The Verge | Photo from Getty Images

President Joe Biden signed a foreign aid package that includes a bill that would ban TikTok if China-based parent company ByteDance fails to divest the app within a year.

The divest-or-ban bill is now law, starting the clock for ByteDance to make its move. The company has an initial nine months to sort out a deal, though the president could extend that another three months if he sees progress.

While just recently the legislation seemed like it would stall out in the Senate after being passed as a standalone bill in the House, political maneuvering helped usher it through to Biden’s desk. The House packaged the TikTok bill — which upped the timeline for divestment from the six months allowed in the earlier version — with foreign aid to US...

Continue reading…

Read the whole story
alvinashcraft
2 hours ago
reply
West Grove, PA
Share this story
Delete
Next Page of Stories