Author Topic: I wrote my first bit of source code!  (Read 12926 times)

0 Members and 1 Guest are viewing this topic.

Offline Freespace Freak

  • 28
  • Official forum permanewb
I wrote my first bit of source code!
I'm enrolled in a class called Engineering Computations, but it's actually a class where we learn how to write source code using C and C++.  I didn't "invent" the code, the teacher did, but he baby-stepped how to write it and put it into C++.  It's nothing fancy, it's just a System32 dll console program that calculates the area and volume of a cylinder given two inputs: height and radius.  But I'm learning how to write REAL source code, and maybe one day I'll write some code for the SCP!  :D

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: I wrote my first bit of source code!
Sounds good. Just don't go downloading the FS2 source just yet cause you'll be clawing out your eyes and burning your compiler by the end of the week.

Look forwards to possibly seeing you on the team in a few months though.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Colonol Dekker

  • HLP is my mistress
  • 213
  • Aken Tigh Dekker
    • My old squad sub-domain
Re: I wrote my first bit of source code!
FreespaceFreak, i expect at least 1500 new lines of code by half past five completely renovating the SCP.



<joke :D >

congrats at volumetric thingy  :yes:
Your friendly Orestes tactical controller
GO GO DEKKER RANGERSSSS!!!!!!!!!!!!!!!!!
President of the Scooby Doo Model Appreciation Society
The only good Zod is a dead Zod
NEWGROUNDS COMEDY GOLD, UPDATED DAILY
http://badges.steamprofile.com/profile/default/steam/76561198011784807.png

 

Offline Freespace Freak

  • 28
  • Official forum permanewb
Re: I wrote my first bit of source code!
I have a student version of C++ that comes with the book, and it doesn't allow me to distribute programs built with it.  I think I'll buy my own compiler soon, though.  You guys probably use Java, right?  Since it's cross platform and all.  My professor told me it's essentially identical to C++ anyway.

 

Offline Shade

  • 211
Re: I wrote my first bit of source code!
Your teacher is on crack :p They're similar in many ways, but there are also massive differences.

The FS_open source code is c/c++, and there are actually some choices of free windows compilers that can work with it with some tweaking (there's two threads stickied at the top of the forum explaining what's needed for that). And of course, it also works with gcc and anything based on it if you've got a linux/mac system. It's probably a good idea to at least try one of those options before spending money, since as Karajorma said, you may just decide to claw your eyes out after perusing the code and, well, it'd be a shame to have spent money if that's how it ends ;)

Oh yeah, and feel free to ask questions if you've got trouble getting the free alternatives to work. Some of us have been there and done that, and should be able to answer most of them.
Report FS_Open bugs with Mantis  |  Find the latest FS_Open builds Here  |  Interested in FRED? Check out the Wiki's FRED Portal | Diaspora: Website / Forums
"Oooooooooooooooooooooooooooooooooooooooh ****ing great. 2200 references to entry->index and no idea which is the one that ****ed up" - Karajorma
"We are all agreed that your theory is crazy. The question that divides us is whether it is crazy enough to have a chance of being correct." - Niels Bohr
<Cobra|> You play this mission too intelligently.

 

Offline Freespace Freak

  • 28
  • Official forum permanewb
Re: I wrote my first bit of source code!
Why would viewing thw code in C++ make me want to claw my eyes out? :nervous:

 
Re: I wrote my first bit of source code!
It's like reading a really advanced maths book. You see the signs, understand most of them, understand even those little number-thingies but you have no clue what all this together does ^^ Now that would be ok, but what would happen if someone put the pages in a completely random order?

And NOW you have FSSCP-code :) Looked at it once and it was... interesting...

EDIT: I think my favorite part of the few things I looked at was the turret-code or something like that...

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: I wrote my first bit of source code!
Yep. The FS2 code is....interesting.

Especially if you're being trained (as you no doubt are) in Object Oriented programming. For a start most of the code is C not C++ There is barely any use of classes or objects the way you'll be learning to use them.

All in all it's a very old school method of programming.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Freespace Freak

  • 28
  • Official forum permanewb
Re: I wrote my first bit of source code!
Yep. The FS2 code is....interesting.

Especially if you're being trained (as you no doubt are) in Object Oriented programming. For a start most of the code is C not C++ There is barely any use of classes or objects the way you'll be learning to use them.

All in all it's a very old school method of programming.

Actually, my prof is teaching us C and not C++, at least he says "we probably are not going to get to C++ during the breadth of this course."  However, he said if you know C, then C++ is easy, and so is Java.  They just take a little getting used to.

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: I wrote my first bit of source code!
All in all it's a very old school method of programming.
Which is why I like it so much. :D

 

Offline Mongoose

  • Rikki-Tikki-Tavi
  • Global Moderator
  • 212
  • This brain for rent.
    • Minecraft
    • Steam
    • Something
Re: I wrote my first bit of source code!
One of these days, I really need to get around to taking a look at the code myself.  I took a semester of C and one of C++, and I'm currently in a class teaching data structures using C++, though it sounds like those wouldn't be much use in terms of FS2.  Granted, I have absolutely no clue how the hell one progresses from coding command-line-based programs capable of reading and sorting text data to programming for a 3D commercial game, but I figure, what the hell? :p Can't hurt for me to look at it and see if I have any clue as to what's going on.  And who knows; I might be able to help out in some miniscule way someday.

 

Offline Freespace Freak

  • 28
  • Official forum permanewb
Re: I wrote my first bit of source code!
All in all it's a very old school method of programming.
Which is why I like it so much. :D

Since I'm learning C, not C++, right now, I did notice that a lot of the work I've done so far, such as editing and adding to tables and such, is very similar to what I'm doing in class.

 

Offline Flipside

  • əp!sd!l£
  • 212
Re: I wrote my first bit of source code!
I'm starting a course on Monday which is Computing and Multimedia, it's going to involve Java programming, apparently, making the jump from Java to C++ is not too hard, and since I want to start learning to code in C++ anyway, I will certainly be making the jump :)

 

Offline Goober5000

  • HLP Loremaster
  • Administrator
  • 214
    • Goober5000 Productions
Re: I wrote my first bit of source code!
All in all it's a very old school method of programming.

Which is why I like it so much. :D

Me too. :D

The fact that sexps are based on LISP is just icing on the cake. :D :D :D

 

Offline Freespace Freak

  • 28
  • Official forum permanewb
Re: I wrote my first bit of source code!
Ha, Flipside.  Back in the day there was a guy in my band we used to call Captain Caveman, cause he was hairy! :D

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: I wrote my first bit of source code!
All in all it's a very old school method of programming.

Which is why I like it so much. :D

Me too. :D

The fact that sexps are based on LISP is just icing on the cake. :D :D :D

Bah. You're both obviously insane. :p

I prefer not having to worry which one out of 500 global variables I need to worry about :D
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Flipside

  • əp!sd!l£
  • 212
Re: I wrote my first bit of source code!
Ha, Flipside.  Back in the day there was a guy in my band we used to call Captain Caveman, cause he was hairy! :D

Lets just say my story involves a Girl's school, a Tarzan outfit and 3 months of detention, and leave it at that :nervous:

I'll hasten to add, this wasn't recently ;)

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: I wrote my first bit of source code!
Your teacher is on crack :p They're similar in many ways, but there are also massive differences.

The FS_open source code is c/c++, and there are actually some choices of free windows compilers that can work with it with some tweaking (there's two threads stickied at the top of the forum explaining what's needed for that). And of course, it also works with gcc and anything based on it if you've got a linux/mac system. It's probably a good idea to at least try one of those options before spending money, since as Karajorma said, you may just decide to claw your eyes out after perusing the code and, well, it'd be a shame to have spent money if that's how it ends ;)

Oh yeah, and feel free to ask questions if you've got trouble getting the free alternatives to work. Some of us have been there and done that, and should be able to answer most of them.

Though if you're at all serious about it, I highly recommend you look for a copy of Visual C++ Professional or Microsoft Visual C++ .NET 2003. Both of those versions can use optimizing compilers (in the latter case, you have to replace a few files from the Visual C++ toolkit) and are IDEs from the get-go. I've tried the 'free' compilers for Linux, as well as some of the IDEs, and none of them have ever come close to having as effective of an ease of use:capability ratio.

It's also a much better alternative to the toolkit compiler. I tried the 'express' thingy once, but very quickly went back to 2003 standard with the toolkit compiler. (I don't remember exactly why, unfortunately, just that I preferred standard)

VC++.NET is ~$100, VC++ 6 tends towards the used/old software departments of most stores.
« Last Edit: September 12, 2006, 08:27:19 pm by WMCoolmon »
-C

 

Offline Mars

  • I have no originality
  • 211
  • Attempting unreasonable levels of reasonable
Re: I wrote my first bit of source code!
Sounds good. Just don't go downloading the FS2 source just yet cause you'll be clawing out your eyes and burning your compiler by the end of the week.

Look forwards to possibly seeing you on the team in a few months though.

I've looked at it, and I have very little programming expirience.... oh God.

 

Offline Backslash

  • 29
  • Bring Our Might To Bear
Re: I wrote my first bit of source code!
 :lol:
It's not THAT bad .......ok yeah it is, IF you look at everything.  The trick is to start small.  Like me, there's no way I'm going to understand the graphics code and such right off the bat, so I decided to look at the HUD code.  From there I slowly began changing little things, then trying my own things by imitating other code in similar functions, then trying my own things, then expanding outward into related code.

My previous experience?  Command-line type stuff.  So Mongoose and you other interested beginners, you can do just fine if you are patient and don't dive in TOO fast.  Pick an area to learn and focus on it... try things, make changes to see what happens, ask questions etc.

I'm learning a lot!  The funny thing is, learning these old school methods will either be beneficial (if I get a job working on old code) or come back to bite me (if I get a job working on new code) :rolleyes:

I echo what WMCoolmon says about the Visual Studio series.  Though, I must say the free 2005 Express Edition works well, and I'd wager if you're NOT already used to the advanced features in the Professional versions (like WMC probably is), it'd fit you just fine.  And you can't beat the price (besides of course the whole YOUR SOUL to Microsoft part... j/k :p)

Hey WMCoolmon, what's this about using the toolkit compiler in MSVC 2003?  I've got 2003... how much does the toolkit compiler help?