Start C# From One Variable — and Learn to Read an IFC Line While You're There
A hands-on PAZ tutorial: scaffold your first C# console app with the .NET SDK, then read an IFC wall line as the same named variable. Notepad-proof, vendor-proof.
Signal. This week’s reading was, of all things, a W3Schools page on variables — the one that shows you favFruit = 'apple' and gently explains that the box has a name and you put something in it. It is the most basic concept in programming, and W3Schools lays it out honestly across four languages side by side — Python, JavaScript, Java and C++ — down to the three naming rules every one of them shares: no spaces, no leading digit, and no reserved words like if, else or for. So let us take the humblest idea in the field and use it to do something a working office actually needs: write your first real C# application on Windows, and learn to read the one file format that will outlive all of us.
System. Why start from a variable? Because memory is the binding constraint everywhere you look. PAZ’s own concept panel on context-window scaling makes the point at the frontier: for a large language model the cost of attention is O(n²·d) — every token has to remember every other token, and that memory is the wall. Scale a building model and you hit the same wall from the other side: a variable is the smallest possible unit of that memory, one named slot holding one value. Get the atom right and the whole structure ages well. Get it wrong and you get context rot — the model, or the project, forgetting what it was supposed to hold.
←TODAY: In 2026 a variable is still the atom of every model — a Python one-liner or a 400 MB IFC file, same idea. →3012: The Zurich-3012 archive opens at all because someone chose formats a machine could still parse. Fulcrum: A named value you can read in Notepad is the difference between a building that ages and one that vanishes.
The Tool: The .NET SDK and the dotnet CLI, built by Microsoft and open-sourced on GitHub, is the fastest honest path from “I have never written C#” to “I ran a program.” No Visual Studio install, no project-wizard maze — one command-line tool that scaffolds, builds and runs. It is worth a computational designer’s afternoon because C# is the language underneath Grasshopper’s script components and RhinoCommon: the same typed variables you learn tonight in a console are the ones you will feed geometry through later.
Setup:
# Windows: install the .NET SDK, then confirm it exists
winget install Microsoft.DotNet.SDK.8
dotnet --version
# Scaffold and run your first application
dotnet new console -o FirstBox
cd FirstBox
dotnet run
First steps:
- Open
Program.cs. Delete the generated line and typestring favAnimal = "turtles";— the exact C# line W3Schools shows, semicolon and all. - Add
Console.WriteLine(favAnimal);under it, then rundotnet run. You will seeturtles. That is your first Windows application storing and recalling a value. - Now try
int a = 2; a += 1;and printa. Notice C# demanded the wordintbefore it would hold the number — Python never asked. That refusal is the whole lesson. - Finally, paste the source’s own branch:
int temperature = 25;thenif (temperature > 20) Console.WriteLine("It is warm");. The same 25-and-20 numbers W3Schools runs in Python now compile in C#, unchanged but for the semicolons.
Street. Here is where the atom meets the site. IFC — Industry Foundation Classes — is arguably the most important language the AEC industry has produced in a century: an open, uncompiled text format you can literally open in Notepad, meant to hold an entire construction project as plain, readable values. Open a .ifc file and a single wall looks like this:
#123=IFCWALLSTANDARDCASE('2O2Fr$t4X7Zf8NOew3FLKn',#42,'Wall-Interior-01',$,$,#89,#95,'A-WALL');
Read it as variables, because that is all it is. #123 is the name — the line ID other objects use to point back here. IFCWALLSTANDARDCASE is the type, doing exactly the job int and string did above: telling you what kind of thing this box holds. '2O2Fr$t4X7Zf8NOew3FLKn' is the GlobalId, a 22-character GUID value. #42 references the owner-history object; 'Wall-Interior-01' is the human name; and each $ is an unset slot — a null, a box left honestly empty. The IfcOpenShell toolkit exists to walk millions of lines like this one. Learn to read a single variable and you have already read your first BIM object.
The trade-off of static typing is real, and worth stating plainly: C# costs you keystrokes up front that Python lets you skip — and pays you back the first time a wrong type would have shipped a broken schedule.
Atelier: For a Swiss studio, the move is not “learn to code” in the abstract — it is retiring one fragile Excel formula. Monday morning, run dotnet new console and rewrite your most-copied spreadsheet calculation — the one three people maintain and nobody trusts — as a 20-line C# console app with named, typed variables. It runs the same on every machine in the Büro, and it is the on-ramp to the Grasshopper C# component work we will cover in a dedicated PAZ special. PAZ Academy has taught and implemented Grasshopper 2 since the Alpha, and as a Rhino reseller (Rhino 8 + WIP now, Rhino 9 expected next year) we bring practices onto exactly this stack.
Hack: Declare a value and watch C# demand its type before it will hold anything. Paste this into Program.cs and run it — the difference from Python is the entire point of the language.
string favAnimal = "turtles"; // C# names the type; Python skips this
int count = 2;
count += 1; // same += / ++ shorthand as Java, C++
Console.WriteLine($"{count} {favAnimal}"); // -> 3 turtles
The $"{...}" is C# string interpolation — the clean way to splice a variable into text, no + and no to_string() gymnastics, which W3Schools notes both Python and C++ still make you do. One line, and you have typing, incrementing and formatting.
Move. The future warning from my desk is short: the buildings that aged worst were never the ugly ones — they were the ones whose proprietary format went dark and nobody could reopen. C# is a skill; IFC is an insurance policy. Pick a stack this quarter and ask one question — when the vendor disappears, can a 25-year-old still open the file in Notepad? Tonight, install the SDK, run one variable, then open a real .ifc and find the line that names a wall. Two boxes, same idea, sixty years apart. C++ makes you name the box, then blames you for it.
Learn-it:
- Source tutorial: W3Schools — Variables in Programming (the four-language walk-through — Python, JavaScript, Java, C++ — that anchored this piece)
- Where variables lead in AEC: IfcOpenShell — the open toolkit for reading IFC files as exactly the named values you just met
SOURCE · ↗
PAZ Kaffi · multidisciplinary editorial, led by PAZ Academy