Python is Sloppy… June 19, 2008
Posted by mitchfrizzell in C++, PC, Python.2 comments
After really giving up on C++, I’ve moved onto Python. Why did I give up on the mother of all languages (you know what I mean)? I guess I felt – and still feel – that after spending so much time on C++, I was really getting no where. I’ve read around 5 tutorials and 2 full books, and I still feel that there’s something missing. Something I’m missing. C++ has a lot of extra junk that’s not covered in most tutorials, and there’s no real “basin” or other location where I can find a link to these tutorials.
So what I really wanted was something… young (I know that sounds gay). Not in terms of age, but something that’s a little more appropriate for me. It’s not that I’m not willing to spend a lot of time on my programming. In fact, I spend almost 3-4 hours a day messing around with it. It’s just that I needed a real change of pace. Especially after feeling so confident in JavaScript.
That’s where Python comes in. Sure, at a very superficial level it’s sloppy. There are hardly any brackets (used only – as far as I have seen – in lists, tuples and dictionaries: essentially fancy arrays), statements don’t end with a semicolon, and functions, classes, loops, etc are contained with only indentation! That’s right, indentation now has a function other than keeping your code neat. But underneath the surface, this lack of mostly aesthetic punctuation really cuts down on time, and makes spotting your errors easier.
To make myself proficient in Python, I’ve taken it upon myself to go through each and every resource at this awesome site. There’s over 300, but I’m willing to take the trip. Wish me luck, and if you’re taking the same road, let me in on some of your thoughts on Python.
Javascript: A Primer for C++ April 10, 2008
Posted by mitchfrizzell in C++, Web Programming.add a comment
Javascript really is the place to start if you’re looking to get into programming. You get a little taste of what you’ll get with C++, but in a lot easier package. In JS, you can choose how far you want to go. Want to get some HTML DOM in? Or would you like to skip over AJAX? Javascript can be as basic or as complicated as you wish. But there’s the problem. You won’t make a big splash in the PC world if you only know basic JS. Everyone knows basic JS. It’s when you start mixing it with other languages and functions that you really break out of the beginner’s mold. Using JS and HTML together (which is still rather basic), JS and XML (Asynchronous JavaScript and XML), JS with XUL, and many more – is where it really counts.
Javascript and C++ syntax are basically the same. Functions, classes, variables, calling variables or functions from an object: it’s all basically the same. The only big difference is JS being a little lax in ;s at the end of statements. In terms of basic functionality, you’ll also grab it in JS. Loops, conditions, switches, arrays, variables: it’s all there in JS, and just as important in C++.
But, that’s as far as JS will really take you. It’s here where JS moves onto other technologies to fulfill its purpose, but C++ moves on to its own, more complicated set of functionality. First off we’ve got pointers. Pointers can really throw you for a loop when you read about them the first time. Especially trying to read the reference operators and dereference operators. It can get pretty hard. But once you get the hang of it, you’re ready to move onto structures, unions and classes. I’m not sure what’s beyond that, as that’s as far as I’ve gotten
All in all, JS has served as a great primer for the somwhat harder C++. If you’re looking for a test run in the programming world, you should check out Javascript.
My Quest for a C++ Compiler February 11, 2008
Posted by mitchfrizzell in C++, PC.2 comments
Well, one of my New Year’s resolutions was to write and complete (at least a working version of) my roguelike. I also stated that it was the one resolution that might not come to be. However, I took it upon myself to multi-class in XUL and C++ (a little D&D humor, if you know what I mean). I began last Wednesday, and I had a great time learning. However, when compiling my code one day, I ran into a problem. The compiler I was using didn’t support one of the libraries I wanted to use. So, I thought I could just go online and grab a newer compiler. So I thought…
The compiler I was using was the same one I used a while back when I wanted to learn C (I’m still not sure why I wanted to learn C, but it doesn’t really matter any more), Dev C++. So I unsinstalled that and grabbed the next one on the list; it was a command line compiler, named Borland C++ Compiler. I don’t really enjoy using command line programs, so I moved to the next one on the list. Out of 13 compilers I tried, 7 were command line, 3 were outdated (I mean Windows 95 outdated), 2 were either huge programs or shareware, and one was Microsoft.
Ah, the joy of using Microsoft products. The “compiler” is called Visual C++ 2008. I downloaded the program (at only 2mb or so I was very content that Microsoft had a small program). However, when I ran it, it started a download for an 87mb program. The download went at a blazing 10kbps, and after about three hours I had my program. I loaded up my source (remember, the one that couldn’t compile on Dev C++?) and I looked for the “compile” button. It was nowhere to be found. So, I gladly dived into the help files, and found something more worthless than a non-grounded anti-static wristband. Each section had a “helpful” link to another section. This ended up being me clicking on over 15 links, and never actually finding any help at all! I also looked online, but no one else seemed to have any trouble. I looked for a forum, but found none, and the online help files were about more complicated topics than what I was looking for (compiling PHP, etc.). I promptly uninstalled the 100+mb crap from my computer.
About this time I remembered asking about a good C compiler on the Agora. Turns out that’s where I found out about Dev C++ (also a C compiler). However, I found a very helpful tip from Cidolfas: Edit Plus. Edit Plus is a text editor constructed for HTML, C/C++, Perl, etc. However, you can add your own User Tool (up to 10, I believe), which can include a command line compiler! Once you configure it (took me a while) all you have to do is press Ctrl+1 and it compiles. The best part, however, is that Edit Plus captures the output from the compiler, so any error messages are displayed in the Editor itself. I redownloaded Borland C++, configured it, and now I’m compiling like a madman. I’ve also added another user tool that let’s me run the .exe of the source I’m editing by pressing Ctrl+2.
All in all, finding a decent Windows-based compiler was a huge deal. However, Edit Plus solved that problem for me. If you don’t have it, grab it now, you’ll be glad you did later (also for those HTMLers out there, EP has a browser function that allows you to preview your files while you’re working on them). I know this might sound like a commercial for Edit Plus, and it really is. The program is great, the support is even better (they wrote me back within 12 hours), and it’s better than any Microsoft crap. If you’re looking for a good C++ compiler, grab Borland C++ and Edit Plus, it’s so very easy.