About this episodeThis show covers C# a CLI language designed by Microsoft. This episode talks about over the air updates, decompiling, and Ubuntu. The…
This show covers C# a CLI language designed by Microsoft. This episode talks about over the air updates, decompiling, and Ubuntu. The tools of the day are VLC, a cross-platform video player and PortableApps, a collection of applications able to run off a USB drive.
★ Support this podcast on Patreon ★Transcript
From the publisherThis transcript comes from the podcast’s own feed, shown as the publisher wrote it.
C#
Anything just for our listeners? That's right. Anything for you guys to get you guys information you need straight from the source so I always sound like real journalists. Yeah, that's right. So, but yeah, I'm moving over to the Valley, and it's been kind of interesting. You know, I lived at home for the first few years of college, and then got my own place, and you know there's stuff kind of scattered—some stuff in my parents' house, some stuff at the place I live at now, and you know this has sort of been like defragmenting but for my entire life. So kind of like I think it's a useful process. Sometimes you end up with so many different fragments on your computer hard drive, and things start slowing down. You get some overhead, and so this is kind of how it was with me where I could never really find anything. I had some stuff my parents' house was getting
Right. My access for anything was slowing down, and so this is a chance for my family and I to sort of defragment. So we've been busy the past couple weeks doing all that stuff and getting ready for the move. So is it as painful as normal defragging? It is pretty painful. It's one of those things where you know, a disk access—so like you know someone getting mail or something—will cause the whole thing to restart. Oh yeah, it can get rough, can get painful. But what have you been up to?
Yeah. So, you know, checking the news today and saw these a couple of different people were reporting that I guess it's still kind of a rumor thing as everything is with Apple until Apple decides. As Apple people put it, until Steve decides to announce it. That's right. And so they're saying that the new version of iOS is going to allow for over-the-air updates. So you don't have an iOS device—oh, I guess you have, you might have an iPod Touch—but having an iPhone, I'm a frequent finder of plugging it in and having it tell me it needs to update and download, you know, like a very large file and update my phone fairly frequently. So it's kind of a pain. It's pretty annoying to have to, you're trying to sync up and get everything loaded, you know, get your new podcasts on your device so that you can listen to them because you're out of good stuff to listen to. And so you plug it in and then you got to like wait for it to download and do its thing, and it's kind of annoying. So pushing it over the air would be interesting that you wouldn't have to do that anymore. It would just, you know, all of a sudden say anyone's available or just, you know, do it. But of course, you know, it leads to a lot of problems, right? Like, you know, these are complicated devices with different than a feature phone, which is pretty small amount of code relatively speaking, to something like iOS that, if you're trying to push an OS update like that, then it's pretty complicated. But I think this is the common place on Android phones that they do over-the-air updates eventually, but it's always a little bit takes a little bit longer and everyone makes sure it's going to work because you don't want it to fail or crash and all that stuff.
Yeah, one of the interesting things about it is you have to have a sort of—you have to be rather solid like in your API. You know, if the API changes as a result of the update and that breaks one of your apps, and this happens while you're on the road or while you're out on travel, this could cause a serious problem. Let's say you had some app that was storing something that was very important, you know, some time-sensitive like where your appointments are, at this destination. You're on work travel. Yeah, now the iPhone pushes out the update that changes the API, breaks your app, and you're hosed until you get back home.
Yeah, so hopefully then maybe they would limit this to only minor revision numbers and not major revision numbers. I don't know how that's going to work, but that's interesting. So this is, I guess as a software developer, you got to think about this. You know, how are you going to update and push out patches to your code? And then additionally, what's going to happen when you have to support multiple different users at different version numbers? Because that becomes a big deal, and it can be very complicated to manage that. I know especially people doing web programming—that's a huge mess. Is how do you know all the different browsers are out there and all the different versions of those browsers? And it can just be a really large pain, right?
The one who seems to have it the best at least from a user experience standpoint is Firefox. Like Firefox, when you update it, it goes online and tries to find updates automatically for all of your extensions. And um it must have some metadata in the extension where, you know, host side, the extension can say I support Firefox version 4.01, and if you upgrade to 4.02, it tells you that this extension might not be supported. But then maybe as soon as 4.02 comes out, the extension writer on his side says oh, this 4.02 works fine with my extension. No changes were necessary. Or maybe they make the changes and when you upgrade to 4.02, it either upgrades the extension or it doesn't. It says you're good to go. So Firefox seems to have this streamlined. Well, I
It just does it right. It just auto updates for you. So I mean, they're obviously—that's another way to do it, keep everybody forced on the same version. Yeah, but no, it's something to think about because it makes a big difference. And like Jason was saying earlier, if you auto update and choose to go that path without prompting people, and you ruin something, you know, you're gonna have a lot of angry users at you. And for somebody like Apple or, you know, Google, or the Mozilla Foundation, you know, they may not care that, you know, a thousand or even ten thousand of their users get upset that, you know, auto update pushed out and broke something. But if you're like most people and you work for a client base of just a few people or tens of people or hundreds of people, if you get any of those people lose work or clients or money because of your crashing, you can have some explaining to.
Do? Yeah, you're in trouble. You know, I've always felt like there should be—you know, I feel like InstallShields have been very streamlined and have become very open. Like there's that NSIS Nullsoft Scriptable installer system, and every installer kind of looks the same. You know, every open-source installer looks the same. It's because it is the same. There's this—there's this package of open-source software that has installers, but all of them are static. There is no like open-source living installer which you know will keep updating your software. And so if the latest open-source software I've created, which is this MemeHub project, I've actually tapped into Google Code. I created a Google Code project that just has the binaries of my open-source project and one that has the source code. So I end up with two Google Code projects: the binaries project, I just do an SVN update. So I'm relying on something that's meant for source code, but I'm using it sort of hacking it so that it works on binaries. Binaries, and that's.
Right. Everyone has to have the latest version otherwise everything falls apart in this. Yeah, that's interesting. Yeah, so there needs to be like an NSIS for applications that have a lot of updates, which is most open-source applications. So there needs to be some framework—someone needs to, you know, try to buckle down, maybe, you know, Apple or Google or one of these big companies, and just release something out to the public, which I think that will help development and help, you know, the user base of these, you know, rapidly evolving applications.
Yeah. Well, some stuff will be harder to do because they—you might not ever close it. Like some stuff just runs all the time or server software just runs and runs. So that's where something like Erlang's, you know, hot swapping could be really cool, where you don't even have to bring down the software; just the next call to a function just goes to the new function instead of the old function. Yep. And so that's pretty cool. So stuff like that is really interesting. Yeah.
So I'm going to talk a little bit about decompiling, which is something that you don't hear very often. You know, probably most of you out there have heard of compilation and compiling source code, but decompiling is actually taking, you know, an object file—something you compiled already—and, you know, often it's the machine code or the assembly code—and taking that and reverse engineering it automatically. So a computer program that turns that back into source code, which is, which is more human-readable. Interesting.
Right. So this comes with somebody explains a they offer a decompiler on GitHub that you can download and play with, and they offer an explanation on how decompilers work with flow charts and all those cool visuals, and a little step-by-step tutorial on what the process is of decompiling. And so I felt like this was very interesting and very relevant to anyone out there who writes code, you know, in a commercial setting, or anyone who wants to take programs and you want to say, 'I wonder how this works,' especially if it's maybe a smaller simpler program or if it's a DLL, a piece of a program. You know, for example, the guys who write the hacks for 3D games, like the people who went into Counter-Strike Source and wrote that hack so you could see through walls—well, they used a decompiler. And wait, people cheat? I know it's what it's—a tragedy. My world is shattering. I think the world is just falling apart. The Omni Mic has just broken in half. But yeah, the way these people do and now you know a lot of this they get caught and things like that. So we don't recommend anyone cheat on Counter-Strike, and this isn't one of those.' You know.
That, as we say, nearly every episode, neither of us are lawyers, but I believe decompiling actually is against the DMCA. That's right. If it's a copyrighted, you know, controlled source or controlled executable—in other words, you know if you try to decompile something in Windows or Source, you know Steam, you know if you try to decompile any of those things that basically someone hasn't given you permission to do, yeah, bad stuff can happen to you. So don't do that.
Often what you would do with the decompiler—what one would do is to take against a program you have permission, that's right, is to take one of the DLLs of that the program is using, one of the dynamic libraries. Often the libraries might be open source, like as the case with GLUT. There's something called FreeGLUT, and say you know what are the function calls for this? And so if you were to decompile GLUT, there's some function in there that has to do with, you know, rasterizing triangles or setting up the OpenGL state. And in that function call, it pat, you might be passing in an alpha value. So you can actually by using a decompiler, you can go to where it initializes the GLUT state and by default make every triangle an alpha value of 50, so make every triangle transparent by default unless the game specifies otherwise. So chances are, you know, in Counter-Strike 1.6 or whatever, all the triangles, you know, they didn't care; they just made everything solid or they didn't specify. So by going in decompiling GLUT.dll, going in the source code and making all the triangles transparent, then recompiling, making a new GLUT executable and putting that back in—now you've changed the game. You've made it to where everything is transparent, and you can see right through walls and cheat and see your enemies before they can see.
You. That's crazy. So I'm not an expert that much at all in decompiling, but the way that I mean, the transformation to go from source code to executable is fairly lossy. You lose a lot of information. So when you decompile, you're not finding—you're never going to find the original source code. You're just finding an equivalent representation of source code. So let's say C that could have generated that executable, but you have no way of telling if it is the C file that generated it. In fact, like you're not going to get variable names and stuff like that; those will be just, you know, machine-generated. But you could have some somebody could have written a for loop, and you could decompile it as a while loop with a counter. Right after that, a machine code is exactly the same as what a for loop looks like.
Right, right. So it like Patrick said, it's a lossy, you know, compiling is a lossy operation. And so the code will often look just vastly different. And so oftentimes too there could be errors in the decompiler, and when you when the code's recompiled, there could be corner cases that now fail whereas it would have result not fail but return something different than they did before.
And I guess it causes problems with when you're in a high-level language like C or C++, but or higher level language like C or C++ or the higher you go, the worse it gets because one instruction can map to many assembly routines—assembly instructions. And so trying to figure out heuristically what high-level instruction compiles to what machine code and then go back, I guess you look at call graphs and stuff like that to understand what the structure of the code is, so you can try to restore that. And right, find patterns now.
There is decompiling at many different levels. So for example, let's say I gave you a pyc file which we talked about on the Python episode, which is, you know, an executable or a binary file for the Python Virtual Machine, not for your actual machine. You could go from a pyc file to a py file. So you're not dealing with any machine code; you're going for a machine code from machine code for this fake machine to the source code for that fake machine. So often like you'll have Python decompilers, but they won't actually deal with the assembly, and you'll have C# which is the language we're getting into actually comes with an obfuscator which is designed to prevent decompiling of the CLI code back into C#. And we'll talk about that a little more later.
Read. Yeah, interesting. That's a good thing if you ever need it. There's a couple of tools out there to do that and a bunch of kind, but that's a whole art unto itself. And one place I know that a lot of decompilation is used is viruses. We were trying to think of this earlier and I just slipped my mind, but viruses and malware. People will decompile them because they want to understand better how they're working and what they're doing so that they can write detectors for it, prevent those specific problems from happening again. So there's people whose lives are or her work lives are devoted to decompiling malicious software and understanding, you know, what it does and where it came from because most viruses don't come with source code, right?
That's right. And on the other side of it, people writing viruses they want a way to have many different ways of injecting the same virus. So if they can look in an executable, they can generate the call graph from that executable and then they could put certain lines of the virus—they could split the virus up into modules and run different modules at different areas of the EXE. So it's not just one big block of the virus, and that can be harder for things like NOR an antivirus to detect. Very cool.
Very cool. Well, the next thing I was going to bring up—I guess this gets kind of political—but you know at AT&T first has been the first major U.S.-based ISP to roll out caps for their broadband plans. So before it was always just kind of like however much you want to use, that's fine. Or if you were using way, way too much, you know terabytes of data torrenting all day, then you know you might get a knock at your door or a letter or, you know, whatever. But that, you know, there wasn't stated caps; they just let people do whatever. And now not only are they giving caps, the caps are pretty low. It looked like, you know, I was looking for DSL, it's 150 gigabytes, and for Uverse, 250 gigabytes. That's not.
At all. I mean, some Linux distributions can easily push, you know, four or five gigabytes. If you're streaming HD movies from Netflix, you can hit that cap pretty quickly. Those are low caps, you know. When I first saw this, I thought people—I agreed that the idea of going to capping is bad because I feel like it's going to stifle innovation. And right, you know, you're not going to know what will never exist because people can't use their bandwidth to the fullest. But at the same time, I understand there's a lot of people out there abusing it, and I figured that the cap would be really high, but it turns out 250 gigabytes is not really high. That's just a little high, but you could easily conceive of where you might hit that. Yeah. I.
Mean, let's say you're testing Linux distributions and you download, you know, five or six of them, and let's say, you know, in my case, I have a 32-gig, 32-bit PC and a 64-bit PC. So I have to download a bunch twice, so, you know, and that's just tertiary to your just daily usage of the internet and YouTube and things like that. That's just on top of those things. So yeah.
I I don't—I don't know that much. Many people like this. I mean, I understand that they—I guess they're a business, right? And they're losing money, so they've got a they can't keep spending money to keep up with the top one percent of users, so they got to come up with some way to do that. But I just feel like this isn't the right way. I feel like it's too potentially them motivated by trying to prevent the streaming of internet video that.
Wasn't watching it. I watched my stuff on Hulu and Netflix and YouTube, and you know, I have my PC hooked up to my computer or my PC hooked up to my computer—my PC hooked up to my TV, and I just watched stuff from my from the internet, and so I don't need cable. It was a it was a waste of $50 a month for me. Yeah.
I believe when I move, I'm actually not gonna—I'm gonna try and go cable-less. So I've been with is this is this because of me? Have I inspired you? You have it actually is because of you. No true story. Um help me, but no. I when I was—I don't know when I was sometime in high school, I was really asking, oh, I want cable, and it was when, you know, South Park was new. I really wanted South Park to watch South Park, and so we got cable, and I've just had it ever since. I'm going to try to go cable-less, and you know the big thing that you miss out on is sports. Sports. Yeah, and so but now like a lot of them ESPN.com is doing streaming on the internet. Yeah.
The problem is, I agree. I 100% agree. On my iPhone, I have the unlimited data plan; I was grandfathered in. And I look at my total usage, my average usage. So if you take, you know, how much I've used total since I've had it divided by the number of months I've had it—you know, I probably just offended a bunch of people that had to explain that—but if you if you do that right, my average is like way low. It's not that big at all. And in fact, it's, you know, basically smaller than their small plan. But then there is one or two months relating to when I was normally on business travel or personal travel to places that didn't pay for internet in the hotel or whatever that I use my iPhone a lot, right? On those months, I went well over those low caps, right? And so those months, I would have been smacked with a huge bill.
Yeah. The other thing too is it seems like—and I don't know too much about network infrastructure, but I'll go on a limb here—it seems like the solution to this is to is something akin to IPv6, right? Where the internet is multi-tiered, and so for example, if let's say we're using IPv6, we're both under the same like fifth or sixth octet. So we'd still be under BrightHouse. Um, in this case, we could I could maybe query your computer and say, you know, hey Patrick, have you watched this YouTube video? You know, or anyone else within my neighborhood, let's say, and say have you watched this computer this YouTube video? And if they have, get the video from them. It seems like you could more intelligently distribute the bandwidth, you know, if bandwidth is really the issue and not just making money. Yeah.
I agree there was an incentive to pioneer those efforts, though. I mean because ultimately people are just going to use them to not pay for cable, and since a lot of the Internet Service Providers are also content distributors right in the United States, I don't feel like they would be motivated to do that. But you're right. I mean, that's how—and this is not by any means my expertise—but that's how cloud centers work a lot. Like if you're at a data center, if you're transmitting within the data center, you basically don't have to pay bandwidth costs, right? Only pay bandwidth costs if you have
you go through your non-direct access broker—so you know, just like an E*Trade or a Charles Schwab or Scott Trade—yeah, then they'll try to match your orders within their own customer base because then they don't have to pay a commission. But they don't have to pay a commission, right? And then if that doesn't work, then they try to go to like next neighbor partners and slowly work their way up and out of the last resort, you know, put it actually on the open market where they have to pay all sorts of fees.
Stuff, right? So the infrastructure is—I mean not the infrastructure, but the historical use cases there. So I mean this, the idea of this, you know, different strata and you know trying to look locally. You know, these techniques are used in many different avenues, and the fact that they aren't used in the Internet distribution mechanism and instead they're going for bandwidth caps makes me think that it's not actually based on these huge operating costs, but it's based more on just restricting content. So talking about bandwidth caps would
That's right. So I definitely would have hit just about any bandwidth cap because Natty Narwhal came out, which is Ubuntu 11, and I went ahead and got the 32-bit and the 64-bit. I think I got there was one that was DVD size, one a live CD I may used to get it on a USB stick for one of my computers that doesn't have a CD drive. So I went ahead and updated to Ubuntu 11, as many of you know I'm a huge Ubuntu fan. So how do you like it? I think it's awesome. You know. So what are the
Fail. That's right. So yeah, one thing about Ubuntu is they also adopted—they adopted the, uh, you know, Windows Aero, Mac OS X idea of using the GPU and to do, you know, graphical effects and to run the window manager. So I mean, it's really slick. It's got different; it actually pops up from the side, I guess. They just got to be different than, uh, than Windows and, uh, OS X, which have the bar by default at the bottom. But yeah, this bar comes up on the side. It's very search-driven, which I thought was interesting. So at the first time, you know, if an app isn't pinned onto your, um, you know, taskbar, and most of you who run Windows, you know, 7 or Vista or OS X know what it means to pin something—if it isn't pinned on there, you have to search for it by typing in the beginning letters of the app you want rather than having like a Start menu or something like that. Doesn't even have a Start menu anymore. Yeah, that's right. So it has like these categories and then you can kind of scroll through, but it's very, you know, it's not encouraged to do. Yeah, yeah, you're definitely encouraged to click on the Start button or I guess the Ubuntu button and just start typing, like if you
I think I'll go back and find out. I think it will be an Arwall the whole time. It's just laughing at me, but you can click on it, start typing in Xterm, and Xterm will pop up. But yeah, the interface is slick. There is one issue which is, you know, because it uses direct rendering, it uses OpenGL. It doesn't play nice with VNC, which is the um what does VNC stand for? Do you know?
On. Yeah. So Virtual Network Computing. Ah, there you go. So, you know, VNC is a way that if you don't have a monitor—if a machine is headless, you can get a GUI onto that machine. All right. What is headless? So, headless means that there's no actual physical keyboard or monitor. So, for example, I have a server, you know, in the office room which just sits and runs. It has no USBs coming out of it plugged into anything. It just has the network cable. And so right, yeah, the power probably something else, but um but yeah, basically what I do is I VNC into that machine and I get a picture of my desktop inside of, you know, another computer's, you know, windowing interface. So VNC has issues with Ubuntu 11, and it turns out XDMCP, which is, uh, you know, alternative to VNC, also doesn't work in Ubuntu 11, but there is something called FreeNX, and I was a little skeptical to install it because um, you know, the installation process is a little bit, you know, time-consuming. It was this multi-step process. You have to get on the internet, but I went through the process. I can spare you guys the uh the angst by telling you that it definitely works, and it's it's sharp, and that's—that's the way to go if you have a headless, headless machine running Ubuntu 11. So everything
Come on. Oh man, oh the other thing. If you run VirtualBox, which many of you do, and if you don't—if you've never used Ubuntu before—VirtualBox is a program which lets you run a virtual OS inside of your OS. It's completely free, and you can use it to test out Ubuntu and find out if you like it and if it's if you want to switch over to it. But if you use VirtualBox, you have to change some of the VirtualBox settings to make it work with Ubuntu 11. So go on the internet and look that up. Yeah, that was my case. I installed
VideoLand something anyways. And so VLC is a movie player, open source, and what it does really good is it supports all the different operating systems and it allows you to play pretty much any protocol or codec that you can think of—not every single one, but nearly everyone. I don't know if I've ever run across one that it hasn't, and it's really powerful. It's one of those tools that most people use probably like five percent of the features. You know, it does it'll do transcoding for you, so taking from one codec to another. It allows you to you can stream stuff over the internet. So you know, you could like log into IP cameras with it and stream video from live cameras, like security cameras—just tons and tons of things. But the reason that most people use it and the reason that I love it is because—and I don't know if it's compiled in or they have their own implementations—but basically all those codecs that if you ever try to run Media Player on Windows, or any sort of video players on any system, that they don't necessarily always have the right codec, you go find the right plugin and install. And it's annoying. VLC just has all of that in its package. It's just handled for you. It's taken care of. So if you have a file that won't play or says can't find codec or whatever the error is, I always try to play in VLC, and they seem to have a really robust implementation that files that won't work in anything else tend to work in there. So whatever.
That's true because yeah, I guess proprietary. Yeah, but yeah, their own unique, their custom format. Um, yeah, VLC—most of the codecs are based on FFmpeg, but um they've you know hacked it a little bit to be a little bit more robust. As Patrick was saying, the thing I like the most about VLC is that, and maybe you could do this in Windows Movie Player, but I haven't been able to do it. You can open up several videos at the same time, like several instances of VLC. Like, I well, I
To me, man, acting on you? Yeah. All right, but one cool thing that VLC—so VLC, you can just download it. It's not that big install it, you know, and be off and running. And be so glad you heard this tip, and it'll save you tons of time and pain and harassment. But um a thing I like to do is put it on my thumb drive, and they have a portable version, which we're going to talk about here in a minute, a bunch more, but a portable version just means that you know you install it on a USB drive, and you still have to know what platform you're going to be on. So in this case, it's you know like a Windows one, and most of these portable apps are Windows apps.
Similar things for Linux as well. It's a little different case there, but you put it on a USB drive and what it does is it only writes locally. So if it writes anything, it's going to write it local to whatever the install folder is, or it's not really installed, it's just extracted there, and or it won't write anything at.
have VLC the portable version on your USB, it doesn't change the registry. It doesn't install anything. So you stick it into a computer and as long as you can see the USB drive, you can run it, and then you can watch videos. So if you're ever at somebody else's house or whatever and you're trying to show some video and they don't have it, they don't have the right codec, whatever, instead of going out and trying to figure out what you got to install, you just open up VLC.
Tool of the Bi-Week actually. It relates a little bit to our last podcast, Recovered MATLAB, but it's FreeMAT, which is a free and open source version of MATLAB that includes like the GUI, the you know version of Octave, I believe, to handle, you know, the virtual machine, and it's also something I have on my thumb drive. So there's a website portableapps.com, and we'll put a link to this on the you know on the episode in the blog, but basically the way PortableApps works is you install this PortableApps, um I guess what would you call platform onto your USB stick, and it's like a launcher. It's really you don't have
And so you it actually the new version is pretty slick. It creates a second Start menu as long as you have your USB stick plugged in. So you have your regular Start menu with the all programs and the Control Panel and everything, and it pops up the second Start menu, which is your PortableApps menu, and you see all the apps on your on your thumb drive, and you can use this in airports at airport kiosks, you know, public terminals. You can use this like hotel lobbies, and you have access to all of your apps. So you almost have a fully functional computer like you can carry around many of your favorite applications with you wherever you go, and it's very consistent. So definitely check out PortableApps, and if you liked their last podcast on MATLAB and want to kind of play with it in a very controlled environment, definitely check out the FreeMAT portable app.
Yeah, if you've used MATLAB before, you know, I've used MATLAB and used this before, and they're both extremely similar. I mean, the syntax is virtually identical. So if you have a certain graph or a certain set of data points and you just want to see what that looks like on paper, this free Mat application will still get you where you need to go. But yeah, it's interesting. It looks like it's not based on Octave or any of
Way. Yeah, that's yeah, pretty much like this is a true story, right? Um Anders Heilsberg from—he's a Danish software engineer, so take your word on it. He was the original author of Turbo Pascal and he was the chief architect of Delphi, so um he definitely has a strong background in programming languages. And so he's currently the lead architect of C#. And he was also the—the
our audience. Oh, oh, I see you—the fourth wall. Yeah, but basically, you know, Sun came out with Java, which was very popular, was adopted by the academic community very early because of its, you know, um because of it being completely open source, or at least I should say open standard. Java was an open source but and cross-platform.
it has become more open in—you know, there is like an OpenJDK now and things like that. But at any rate, the academic community jumped on it. They also have many different, you know, advantages which we'll talk about later. But Microsoft sort of wanded in on this, and so Anders Heilsberg went to Microsoft and started working on J++, which was Microsoft's implementation of Java. So basically there was a lawsuit. Sun sued Microsoft. As part of the settlement of that lawsuit, Microsoft had to abandon J++ and cease work on that. So that's when Anders decided to make a new language called C#. And so that's kind of where C# was born from as a competitor.
Yeah, so as people who you know frequently listen to our podcast know many of these machines are interpreted and they run on a virtual machine. So as the case of Python, you have a Python Virtual Machine with its own, you know, virtual RAM and virtual instruction set, etc., and we talked about that with the pyc files, etc. And CLR is the Common Language Runtime, which is just a fancy way of saying the virtual machine. Okay? For C#, interestingly though, there are several languages that can run on the same virtual machine. So if I'm remembering right, the
Yeah, you'd have to be quite the guru to do that. Most people, interestingly though, so in the case of Python if you want to create a pyc file, you have to use the Python programming language, not—the case in C#. You can use C#, ASP.NET, there was C, there's Managed C++, which is another language, Visual Basic .NET, JSharp. All of these languages compile down to the same CLI code that runs on the CLR. So
And so you think about it, they're trying to consolidate because Microsoft has this huge base. They have a lot of people—or at the time they had a lot of people using ASP in Visual Basic. They had a lot of people writing C++, like what are those called? Like C or C++ in a web application, CGI. Oh, people writing CGI modules in C++. There are people, you know, starting to adopt Java that needed something to fall on.
One machine to unite them all. So one to bind them. Yeah, that's right. And so they'd use CLR and CLI. So now a lot of this is like Microsoft, you know, kind of research closed doors, like them sort of, you know, hashing this out, and it's not open source at all, but some people have gone on and tried to open this technology now.
the CLI? Oh, they're sneaky! That this is very well themed. We've been talking about auto-updates all along, but yes. So they give that away for free, right? But then the compilers and the tools—I mean, that's the stuff that they make their money off of—is the the compilers that compile from these languages to these bytecode forms, right? And as we
moon. But um yeah, no, I mean the Mono is kind of answering my own question, kind of the answer to an open-source CLR CLI so that people could port it to Windows. Otherwise, somebody would have to, you know, like we talked about before, either you know reverse engineer the CLR that Microsoft released or look at their standards and try to create it themselves. But the Mono allows you to actually do that; they've done that for you.
Yeah, I don't know. I think there's a lot of enterprise people on Windows who use C# for a lot of stuff. I mean, personally, I've used it for GUI development and works really well for that on Windows if you just need to bang out really quick Windows app. Oh, that's true. So I mean, I feel like it has a lot of uses. You know, we were trying to look around and see, you know, what major well-known programs or projects use it. We couldn't find a lot, but I think it has a lot of use—a lot of people doing not just web stuff, but a lot of other stuff in it. It's actually reasonably good to work, and I like it a lot for having to do Windows.
Right. So I mean, you can just drag and drop buttons onto, you know, while you're in Visual Studio. You can drag a button onto a frame; it'll put that button there. You can double-click on it, and it'll create a function—a callback routine which will get called when you click the button. Uh just, and it'll take you right to the code where you can just start banging away code when someone clicks this button, I want to increment this variable, and so it's very efficient, very quick.
But similar to, you know, Microsoft's implementation, you can program in C#, F#, Java, Scala, Boo, Merrily, VB.NET, Python, JavaScript, and the list goes on and on. You can program in any of these languages, and Mono will find a way unless you're using some crazy specific library to convert the code that you wrote into CLI.
Yeah, so a lot of those languages actually have variants of them that run, and for the CLR CLI, I'm confusing those. I'm probably getting them wrong, but that's okay. So like, for instance, Python, right? Is IronPython, I think, right? Name that's right, the dialect name what you are. It's not exactly the same because it's a different implementation. So there's nuances that are different, right? Um, you know, I think there's also an IronRuby. Um, so something similar that, you know, I don't know what the Iron thing is about, but yeah, so they've got dialects that there are for instead of compiling down or being interpreted to whatever you interpret them for this. So anywhere where you have the CLR, you can guarantee that it's going to be able
to run, right? The biggest thing about the um and this is sort of pedantic, but we'll talk about it for a little bit, um the .NET Framework and the CLR. The virtual machine doesn't support reflection, and they're working on it. Actually, think the next version will support reflection, but so many of these like IronPython and IronRuby what they've done is they've taken the self-modifying code and the reflect reflectivity. They've taken that out of the language.
No. So do you know what reflection is? I'll put you on the spot. No. I—I could guess it's not going to be pretty. Okay, just take—I'll give it a shot. So this probably won't be pretty either, but I'll try my best. So reflection is essentially knowing about the language while you're inside the code at runtime. So in other words, in C++, you create a class called Foo, and that class has an X and a Y position, and you can put Foo at different places on a grid or something like that. While you're running the code, the code just knows about memory and pointers, and adding it doesn't know about Foo. You know get it? Again going back to decompilers. Decompiling is so hard because the machine code, the assembly code what you get at the end of a compiler, doesn't know anything about classes or structures or functions or any of that. So in contrast, if a language is reflexive, that means that the details of the language—so the classes, what variables are in that class, what kind of type those variables are—is built into the executable, and so you can do things like take all the variables inside Foo and add one to them. So that's something you can't do in C++. So you'd have to say Foo.X plus one, Foo. Y plus one. But you know, in Python you can say take all the variables in Foo and add one to them because the language at runtime knows about itself. So
is this how something like Python also handles dynamic typing? Right? That's right where you don't specify what a variable is and so it can't be known until runtime. So reflection is what has to be used for the code to be able to determine at runtime what type it is and what to call when you do a plus one, is that a string and you're adding the character '1' to the string or you know doing something different? Or is it just an integer? Is it a float? Because all that has to generate separate code. So that's how they at runtime determine what code to run.
Yeah, reflection kind of. So so there are some things which are done with what's called a virtual function table, so you can say, you know, A plus equals one, and then you have this vft table, and this even exists in C++, which says okay, A is a string, so that means I need to call this plus routine. Or A is an integer? A is a float? So call different routines. But um that works only at a low level, so dealing with an individual object, but it doesn't know about the higher structure. So you know something like what you described is like reflection at a really low level. Okay. So that's more powerful than that. Yeah, so reflection implies this high-level reflection that includes like the classes and the functions and things like that. All right? Yeah, so it's pretty cool. Yeah, it's good stuff. So um what do you think are some strengths of C#? Yes, I mean, I already
talked about one a little having done, you know, a fair amount of C# program—not not a ton. I mean, there's it's not my primary language, but you know again a lot of the purpose of this show is to talk about tools in the toolbox, and I think C# is definitely one if you're going to do Windows programming and you need to do GUI, it works really well. I don't know why I'm obsessed with this as being the main strength, but it just is like I—I really like that fact, and I never really did good GUIs or had good success doing GUIs. Felt it was complicated, never made a lot of sense, and was hard to do. And I don't know if it was just Microsoft's products maturing to the point Visual Studio maturing by the time I started using C# or if it was a fact of C# itself, but that's what I really like doing.
I mean, you know C# has a, you know, a GUI for creating the GUI code. So in other words, you can drag and drop different buttons as we talked about, and so you know when you're creating a GUI, the whole experience is very visual even from a developer standpoint, and not many tools out there give you that sort of drag-and-drop whizzy wig sort of feel as C#. So what about you? What do you like? One thing I really like about it, I use this in a previous job. It's the dynamic HTML support. So it's sort of like PHP if you've ever used that where you know you want to make some website which is driven by a database or by some other data source or by some logic maybe based on time. C# can do all of that similar to PHP, but I feel like it's a lot cleaner than PHP, and so it lets you do some pretty complicated things, and especially if you're using the Microsoft SQL database, those two work in tandem to really make web programming easy on you as a developer. I talked
a little bit about knowing C++ and using C# from there. But also I mean if you have some C++ code that you need to call in C#, that's not a terribly complicated thing to do. I've had some C# GUIs I made that needed to, for instance, use some serial communications code that talked out over the serial port, and I was able to pretty much just put that in with very minor massaging, able to get that to work in there. So that was really easy. A lot of languages claim they have good C/C++ integration, but here it really is good. Yeah.
A lot of languages suffer there, and C# excels there definitely. And it's because we as we talked about, you know, you can compile C++ and C#. They both get compiled down to the same language, which is that intermediate, that CLI. So that's what makes it so easy. One of the weaknesses I think about C# is, and again, you know a lot of people compare C# to Java because it was created sort of as an answer to Java. And C# doesn't have an Applet, really no language other than Java that I know of. And I guess C++ are using ActiveX controls and things like that, but nothing besides Java does the Applet where you know have this box in a website and that box just runs Java, the Java Virtual Machine. You can do whatever you want. You can write any logic you want. You know, C# can create HTML, can output HTML, but Java can actually run inside of the virtual machine and do computation on the client side. Interesting.
Yeah, it's kind of a love-hate relationship with me and Applets. They're kind of a cool idea, it's kind of nifty, but oftentimes they're just so slow to load and execute, and it'll crash a web page or your browser for no apparent reason when you try to go somewhere. So yeah, but it is definitely has its.
Uses. Yeah, yeah, definitely. I mean, you could see a lot of—I was looking at some website the other day on how red-black trees work, and they actually created a red-black tree in a Java Applet. Oh cool! And so you can kind of add nodes, and it could show how the leaves, you know, twisted up to create the balanced tree. And so something like that is just impossible actually now with JavaScript, which is something that we should talk about in a future episode. You know, things like that are possible with dynamic HTML and Canvas and all that, but but you know for a long time—I mean, for possibly a decade—nobody had this technology besides besides Sun and Java another.
So I had some colleagues who were also in the PhD program, and they did their work in C#, and they had a lot of issues when they transitioned their work over to the Linux cluster which was running Mono. For one thing, many of the libraries just don't exist or at least didn't at the time. So they're gooey—it would just they would try and say using System.Drawing, which was something that was built into the you know, they thought was built into the C# language, but on Mono it just would fail there and say that doesn't exist. On top of that, it ended up being extremely slow. So they were just getting orders of magnitude slowdown using Mono versus using the you know, the Visual Studio virtual machine.
Before we sign off here, I wanted to mention that we did get a one or two more ratings on iTunes. So thank you guys for that. Those of you who did that give you a little shout out here. You know who you are. Keep doing that. It's actually slowed down a little. So, you know, we want to keep getting those clicks so we can get reach a wider audience and you know share what we're doing. We really enjoy this. I like doing this, sharing this stuff. This is good material. It's hard, you know, if you're young and you're not at a university or if you're at university and you're not in the Computer Science department, or you are and you're not understanding it, or not in those classes yet, or once you get out, it's hard to keep up. And all this stuff is changing so frequently. Doing this podcast helps us keep up, but you know, hope it is helping you guys. And if anything, at least it's interesting and we make fun of ourselves and it mess up, and you guys can laugh at how wrong we are and how terrible we are, and it'll make you feel better about yourselves. So no, but we enjoy doing this, and we want more people to be able to hear us. So yeah, tell your friends, write some reviews. Yeah.
You later. The intro music is Axo by Binar Pilot Programming. Throwdown is distributed under a Creative Commons Attribution-ShareAlike 2.0 license. You're free to share, copy, distribute, transmit the work, to remix, adapt the work, but you must provide attribution to Patrick and I, and ShareAlike, and Kind.
