View unanswered posts | View active topics It is currently Mon Oct 14, 2019 5:06 pm



Reply to topic  [ 39 posts ]  Go to page 1, 2, 3  Next
 On the very raw basics of programming... 
Author Message
User avatar

Joined: Sun Dec 25, 2011 7:23 am
Posts: 269
Reply with quote
Post On the very raw basics of programming...
I've recently gotten into programming and I've been reading quite a few tutorials on C++. I've been able to successfully write a few simple programs which is nice and all, but there are just a few really basic things that are bothering me.

1. What exactly is a "project"?
I think its like a step needed before writing the code, but what exactly does it do? How is a "project" different from a "program"?

2. What's the difference between running a program and building a program? (I know it sounds stupid to ask, but google says nothing)

3. What exactly is a workspace? Namely, what does building/rebuilding a workspace mean? (further clarification in image below)
Image

I'm currently using Codeblocks as an IDE, although some people say I should switch to Eclipse. Does it make that much of a difference?
Any advice appreciated.


Fri Apr 06, 2012 11:10 am
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7094
Location: b8bbd5
Reply with quote
Post Re: On the very raw basics of programming...
1 and 3 are IDE things. A Project is a unit of organization used to assist you in keeping your source files from different projects of yours apart. It is directly analagous to having a folder for a game named Battleship that has all your source code for that game in it, and another with your source code for Tic Tac Toe in it. Not all IDEs have this, but many do.

A Workspace is a set of all your preferences and projects lumped into one big folder, to make it easier for you to keep your coding experience uniform. This is especially useful on computers with more than one user, since you can specify your own workspace and the other users can specify their own, yet use the same program to develop in. You can also transport this folder wherever you go and have all your preferences and projects be there with you. Not all IDEs have this, but most professional ones do.

For #2, I have to explain a bit of the programming process. Computers, deep down, can only read binary instructions, and specific ones from the CPU's ISA or Instruction Set Architecture. These instructions do very atomic things, like add one number to another and put the result into a register. Compilation, or building, is the process of taking your human-readable source code, and translating it into the binary instructions the computer can actually read. Running is then taking that compiled code and giving it to the CPU to actually run.

Hope that helped some, feel free to ask for clarification on any front.


Fri Apr 06, 2012 4:08 pm
Profile
User avatar

Joined: Sat May 05, 2007 6:04 pm
Posts: 2901
Reply with quote
Post Re: On the very raw basics of programming...
Personally I prefer CodeBlocks to Eclipse because the latter can be slightly buggy and does a few slightly odd things, but it really depends what you are writing in. Eclipse has better Java support, while if you're writing in C/C++ you might want to use codeblocks (especially if you're going to be using a linux computer)


Personally if I were writing in any C derivative (especially C#) I'd use visual studio despite the bloat, because I love it and it loves me back, but that's only free for me because I'm a student :P


Fri Apr 06, 2012 4:15 pm
Profile
User avatar

Joined: Sun Dec 25, 2011 7:23 am
Posts: 269
Reply with quote
Post Re: On the very raw basics of programming...
Thanks for the replies guys.
Are there any very simplified IDEs/compilers that don't really do much else other than compile and maybe debug?


Fri Apr 06, 2012 5:05 pm
Profile
User avatar

Joined: Sat May 05, 2007 6:04 pm
Posts: 2901
Reply with quote
Post Re: On the very raw basics of programming...
Yes but I don't know why you'd want to use one, the extra features Eclipse, Code::Blocks and everything else add are incredibly handy >_>
Debugging things without breakpoints is a huge pain in the ass


Fri Apr 06, 2012 5:09 pm
Profile

Joined: Thu Jan 20, 2011 12:19 am
Posts: 395
Reply with quote
Post Re: On the very raw basics of programming...
Www.highercomputingforeveryone.com you lack a ♥♥♥♥ ton of the necessary knowledge to not be a bad programmer. Read every word on this site upon pain of ignorance and writing shitty programs. If you can't read binary you shouldn't be writing code.


Sat Apr 07, 2012 6:35 am
Profile
User avatar

Joined: Fri May 11, 2007 4:30 pm
Posts: 1040
Location: England
Reply with quote
Post Re: On the very raw basics of programming...
Duh answered the questions but I thought I would simplify and expand on a few points:

Basically a project just holds the build properties and source code, that's it really. This means that you can customize the build properties for each project, e.g., change compile properties for debug/release or link specific libraries to an individual project (like in my case I have a graphics tablet library which is only linked to by one project). Also source code (.cpp files) not included in a project will not be compiled, but including the .h/.hpp files into the project is not strictly necessary (because they are #include'ed in the source files).

Workspaces are included in pretty much any app that allows you to modify where GUI elements are or if certain GUI panels are even visible or not, it basically just allows you to save/load a layout that best suits you.

Rebuild will compile the whole project from scratch. Build will only re-compile parts of the project which have changed. Build and run is the same as build but then it will launch the program afterwards. Run just launches the last built version of the program.

I avoid VS because it tries (it can be avoided) to get you to use code that will not compile on other IDEs, will not compile for other OS's and requires the VC++ redist. [rant] Also I personally just hate the layout/GUI of the program, it seems many companies are actively making their GUIs worse (adobe, microsoft, autodesk) to try to make them look better... What happened to form follows function?


Sat Apr 07, 2012 3:23 pm
Profile
User avatar

Joined: Sat May 05, 2007 6:04 pm
Posts: 2901
Reply with quote
Post Re: On the very raw basics of programming...
Homophanim wrote:
http://Www.highercomputingforeveryone.com you lack a ♥♥♥♥ ton of the necessary knowledge to not be a bad programmer. Read every word on this site upon pain of ignorance and writing shitty programs. If you can't read binary you shouldn't be writing code.

You don't need to know binary to write code >_>
It's useful for optimisation and figuring out what your memory is doing but nobody writes programs in binary. And very few people write programs in C.


Sat Apr 07, 2012 4:25 pm
Profile
User avatar

Joined: Fri May 11, 2007 4:30 pm
Posts: 1040
Location: England
Reply with quote
Post Re: On the very raw basics of programming...
I would say that I personally think it is important for a programmer to know, even though it isn't essential. You could save almost everything in simple text format and never have to use binary or bitwise operators.

Also learning C++ will take you years unless you have an iron will and focus. Be prepared to read... A lot... Unless you're being taught it at some kind of school then I imagine it will be a lot easier. This is a very handy website: http://www.cplusplus.com/reference/ and when you're bumping into some issue or another just remember some body else that is learning C++ probably has had that issue as well, a quick google search should help (though try to understand why it fixes the issue, always read through and analyze the code before blindly taking it). Pointers and memory are... frustrating.

One thing I didn't understand for a while is why you should ever have to use more than one cpp file, just have linear code organized into .h files right? Trust me when I say that separating code into chunks is much easier. I didn't really see the benefit until I actually just tried to convert my code into this format (which was a major pain in the arse), it's easier to manage, cleaner, easier to update/change, there are no external dependencies and you can easily take just one system and use it in another project without worrying about anything.


Sat Apr 07, 2012 5:38 pm
Profile
User avatar

Joined: Sat May 05, 2007 6:04 pm
Posts: 2901
Reply with quote
Post Re: On the very raw basics of programming...
Oh yes it's undoubtedly a very useful skill, I just think his "If you don't know binary you shouldn't even look at code!!!" attitude is misplaced and fairly inaccurate.


Sat Apr 07, 2012 5:45 pm
Profile
User avatar

Joined: Thu Jul 21, 2011 4:34 am
Posts: 2034
Reply with quote
Post Re: On the very raw basics of programming...
It's important to learn the integration of sparkle magic within C++.


Sun Apr 08, 2012 8:31 am
Profile

Joined: Thu Jan 20, 2011 12:19 am
Posts: 395
Reply with quote
Post Re: On the very raw basics of programming...
Lua is not a programming language it is a scripting language. Also that is thoroughly unimportant to learning how to write programs well.
metal chao wrote:
Homophanim wrote:
http://Www.highercomputingforeveryone.com you lack a ♥♥♥♥ ton of the necessary knowledge to not be a bad programmer. Read every word on this site upon pain of ignorance and writing shitty programs. If you can't read binary you shouldn't be writing code.

You don't need to know binary to write code >_>
It's useful for optimisation and figuring out what your memory is doing but nobody writes programs in binary. And very few people write programs in C.

Your ignorance is showing. You don't need to know binary to program in the same way you don't need a car to get around. Not learning it is taking a shortcut. There are no shortcuts when it comes to learning something. Learn from the ground up, don't jump right in to "Hello, world!" without knowing what you're doing.

Also you can demonstrate programming concepts in any language, so I'm not sure why you mentioned that utter falsehood about the C programming language. Unless you're perhaps confusing learning a language with learning to program.


Sun Apr 08, 2012 11:51 pm
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7094
Location: b8bbd5
Reply with quote
Post Re: On the very raw basics of programming...
I'm not really seeing why you need to know binary to write good programs, unless you're going to be dealing with binary representations at your level of abstraction. Then it would be essential, or you'd just ♥♥♥♥ up your data. Perhaps if you're going to be looking to optimize data as much as possible (perhaps to shuttle a lot of it around), then I could see that. Otherwise, it's not so much the binary that's important, it's knowing how using binary affects the way computers do calculations that's more important. Floating point precision difficulties, integer size limits, converting characters to shorts, that sort of thing. Counting in binary and converting from binary to decimal is useful when you're having troubles with debugging, but in most debuggers I've seen you can have the computer do that for you.

That aside, starting with a good tutorial is very important, and the one Oph linked looks quite competent. It's a bit more difficult to learn through a tutorial without people to ask, but I'm sure you can find a forum that deals specifically with the language you're using and have a go at asking them.


Mon Apr 09, 2012 12:45 am
Profile
User avatar

Joined: Thu Jul 21, 2011 4:34 am
Posts: 2034
Reply with quote
Post Re: On the very raw basics of programming...
Homophanim wrote:
Lua is not a programming language it is a scripting language. Also that is thoroughly unimportant to learning how to write programs well.
metal chao wrote:
Homophanim wrote:
http://Www.highercomputingforeveryone.com you lack a ♥♥♥♥ ton of the necessary knowledge to not be a bad programmer. Read every word on this site upon pain of ignorance and writing shitty programs. If you can't read binary you shouldn't be writing code.

You don't need to know binary to write code >_>
It's useful for optimisation and figuring out what your memory is doing but nobody writes programs in binary. And very few people write programs in C.

Your ignorance is showing. You don't need to know binary to program in the same way you don't need a car to get around. Not learning it is taking a shortcut. There are no shortcuts when it comes to learning something. Learn from the ground up, don't jump right in to "Hello, world!" without knowing what you're doing.

Also you can demonstrate programming concepts in any language, so I'm not sure why you mentioned that utter falsehood about the C programming language. Unless you're perhaps confusing learning a language with learning to program.

I didn't say it was a programming language, you ♥♥♥♥ idiot.
I just suggested him to learn Lua++. Stop being stupid


Mon Apr 09, 2012 1:38 am
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3135
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: On the very raw basics of programming...
Homophanim wrote:
You don't need to know binary to program in the same way you don't need a car to get around. Not learning it is taking a shortcut. There are no shortcuts when it comes to learning something. Learn from the ground up, don't jump right in to "Hello, world!" without knowing what you're doing.

I'd argue that, currently, "Hello, world!" is starting from the ground up. Understanding how binary works is pretty unnecessary for a functional understanding of computer languages. Plenty of people use scripting languages to automate things (like with batch files or Excel scripts), and the concept of binary isn't needed for those cases. Correct me if I'm wrong here, but in my experience, most college-level courses in computer science don't even start with binary -- it's usually things like variables, functions and loops that they introduce you to first.
For that very reason, C++ is probably a terrible place to start. It involves much more complexity than a higher-level language like Lua. It's a bit like learning to drive by hopping into an 18-wheeler right off the bat. Yes, you get closer to the actual mechanics of the vehicle, and you arguably learn faster as a result, but there's a reason that you start in a smaller vehicle and then graduate to something bigger.


Mon Apr 09, 2012 7:08 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 39 posts ]  Go to page 1, 2, 3  Next

Who is online

Users browsing this forum: Google [Bot]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.022s | 16 Queries | GZIP : Off ]