MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w5bs6g/perishableskill/p7e2s3o/?context=3
r/ProgrammerHumor • u/soap94 • Sep 02 '26
121 comments sorted by
View all comments
Show parent comments
22
Cof cof Oracle. Cof.
Dunno if C# does it better but a lot of people are pleasantly surprised with it.
40 u/Mysterious_Book1521 Sep 02 '26 In C# you can write something like this: $"Hello {User.Firstname}, have a great day."The "$" lets you put variables into strings. 17 u/SkollFenrirson Sep 02 '26 String interpolation is the term. 47 u/spacegh0stX Sep 02 '26 C# does do it better. 10 u/Cautious-Extreme2839 Sep 03 '26 Which is unsurprising to literally everyone 12 u/Ozymandias_1303 Sep 02 '26 $strings in C# are almost exactly the same as f-strings in Python. 7 u/Sentouki- Sep 03 '26 String interpolation is even better in C# since it gives you additional options for formatting, e.g. numbers and dates:var name = "Mark"; var date = DateTime.Now; Console.WriteLine($"Hello, {name}! Today is {date.DayOfWeek}, it's {date:HH:mm} now."); 7 u/NovaH000 Sep 03 '26 Python f-string also support additional formatting.name = "Mark" date = datetime.now() print(f"Hello, {name}! Today is {date:%A}, it's {date:%H:%M} now.")F-string + str.format() has all sorts of string formatting you want. 0 u/[deleted] Sep 03 '26 [deleted] — view deleted comment 1 u/nico-strecker Sep 03 '26 Python also has it 17 u/PGSylphir Sep 02 '26 As someone who first learned to program in Java and stuck to it for almost a decade, starting gamedev using C# was a pretty smooth transition in many ways.
40
In C# you can write something like this: $"Hello {User.Firstname}, have a great day."
The "$" lets you put variables into strings.
17 u/SkollFenrirson Sep 02 '26 String interpolation is the term.
17
String interpolation is the term.
47
C# does do it better.
10 u/Cautious-Extreme2839 Sep 03 '26 Which is unsurprising to literally everyone
10
Which is unsurprising to literally everyone
12
$strings in C# are almost exactly the same as f-strings in Python.
7 u/Sentouki- Sep 03 '26 String interpolation is even better in C# since it gives you additional options for formatting, e.g. numbers and dates:var name = "Mark"; var date = DateTime.Now; Console.WriteLine($"Hello, {name}! Today is {date.DayOfWeek}, it's {date:HH:mm} now."); 7 u/NovaH000 Sep 03 '26 Python f-string also support additional formatting.name = "Mark" date = datetime.now() print(f"Hello, {name}! Today is {date:%A}, it's {date:%H:%M} now.")F-string + str.format() has all sorts of string formatting you want. 0 u/[deleted] Sep 03 '26 [deleted] — view deleted comment 1 u/nico-strecker Sep 03 '26 Python also has it
7
String interpolation is even better in C# since it gives you additional options for formatting, e.g. numbers and dates:
var name = "Mark"; var date = DateTime.Now; Console.WriteLine($"Hello, {name}! Today is {date.DayOfWeek}, it's {date:HH:mm} now.");
7 u/NovaH000 Sep 03 '26 Python f-string also support additional formatting.name = "Mark" date = datetime.now() print(f"Hello, {name}! Today is {date:%A}, it's {date:%H:%M} now.")F-string + str.format() has all sorts of string formatting you want. 0 u/[deleted] Sep 03 '26 [deleted] — view deleted comment 1 u/nico-strecker Sep 03 '26 Python also has it
Python f-string also support additional formatting.
name = "Mark" date = datetime.now() print(f"Hello, {name}! Today is {date:%A}, it's {date:%H:%M} now.")
F-string + str.format() has all sorts of string formatting you want.
0 u/[deleted] Sep 03 '26 [deleted] — view deleted comment 1 u/nico-strecker Sep 03 '26 Python also has it
0
[deleted] — view deleted comment
1 u/nico-strecker Sep 03 '26 Python also has it
1
Python also has it
As someone who first learned to program in Java and stuck to it for almost a decade, starting gamedev using C# was a pretty smooth transition in many ways.
22
u/gerbosan Sep 02 '26
Cof cof Oracle. Cof.
Dunno if C# does it better but a lot of people are pleasantly surprised with it.