tommy
tommy
CC#
Created by tommy on 11/17/2024 in #help
✅ How do Avro, ORC and Parquet work?
I have been learning about big data and these came across as a few of the popular "optimized file formats". I want to understand how they work.
13 replies
CC#
Created by tommy on 11/16/2024 in #help
✅ What is the use of `LogLevel` type in C#?
I have also tried to use this type by adding the using Microsoft.Extensions.Logging; directive, but this shows me an error that the Extensions type does not exist in the Microsoft namespace. How to use this then?
10 replies
CC#
Created by tommy on 11/13/2024 in #help
✅ How to add newlines in ASP.NET Web Forms?
What I have been doing is that making a Label and adding <br /> as its text. But this doesn't seem to be working on Firefox. Are there any alternative methods?
3 replies
CC#
Created by tommy on 11/11/2024 in #help
✅ Difference between `string[]` and `IEnumerable<string>`
in the following the code, the output seems to be the same:
using System;
using System.IO;

class Program
{
public static void Main()
{
foreach (string dir in Directory.GetDirectories("Settings"))
Console.WriteLine(dir);

foreach (string dir in Directory.EnumerateDirectories("Settings"))
Console.WriteLine(dir);
}
}
using System;
using System.IO;

class Program
{
public static void Main()
{
foreach (string dir in Directory.GetDirectories("Settings"))
Console.WriteLine(dir);

foreach (string dir in Directory.EnumerateDirectories("Settings"))
Console.WriteLine(dir);
}
}
i know that enums are used to define a set of exhaustive types, and are closely related to ints. but what does it mean to have IEnumerable<string> and how different is it from string[]?
23 replies
CC#
Created by tommy on 11/4/2024 in #help
why do we declare overloaded operators as `static` methods?
i have been looking for a simple answer that i can understand because i am beginner.
20 replies
CC#
Created by tommy on 11/2/2024 in #help
✅ Having trouble going from the old syntax to top level statements
i have been learning C# using the old syntax. i do not know the name for it, but this is what it is:
using System;
class Program
{
public static void Main()
{
Console.WriteLine("Hello, World!");
}
}
using System;
class Program
{
public static void Main()
{
Console.WriteLine("Hello, World!");
}
}
but now that i have started working on Visual Studio, i am having a hard time learning what is the meaning of top level statements. So, how to think about this, considering that i have learnt my basics over Notepad?
9 replies
CC#
Created by tommy on 10/22/2024 in #help
/reference flag in C# compiler
What is the use of this flag?
12 replies
CC#
Created by tommy on 10/19/2024 in #help
✅ difference between `MyClass obj2 = obj1;` and `MyClass obj2 = new MyClass(obj1);`
I am learning copy constructors and trying to know how to create shallow and deep copy constructors.
47 replies
CC#
Created by tommy on 10/16/2024 in #help
✅ what is a primary constructor? is it any similar to parameterless constructor?
the content provided on Microsoft Learn is confusing.
172 replies
CC#
Created by tommy on 10/10/2024 in #help
✅ difference between internal and file access modifiers
the content on Microsoft Learn is a bit difficult to understand.
46 replies
CC#
Created by tommy on 9/14/2024 in #help
Why do we enclose the `Main` function inside of a class in C#?
After learning C++, I think it makes sense to include the main function outside of a class. Why do we not do it in C#? Like what disadvantage I would have by not including the main function in a class in C++? Would it be accessible to everyone? Does including the Main method in a class in C# make it "safer" than it being present at a global scope? What is the reason behind this?
9 replies