Programming From Your Web Browser
Hey guys, this is Matt Kidson-Owen with a video on, as you can see by the video, obviously, um, on a site that I found called Codepad.org, which is really useful if you want to program on a computer where you don't have a compiler or an interpreter for the language you want to program in.
It's also a great way to store text and stuff online. So, you go to Codepad.org, and right off the bat, without having to create an account or anything—you can create an account—but without having to do any of that, you can write a program in any of these languages, um, including plain text, which will just store your text online.
So, I'll write a simple program and see here, and maybe I'll cut out me writing it so that way you don't have to watch. But anyway, by the way, tabs don't work in this because it's just simple HTML. It's a very simple page, so they didn't really make tabs work, but that doesn't really matter.
So, we can click submit and check run code, and go ahead and click submit. Um, and here it'll come out with some output. It'll just give us the program's output.
So, what it obviously did under the hood is it compiled this, and it ran it. Um, and I'm pretty certain this is using Unix because I was able to import some Unixy, um, headers and stuff. Anyway, yeah, um, another thing that people are wondering is like, what if you write a C++ program and you say cin
, so like, what, what, what standard input in this case?
Um, so if we do this and we say in main
, I wouldn't even bother writing this definitely. I'll say int cni
, and let's say we run this. It won't hang or anything, won't freeze. It'll just come out with no output. Um, because, you know, obviously cin
is just a pipe, and it just gives it an old pipe or a pipe to an empty file or something that immediately returns EOF.
Um, you can go to create a new paste. Obviously, you can do any of these languages, um, you can do like Python. A lot of libraries, I doubt there are a lot of libraries or functions that you normally have, like system calls. I doubt you can do those because that would just be too risky allowing system calls on their server.
Um, but anyway, this is—it's really convenient to have something like this. And with school starting and everything, um, it's really, it's useful at school because you know all you have to have is a browser, and then you can do this, and it's really simple HTML. Nothing fancy.
Um, the same people who do this do a lot of other things. They have tools so you can run code on the cloud as a business or, you know, as a professional thing, and they're supposed to be reliable and fast.
So, I mean, this is Codepad. It's really cool, and since you can like copy a URL, so let's say I just write something in plain text, I write "hello world" right there. Um, you know, I can send anyone this URL and they can work on it, and they can comment, and they can run, etc.
And you can even make them private and log in and do all this stuff. I'll delete this because I don't want to waste space on their server and stuff.
Um, anyway, yeah, so it's—I think it's a pretty awesome little site, and if you didn't know about it, you should check it out.
So, anyway, thanks for watching my kids in one. Subscribe and goodbye!