Log in

View Full Version : C++ and Microsoft Visual Studio 2008



samuraicow
03-18-2009, 05:48 PM
Evening all,
I know its the off topic forum and that DB forums are not really the best place for this sort of questions but I realize some programmers find there way to this forum so hopefully some one could help me, and by all means if you know a better suiting forum for this questions please show me the way =p.


I know Pascal (or at lest, used to know heh :p) and I am interested in actually buildings real life programs, I figured C++ is what I am looking for, but so far I am having a slight problem at finding out just how to get started.
I have this great C++ book(IRL), the only issue is that this book assumes that you already know how to use Microsoft's Visual Studio and that you know some C++, which I don't.

For beginners I found out the following way to get started: "Ada" witch is some sort of programing language witch is a lot like C++ and has many beginners guides for, so I figured I could go like:
1) Learn Ada (and use all this nice beginners guides\online books\examples).
2) Convert to C++ by comparing the syntax defiance between the two.

This still levies me in the cold in regards to knowing how to handle\worth with Visual Studio, as far as obtaining Visual Studio, and programing well:
1) ADA's programing invaiormente (compiler and what have you) is free
2) Microsoft released Virtual PC IMG that contains Vista+Office 2007+Visual Studio 2005\8 and some other helpful tools, for free, it expires in a year and by witch time I imagine they will have a newer version (as I found in there archive a VPC IMG of XP+VS05\office 2003 that expired just a month after the newer one was released).

So it comes down to the following questions:
1) How do one go about learning how to use\work with Visual studio (preferable the last version of it)?
2) Whats the best (or at lest, a good) way to learn C++, is it first learning Ada and then moving to C++ (Remember, I do know Pascal to a degree and I already know the basics and theory of programing so it might be a waist of time, to a degree), or is there some nice beginners guide\online book(or amazon IRL book) for beginners in C++?

Thanks :D


EDIT: Here are some links
1) That MS VPC IMG: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=c7a809d8-8c9f-439f-8147-948bc6957812
2) Ada related stuff:
* http://goanna.cs.rmit.edu.au/~dale/ada/aln.html
* http://www.adatutor.com/
* http://en.wikibooks.org/wiki/Ada_Programming

Freddie
03-18-2009, 05:59 PM
I think that if you want to learn C++, you should study and use C++. Learning Ada is a detour and not an effective way to get to your goal.

If you want to start with something easier or smaller than C++, you can start with C, the language that C++ evolved from. For practical purposes C is a subset of C++ so almost everything you learn about C will actually get used in C++ programs. You can compile C programs with a C++ compiler so you don't even have to think of them as separate languages unless you want to. There's an incredibly wonderful beginner's book on C called "The C Programming Language" by Kernighan and Ritchie.


1) ADA's programing inviorment (compiler and what have you) is free
Microsoft gives away its C++ compiler (and all its other compilers) for free too:

http://www.microsoft.com/express/vc/

Darcla
03-18-2009, 06:04 PM
For beginners I found out the following way to get started: "Ada" witch is some sort of programing language witch is a lot like C++ and has many beginners guides for, so I figured I could go like:
1) Learn Ada (and use all this nice beginners guides\online books\examples).
2) Convert to C++ by comparing the syntax defiance between the two.



Yikes... ADA... That is a VERY old language. I used to program that when I was in the AIr Force, and that is about the only use i know of anymore (On board systems are still 70s designs).

C++ is very straight forward and there are a lot of resources online and in book stores for getting started. The best way to learn would be to do a search for "Hello World" tutorials. These types of tutorials will give you a basic understanding of C++ syntax, as well as windows API programming.

Also Microsoft visual studio is a compiler. It basically takes the C++ syntax and converts it into machine language (assembly), and does whatever you programmed it to do. It is not required to do C++ and you do not need to know it in and out to be able to code. You can get a very basic (and free in some cases) combiler to do basic programs. I believe some colleges might also have online compilers that you may be able to access for free.

So to answer your question, just search for beginner C++ hello world tutorials and go from there. No need to learn another language to get there.

samuraicow
03-18-2009, 06:38 PM
Great! Exactly what I wanted to hear, I honestly cant be arsed to learn anther aichent programing language (Pascal is nuf for my liking), I looked up "C++ hello world tutorial" and I got to say that I just had no idea that "hello world" equals a gold mine =p Thanks on that one :D


So yeah, I'll just go strat away with C++ :)

In regards to "The C Programming Language" by Kernighan and Ritchi, is there some similar book that you could recommend for C++, while I realize that I dont really need a book with the amount of information that is found on the web, having one wont hurt xD


And Thanks for the quick and helpful replays :thumbup:

Freddie
03-18-2009, 07:32 PM
Great! Exactly what I wanted to hear, I honestly cant be arsed to learn anther aichent programing language (Pascal is nuf for my liking), I looked up "C++ hello world tutorial" and I got to say that I just had no idea that "hello world" equals a gold mine =p Thanks on that one :D
There's a tradition that "Hello world!" is the first program you write when you learn a new language.

Do you know where that idea comes from originally? From the Kernighan and Ritchie book. That's how it begins -- with the first "Hello world!" program ever published in a book. :) According to Wikipedia, Kernighan invented the idea.


In regards to "The C Programming Language" by Kernighan and Ritchi, is there some similar book that you could recommend for C++, while I realize that I dont really need a book with the amount of information that is found on the web, having one wont hurt xD
I agree, get some books. That book is pretty much in a league of its own. It's a famous classic in computer science. Ritchie is the co-developer of Unix. Guys like that don't normally write beginner's language books. It's short and clear and easy to read.

One of the nice things about the K & R book is that subliminally, without even thinking about it, the reader absorbs a lot of useful info about software design and how to simplify and structure a program in a clean way. This stuff goes beyond the C language. It's invaluable for all programming.

I'm sure there are plenty of good introductory books on C++. I can't recommend any because I've never used them. When C++ got invented I was already a programmer, and the only book -- or maybe it was handouts at the time, I forget -- was by Stroustrup, the inventor of the language. I had a job at the time writing educational material about C++ for Bell Labs where C++ was invented, so I was involved with early C++ documentation, but as an author, not a reader.

Stroustrup's material on C++ has grown into a very heavy book, now in it's third edition, and if you're serious about becoming a good C++ programmer you'll probably buy it eventually. Although it can be used by knowledgeable programmers as a beginner's book, it's very dense and detailed and not something that most people would regard as a beginner's text.

Good luck! C++ is a great language and the free edition of Visual C++ is a great IDE. If you have any questions feel free to ask.

Jafula
03-19-2009, 04:36 AM
Something that I found invaluable when programming C/C++ back in the day was Paul Nettle's memory manager.

Best free code/tool I could use for finding those pesky memory leaks. It's something you really need to start with to save you a world of pain later on...

You can find it here; documentation in the code:

http://www.paulnettle.com/pub/FluidStudios/MemoryManagers/

Happy hacking :-)

OogaJiggaWooga
03-19-2009, 06:46 AM
It's interesting that you knew Pascal, but have not thought to delve into Delphi (otherwise known as visual pascal) instead of C++, which is perfectly viable (I currently use it) for developing 'real life programs'.

samuraicow
03-19-2009, 02:44 PM
It's interesting that you knew Pascal, but have not thought to delve into Delphi (otherwise known as visual pascal) instead of C++, which is perfectly viable (I currently use it) for developing 'real life programs'.The reason I chose C++ over any other language is:
1) While I did hear the name "Delphi" couple of times "back in the day" I honestly never did much research about it, so I never thought about any thing else but C++ (not the best argument\excuse but well, its what happened).
2) In a year from now I plan to start learning at a university, and I plan to go for there special program witch takes 4 years to complete and at the end you get first degree in computer since and second degree in business management(go go my own start-up company, one man army for the win eh?), and in this university they have C++ as "native" language.

So basically this solo learning is with the above in mind 8)


Due to that C book being such a gem I should go and get it, use it to learn C (and other programing aspects), and then move to C++ and Stroustrup's content.


So we are looking at:
1) C Programming Language (2nd Edition) ('http://www.amazon.com/Programming-Language-Prentice-Hall-Software/dp/0131103628/ref=sr_1_1?ie=UTF8&s=books&qid=1237485323&sr=8-1')

And witch of the following? (Or is it all of them?):
1) The C++ Programming Language: Special Edition (3rd Edition) ('http://www.amazon.com/C-Programming-Language-Special-3rd/dp/0201700735/ref=sr_1_2?ie=UTF8&s=books&qid=1237485559&sr=1-2')
2) Programming: Principles and Practice Using C++ ('http://www.amazon.com/Programming-Principles-Practice-Using-C/dp/0321543726/ref=sr_1_1?ie=UTF8&s=books&qid=1237485559&sr=1-1')
3) The Design and Evolution of C++ ('http://www.amazon.com/Design-Evolution-C-Bjarne-Stroustrup/dp/0201543303/ref=sr_1_3?ie=UTF8&s=books&qid=1237485559&sr=1-3')
4) C++ Primer Plus (5th Edition) ('http://www.amazon.com/Primer-Plus-5th-Stephen-Prata/dp/0672326973/ref=sr_1_5?ie=UTF8&s=books&qid=1237485559&sr=1-5')

Varmon
03-19-2009, 03:36 PM
My 0.02, even though you have previous programming experience is to start with C on a linux box so that you can focus 100% on learning C. Then make the leap to C++ and WinAPI because otherwise you will be learning both of them at once...just IMO, but I think it would far easier and will be much better off in the long run. Especially if your interest is doing lower level stuff with Windows

And I agree that the C programming language book is also very good, definitely pick it up

Kicksome
03-19-2009, 04:09 PM
You may want to start out with vb.net. You can download a free 90 day trial of Visual Studio 2008 and get started.

Also, you should ask yourself why you want to learn C++ vs. vb if you're just getting started w/programming.

Java is also a good options, it's very in-demand since it's cross platform.

Freddie
03-19-2009, 04:11 PM
And witch of the following? (Or is it all of them?):
1) The C++ Programming Language: Special Edition (3rd Edition)
2) Programming: Principles and Practice Using C++
3) The Design and Evolution of C++
4) C++ Primer Plus (5th Edition)
When I said you'll probably end up buying Stroustrup's book I was thinking of #1. I hadn't heard of #2 until just now -- I see it was just published a few months ago -- but I just read Stroustrup's description of it on his blog, and it sounds perfect for you -- except maybe for the size. 1272 pages, yikes! #3 is written more for people who are interested in language design than for users of the lanuage.

I agree with Varmon's advice about breaking this up into separate topics but I wouldn't necessarily advise you to learn C first and then the rest of C++ and the Windows API later. That's how I did it myself, and it worked out well for me, but that was 25 years ago. I don't know if that's the best way today or the best way for everyone. The language has changed and the ways that people use the language has changed. Most of all, different people learn things best in different orders.

I would imagine that many people today approach C++ through its template library. That's just a guess on my part but that might work out well for some people. If you do that, you're starting at the "high level." If you start with C, you're starting from the "low level." Either way you want to develop a sense of how those levels interact so you can design good programs.

I think it's a good idea to keep in mind that there are several different topics. Then you can make the decision yourself whether you want to do them one at a time -- and if so in which order.

C++ has grown into an enormous language and you need to focus on the main parts of it especially at the beginning.

I'd divide the main topics like this:

1. The C subset of C++.

2. Object oriented concepts and the core object-oriented features of C++: classes, member functions, encapsulation, data abstraction, "contracts", data hiding, inheritance (some of those words mean more or less the same thing).

3. Other C++ features, especially templates.

4. The C++ template library.

5. If you're going to be writing Windows applications, the Win32 API.


My 0.02, even though you have previous programming experience is to start with C on a linux box so that you can focus 100% on learning C.
Can't he do the same thing on Windows with console app's?

Freddie
03-19-2009, 04:48 PM
Something that I found invaluable when programming C/C++ back in the day was Paul Nettle's memory manager.

Best free code/tool I could use for finding those pesky memory leaks. It's something you really need to start with to save you a world of pain later on...

You can find it here; documentation in the code:

http://www.paulnettle.com/pub/FluidStudios/MemoryManagers/

I never heard of this guy before but the source code looks impressive. When I saw the following, I laughed and was hooked! Programmer humor! :) I'm going to try this. I've never been happy with Visual C++'s memory leak tracking stuff. Thanks for posting this.


static unsigned int prefixPattern = 0xbaadf00d; // Fill pattern for bytes preceeding allocated blocks
static unsigned int postfixPattern = 0xdeadc0de; // Fill pattern for bytes following allocated blocks
static unsigned int unusedPattern = 0xfeedface; // Fill pattern for freshly allocated blocks
static unsigned int releasedPattern = 0xdeadbeef; // Fill pattern for deallocated blocks

samuraicow
03-19-2009, 05:29 PM
As for Linux box vs Windows with console app's vs ?? (vs08?) well:
If Linux it wont be a "Linux box" rather virtual PC Linux =p, as for the console apps for windows, erm.. mind link some ?, and last, what is the alternative (also please try to keep in mind that I have yet to have done all of this so I'm not familiar with everything, although classes, member functions, data abstraction's implications are known to me :))


And in regards to the amazon check list:
1) C Programming Language (2nd Edition) ('http://www.amazon.com/Programming-Language-Prentice-Hall-Software/dp/0131103628/ref=sr_1_1?ie=UTF8&s=books&qid=1237485323&sr=8-1')
2) The C++ Programming Language: Special Edition (3rd Edition) ('http://www.amazon.com/C-Programming-Language-Special-3rd/dp/0201700735/ref=sr_1_2?ie=UTF8&s=books&qid=1237485559&sr=1-2')
3) Programming: Principles and Practice Using C++ ('http://www.amazon.com/Programming-Principles-Practice-Using-C/dp/0321543726/ref=sr_1_1?ie=UTF8&s=books&qid=1237485559&sr=1-1') (size dos NOT scare me, seriously I farmed for hand of rag solo (with 1 char) pre-bc, that's 5700gold obtained in 15g\hour, you think 1200 pages or 5000 pages scare me? ._. oh and I also accomplished the above in a month, so dedication (or madness) is also available in large quantity, the only difference is that back then I knew exactly what I was doing and whats the steps I need to take, IRL is a red quest if I may use wow reference, the difference is that just getting the quest's text is a quest for itself, and then when you find out, it makes legendary weapon farming looks like walk in the park, the good part is that the reword is just that much bigger =p

I just hit 200 played days with my main, and done two things: multiply 4800 by 5$ to see how much money I could have made as babysitter if I done that instead of wow, second.. I just imagined for a second how would my life look if i invested that much time (say 80% of it) in programing and say the other 20% in the gym ._. like Google\Intel\Microsoft employ+Arnold in one .. gif? so while I cant change the past, (And I also, don't really want to), I can chose (or try to) how the future is going to look, and well, its going to be epic :)

And I also wish to thank all of you for helping me out with this red quest :) my work is far from over but now I can see the road.

(My mind works with "sights" every thing that I think of brings and image, a well detailed one aswell, I could probably spend days writing about it witch i just saw but a light edition of it would be:
I see an image in my mind of a man standing on a cleft witch is also a clearing in a giant forest that lays in a valley surrounded by mountains, and that man can see near the horizon a glowing light that illuminates the great destination)
I am that man, the forest mountains and valley represents the many different ways things can end up with, and many temptations that I might discover along the way as well as the different danger that I might come across at the jungle(witch is life), and I am going to just "dive in" the valley\forest and start my long journey, for high school (and mandatory service at the army) ware just the sneak preview of it witch you all call life :)

FUN! :thumbsup: Cant wait to get started (so lets finalize that Amazon shop list :D)

Freddie
03-19-2009, 05:41 PM
as for the console apps for windows, erm.. mind link some ?
That's Microsoft's name for a program that runs in a command window (the old fashioned black window with text output) without necessarily creating a GUI window. The Visual C++ compiler lets you decide whether a given project is a console app or not. -

ipconfig.exe is an example of a console app. It's included as part of Windows in the System32 folder, and it displays its output to you in a command window instead of a GUI window.

samuraicow
03-19-2009, 07:34 PM
Freddie, I take it that the finalized list of the 3 books listed above got your approve?

And yeah I did know about apps such as ipsocnifg (hell i use it all the time =p) I just didn't know that console app was there nickname xD (CMD ftw?)

Moorea
03-19-2009, 08:13 PM
I think you may want to learn C++ and skip C, ie do

cout << "Hello World" << endl;

directly instead of doing

printf("Hello World\n");

as as you can see c++ stdlib is quite different than c' and you may learn bad C habits

ps: I have to add though that C is a good low level language while C++ is a horrible hack - if you want to learn a clean modern OO language learn Java instead - if you have time learn C for low level/system stuff

Freddie
03-19-2009, 08:39 PM
Freddie, I take it that the finalized list of the 3 books listed above got your approve?
I think the first two books are great. Like I said I haven't read Stroustrup's newest book but he's a genius and all his other books are interesting and valuable so I imagine this one is too. He invented the language and he's amazingly smart and he's written a textbook for people just like you ... sounds good.

My only fear is that your poor delivery dude is going to injure himself lugging this stuff to your door ... this is a lot of reading. :)

Best of all, you can send them back to Amazon if you don't like them. :)

samuraicow
03-19-2009, 08:54 PM
:D :P :rolleyes: :) 8o ^^ ^________^ Happy!

I like new beginnings :-)

Thanks all :D

And again, thank you Freddie!



Edit:
Last question, what do you guys think about a book for Visual Studio 2008, its a rather large software with many tools, and while I am sure I could mange, perhaps knowing it well from start could help? (like whats one more book to read heh :p)

Freddie
03-19-2009, 10:02 PM
Last question, what do you guys think about a book for Visual Studio 2008, its a rather large software with many tools, and while I am sure I could mange, perhaps knowing it well from start could help? (like whats one more book to read heh :p)
I wouldn't bother for Visual Studio as a whole but if you can find a good book about using the debugger, you might want to buy it since the debugger is very powerful and a lot of its features aren't obvious. But for the other parts of Visual Studio I think it's probably just as easy (or hard) to look up instructions for free on MSDN. But maybe I'm wrong, I dunno, I've been using VIsual Studio for a long time so I'm used to it.

There used to be a pretty good book about the Visual Studio C++ debugger called "Debugging Applications" by John Robbins, Microsoft Press, but the current edition apparently contains info for both C++/Win32 and C#/.NET. I don't know how much C++/Win32 stuff is in the newer edition:

http://www.amazon.com/Debugging-Applications-Microsoft%C2%AE-Microsoft-Pro-Developer/dp/0735615365/ref=sr_1_3?ie=UTF8&s=books&qid=1237510816&sr=1-3

If you feel like spending more money, instead of buying books about Visual Studio you might be better off with books about algorithms, the Win32 API, strategies for writing bug-free code, etc.

magwo
03-20-2009, 04:56 PM
For the purpose of becoming a better programmer, I would recommend learning a functional language such as Scheme, Lisp or Haskell.

In my experience, programmers who have at some point in their career/education/hobbies embraced a functional language, write better code.
People who have really understood functional languages tend to write maintainable, flexible and easily debuggable code. They may not write more correct code as in program correctness, but the "debuggability" of the code that they write makes mistakes and bugs much less problematic and costly to fix.

While people who only ever programmed in stateful languages, "imperative style", tend to write long and messy functions that are very prone to error when you maintain and refactor the code.


For example, consider recursion. To a programmer experienced with functional programming, this is the "easy" solution - the naive implementation. But to the imperative style programmer, recursion is scary and complex, and usually doesn't even come to mind when he/she writes code.


When a functional style programmer writes code in a function, he sees functions in hiding. When an imperative style programmer writes code in a function, he sees steps.

samuraicow
03-23-2009, 02:32 AM
For the purpose of becoming a better programmer, I would recommend learning a functional language such as Scheme, Lisp or Haskell.

In my experience, programmers who have at some point in their career/education/hobbies embraced a functional language, write better code.
People who have really understood functional languages tend to write maintainable, flexible and easily debuggable code. They may not write more correct code as in program correctness, but the "debuggability" of the code that they write makes mistakes and bugs much less problematic and costly to fix.

While people who only ever programmed in stateful languages, "imperative style", tend to write long and messy functions that are very prone to error when you maintain and refactor the code.


For example, consider recursion. To a programmer experienced with functional programming, this is the "easy" solution - the naive implementation. But to the imperative style programmer, recursion is scary and complex, and usually doesn't even come to mind when he/she writes code.


When a functional style programmer writes code in a function, he sees functions in hiding. When an imperative style programmer writes code in a function, he sees steps.While I, just like any one else, will agree with you that its good thing to obtain proper coding habits from the start, and while its possible that its easier to do so with languages such as Lisp, one simply have to start some ware, a book about a language that was written by its maker is a good way to start in my eyes, if you can recommend a good quality (epic and above =p) of books in regards to ether Lisp or the other two you mentioned I might (80% actually) go for it first, as I to believe that proper programing habits and efficiency in code is of great impotence, but I have to start some ware =p

Going Lisp>C>C++ is sort of long trip, but I got a year to "kill" so I don't count out any thing, all advises are welcome!

magwo
03-23-2009, 06:48 PM
while its possible that its easier to do so with languages such as Lisp, one simply have to start some ware


Right, well.. in my opinion you get the best overall return-on-investment as a programmer by learning a functional language. Specific languages are easy to learn - most languages and standard libraries are essentially very similar.. but the good thing about learning a functional language is that it sets your mind in a different state about programming: You start to visualize expressions consisting of expressions rather than steps that read and modify memory, which is very error prone.

If I would give one single tip to beginner programmers.. it would be.. write SHORT functions. REALLY SHORT. As in.. never more than 6-7 rows per function. This really is a very simple way to get much better code. Did I say SHORT?

Oh and if I would give a second tip it would be: Don't use singletons.
-"But they're practical sometimes"
Yes, don't use them. Really.

These recommendations stem from witnessing a lof of coding hardship at various employers and from books like Code Complete ('http://www.cc2e.com/'), Effective Java ('http://java.sun.com/docs/books/effective/') and Effective C++ ('http://www.amazon.com/Effective-Specific-Addison-Wesley-Professional-Computing/dp/0201924889'). These are all awesome books, well worth your time.


Edit: I'm sorry I can't really recommend a Lisp book since the one I read was in Swedish.

samuraicow
03-23-2009, 08:45 PM
I could work my way into Common Lisp thanks to Google, fishing stuff like this ('http://en.wikibooks.org/wiki/Common_Lisp/First_steps/Beginner_tutorial') and this ('http://www.gigamonkeys.com/book/') is easy, but is learning Common Lisp this way really grants one the desired perks?


The Wiki Page states the following: "There are no reviewed revisions of this page, so it may not have been checked for quality."

And I just compere that to "(in regards to C Programming Language (2nd Edition) by Brian W. Kernighan , Dennis M. Ritchie) ... That book is pretty much in a league of its own. It's a famous classic in computer science. Ritchie is the co-developer of Unix. Guys like that don't normally write beginner's language books. It's short and clear and easy to read.

One of the nice things about the K & R book is that subliminally, without even thinking about it, the reader absorbs a lot of useful info about software design and how to simplify and structure a program in a clean way. This stuff goes beyond the C language. It's invaluable for all programming."


but again:
For the purpose of becoming a better programmer, I would recommend learning a functional language such as Scheme, Lisp or Haskell.

In my experience, programmers who have at some point in their career/education/hobbies embraced a functional language, write better code.
People who have really understood functional languages tend to write maintainable, flexible and easily debuggable code. They may not write more correct code as in program correctness, but the "debuggability" of the code that they write makes mistakes and bugs much less problematic and costly to fix.

While people who only ever programmed in stateful languages, "imperative style", tend to write long and messy functions that are very prone to error when you maintain and refactor the code.


For example, consider recursion. To a programmer experienced with functional programming, this is the "easy" solution - the naive implementation. But to the imperative style programmer, recursion is scary and complex, and usually doesn't even come to mind when he/she writes code.


When a functional style programmer writes code in a function, he sees functions in hiding. When an imperative style programmer writes code in a function, he sees steps.This sort of bought me, but how would one go about doing so? Google it up? really?

Freddie
03-23-2009, 10:25 PM
I was only a beginner once, so I can't express an opinion about which language is the best one to start with. However I'm pretty sure it's not the language that I did start with, which was dBase II. :)

But just for the record, the K&R book spends quite a bit of time on recursion. I learned C as my third programming language, pretty early in my career as a programmer, and I started writing recursive functions as a result of K&R. Recursion has seemed natural to me ever since.

I just thumbed through the book and found two recursive examples that have literally stuck in my head ever since I read them. That was 26 years ago! There's not many textbooks I can say that about.

One of these examples is a recursive-descent parser for parsing C declarations. Come to think of it, my memory of this example may not be so flattering to C itself. The reason this parser has stuck in my head is probably because it's the only way to understand C declarations! :)

Freddie
03-23-2009, 11:49 PM
These recommendations stem from witnessing a lof of coding hardship at various employers and from books like Code Complete ('http://www.cc2e.com/'), Effective Java ('http://java.sun.com/docs/books/effective/') and Effective C++ ('http://www.amazon.com/Effective-Specific-Addison-Wesley-Professional-Computing/dp/0201924889'). These are all awesome books, well worth your time.
I like Code Complete too, so much that I've read it several times. I can't say anything about the others since I haven't read them.

Moorea
03-24-2009, 01:41 AM
What the heck is this "don't use singleton" advice coming from ? use what instead ? a bunch of global variables all over the place ? sounds like really bad advice... or at least lacking a lot of context

samuraicow
03-24-2009, 06:54 PM
Alright then, I guess I am all set :>

I am going to start with Common Lisp, and after that I'll go C>C++ with the books I mentioned in a previews post. Later on I'll get Code Complete but again that's on a later point.

So for now, Googling "'Hello World' Common Lisp toturial" as well as "Wiki Common Lisp" =p.

Thanks all for the input :)

magwo
03-24-2009, 09:45 PM
What the heck is this "don't use singleton" advice coming from ? use what instead ? a bunch of global variables all over the place ? sounds like really bad advice... or at least lacking a lot of context

Singletons are in most cases an excuse for poor (or total lack of) class structure and proper passing of relevant information to objects and functions. Global variables are basically the same thing.


Using singletons is an excellent way of making your code hard to unit test, breaking abstraction, making super tight coupling, minimizing code reusability, lowering readability and maximizing the amount of regression bugs that appear when you refactor the code. Throw in threads and you'll soon be in the 9th circle of nondeterministic hell.. :D


Enjoy.

Moorea
03-25-2009, 01:52 AM
What the heck is this "don't use singleton" advice coming from ? use what instead ? a bunch of global variables all over the place ? sounds like really bad advice... or at least lacking a lot of context

Singletons are in most cases an excuse for poor (or total lack of) class structure and proper passing of relevant information to objects and functions. Global variables are basically the same thing.

Using singletons is an excellent way of making your code hard to unit test, breaking abstraction, making super tight coupling, minimizing code reusability, lowering readability and maximizing the amount of regression bugs that appear when you refactor the code. Throw in threads and you'll soon be in the 9th circle of nondeterministic hell.. :D
Enjoy.

Unsubstantiated BS mumbo jumbo - how do you manage thread or resource pool or anything behind a factory without a Singleton for instance... anyway... if he's just deciding which language to learn there is a long way before he'll need singletons - check again in 5-10 years

magwo
03-25-2009, 11:18 AM
http://steve.yegge.googlepages.com/singleton-considered-stupid

Moorea
03-25-2009, 01:47 PM
http://steve.yegge.googlepages.com/singleton-considered-stupid

What a long factless baseless rant. you wrote it ?

For a more useful, balanced discussion about singletons, check http://www.c2.com/cgi/wiki?SingletonPattern

magwo
03-25-2009, 08:12 PM
No I did not write it. :)

Thing is, without a doubt.. stateful singletons cause severe coderot. I've witnessed this so many times.
They're not evil in themselves - it's the global access to a modifiable state that makes them break programs.

samuraicow
03-27-2009, 11:52 AM
Morning all :)

Good news! My best friend wants to learn programing with me :D.

Only issue is that he never programed a day in his life, well not beyond HTML (and even that for only short term) so I think learning Common Lisp while not following any book is a bit to much for him, and well lets go with the questions:
Is C Programming Language (2nd Edition) by ('http://www.amazon.com/Programming-Language-Prentice-Hall-Software/dp/0131103628/ref=sr_1_1?ie=UTF8&s=books&qid=1237485323&sr=8-1')Brian W. Kernighan ('undefined') (Author), Dennis M. Ritchie ('undefined') (Author) good for first timer? I suspect that it isn't (due to reviews on amazon saying so) the best I was able to come up with is:

He will begin with:
1. C++ Without Fear ('http://www.amazon.com/exec/obidos/ASIN/0321246950/lynnallain')
2. Practical C++ Programming ('http://www.amazon.com/exec/obidos/ASIN/0596004192/lynnallain')
3. Programming Pearls ('http://www.amazon.com/exec/obidos/ASIN/0201657880/lynnallain')
4. The C++ Programming Language: Special Edition (3rd Edition) ('http://www.amazon.com/C-Programming-Language-Special-3rd/dp/0201700735/ref=sr_1_2?ie=UTF8&s=books&qid=1237485559&sr=1-2')


While I'll do:
1. Practical Common Lisp ('http://www.gigamonkeys.com/book/')
2. C Programming Language (2nd Edition) ('http://www.amazon.com/Programming-Language-Prentice-Hall-Software/dp/0131103628/ref=sr_1_1?ie=UTF8&s=books&qid=1237485323&sr=8-1')
3. The C++ Programming Language: Special Edition (3rd Edition) ('http://www.amazon.com/C-Programming-Language-Special-3rd/dp/0201700735/ref=sr_1_2?ie=UTF8&s=books&qid=1237485559&sr=1-2')


And then we will do:
1. Effective C++ : 55 Specific Ways to Improve Your Programs and Designs ('http://www.amazon.com/exec/obidos/redirect?path=ASIN/0321334876&link_code=as2&camp=1789&tag=lynnallain&creative=9325')
2. More Effective C++: 35 New Ways to Improve Your Programs and Designs ('http://www.amazon.com/exec/obidos/redirect?path=ASIN/020163371X&link_code=as2&camp=1789&tag=lynnallain&creative=9325')
3. Programming: Principles and Practice Using C++ ('http://www.amazon.com/Programming-Principles-Practice-Using-C/dp/0321543726/ref=sr_1_1?ie=UTF8&s=books&qid=1237485559&sr=1-1')
4. Code Complete: A Practical Handbook of Software Construction ('http://www.amazon.com/Code-Complete-Second-Steve-McConnell/dp/0735619670/sr=1-1/qid=1169499581?ie=UTF8&s=books')
5. Debugging Applications for Microsoft® .NET and Microsoft Windows ('http://www.amazon.com/Debugging-Applications-Microsoft%C2%AE-Microsoft-Pro-Developer/dp/0735615365/ref=sr_1_3?ie=UTF8&s=books&qid=1237510816&sr=1-3')


Sounds about right, doesn't it ?

Jafula
03-27-2009, 05:08 PM
Wow, if you two read all those books, I'll be impressed!

IMHO: You should have an idea of what you want to program as well. I've found learning programming much easier to learn when I have a specific project or task I want to complete.

Also, I think you can spend a lot of time worrying about the "right" way to write code; e.g. the posts discussing singletons above. Try and get your first project working and "finished" before you worry too much about the state of the code.

Good luck in your programming adventures; especially with (((Lisp))(which)(I)(never)(really liked))))...

Freddie
03-27-2009, 06:54 PM
I agree with Jafula. The most important ingredient for learning to program is wanting to write some program or other. It has to be fun to write the next program. You can't map that out in advance, especially not for your friend who has never tried this stuff before and has no idea what will or won't be fun.

I would just pick a starting point, i.e., pick one book and one language. See how it goes. See what's fun. Be adaptable.

As long as there's some next program (however large or smalll) you're eager to start writing, you will probably become proficient programmers. But if that isn't true, you won't.

What if it's apparent by the second day that your friend just doesn't like Lisp? What if it's apparent that C is too hard for him to start with?

Maybe your friend will love Ruby or Python.

samuraicow
03-27-2009, 07:18 PM
"Life is what happens while you make plans"
"Plans are the base for changes"
"I LIKE PIE" ermm ops wrong post, ANY HOW, you cant know how things will end up like, you can chose how you would like to see them go but life do there on thing.

I like battle plans, this is my battle plan, if something should happen that I didn't foresee, I will make a counter plan, don't wary :)

Scenario :
Friend hate the living crap of it: to bad > I borrow his books and forget to return them ^_^. (the beginner ones I didn't get for myself)
Friend falls in love with Java: > I show him the way here or some other board and tell him to go ask about how should he go about it, while he is already doing it =p
Enraged old god C'tun starts what is later to be know "The war of the shifting sand" > I QQ about AQ40 gear being so OP.

Shit happens =p


Plus: Its just nine books and I got a "year to kill", and its also not much by definition: it passes the 3 laws of "not to many books":
1) You cant count it on your fingers (9).
2) While placed together the books doesn't sustain one meter of pages.
3) You can lift them all together at simultaneously, alone, without the help of any external device or person, while not abusing terrain in your or against your favor.


=p


Hey look I am tired and talk funny! :D *gos to sleep* GN ya all

magwo
04-05-2009, 03:04 AM
Good luck and have fun programming!

samuraicow
04-23-2009, 03:13 PM
Well guys :) Here is an update ^________^


http://img6.imageshack.us/img6/6066/dsc01115xof.th.jpg ('http://img6.imageshack.us/my.php?image=dsc01115xof.jpg')

To bad that I didn't realize that http://www.gigamonkeys.com/book/small-cover.gif had a IRL edition ._., ya well web edition will do =p


Thanks all :)

"Even the biggest journeys begins with one small step" - LOTR orsomthing >_<

thinus
04-24-2009, 12:24 AM
Morning all :)

Good news! My best friend wants to learn programing with me :D.

Only issue is that he never programed a day in his life, well not beyond HTML (and even that for only short term) so I think learning Common Lisp while not following any book is a bit to much for him, and well lets go with the questions:
Is C Programming Language (2nd Edition) by ('http://www.amazon.com/Programming-Language-Prentice-Hall-Software/dp/0131103628/ref=sr_1_1?ie=UTF8&s=books&qid=1237485323&sr=8-1')Brian W. Kernighan ('undefined') (Author), Dennis M. Ritchie ('undefined') (Author) good for first timer? I suspect that it isn't (due to reviews on amazon saying so) the best I was able to come up with is:

He will begin with:
1. C++ Without Fear ('http://www.amazon.com/exec/obidos/ASIN/0321246950/lynnallain')
2. Practical C++ Programming ('http://www.amazon.com/exec/obidos/ASIN/0596004192/lynnallain')
3. Programming Pearls ('http://www.amazon.com/exec/obidos/ASIN/0201657880/lynnallain')
4. The C++ Programming Language: Special Edition (3rd Edition) ('http://www.amazon.com/C-Programming-Language-Special-3rd/dp/0201700735/ref=sr_1_2?ie=UTF8&s=books&qid=1237485559&sr=1-2')


While I'll do:
1. Practical Common Lisp ('http://www.gigamonkeys.com/book/')
2. C Programming Language (2nd Edition) ('http://www.amazon.com/Programming-Language-Prentice-Hall-Software/dp/0131103628/ref=sr_1_1?ie=UTF8&s=books&qid=1237485323&sr=8-1')
3. The C++ Programming Language: Special Edition (3rd Edition) ('http://www.amazon.com/C-Programming-Language-Special-3rd/dp/0201700735/ref=sr_1_2?ie=UTF8&s=books&qid=1237485559&sr=1-2')


And then we will do:
1. Effective C++ : 55 Specific Ways to Improve Your Programs and Designs ('http://www.amazon.com/exec/obidos/redirect?path=ASIN/0321334876&link_code=as2&camp=1789&tag=lynnallain&creative=9325')
2. More Effective C++: 35 New Ways to Improve Your Programs and Designs ('http://www.amazon.com/exec/obidos/redirect?path=ASIN/020163371X&link_code=as2&camp=1789&tag=lynnallain&creative=9325')
3. Programming: Principles and Practice Using C++ ('http://www.amazon.com/Programming-Principles-Practice-Using-C/dp/0321543726/ref=sr_1_1?ie=UTF8&s=books&qid=1237485559&sr=1-1')
4. Code Complete: A Practical Handbook of Software Construction ('http://www.amazon.com/Code-Complete-Second-Steve-McConnell/dp/0735619670/sr=1-1/qid=1169499581?ie=UTF8&s=books')
5. Debugging Applications for Microsoft® .NET and Microsoft Windows ('http://www.amazon.com/Debugging-Applications-Microsoft%C2%AE-Microsoft-Pro-Developer/dp/0735615365/ref=sr_1_3?ie=UTF8&s=books&qid=1237510816&sr=1-3')


Sounds about right, doesn't it ?


Uhm....

I find it very difficult to learn a programming language out of a book.

My suggestion:
- Decide on a project or a few projects that you would like to develop.
- Design some forms/windows/web pages in the visual designer to get a feel for how things should look.
- Think about the kind of data/objects you will need.

At this point you start coding for the first time. So lets say one of your projects is to have a little "My Dear Diary" application. You can click it, it pops up an editor, you type some text and hit save. It also needs a way to browse/view/edit old entries. So first of you will need a Diary Entry object that contains the text you entered. You also need a container for all your Diary Entry objects.

Now you go to the books and read up on how to create a class/object for your Diary Entry and how to add a text property. Next is how do we edit the text? When you get a basic Diary Entry class written then you need to do the container and your books should have chapters on containers and how they work. Once this is done you start to hook this up to a GUI.

Personally I wouldn't bother with C or LISP. If your end goal is C++ then start with classes/objects. A lot of the terms thrown around won't mean much to you but as you start coding it will make more sense over time. Any code monkey can go into a visual editor and throw together a crappy application. If you are seriously considering software development as a career then you need to learn how to take a bunch of requirements and transform it into a functional design. This is a crucial skill, some of it is raw talent, some of it can be learned and some of it just comes with experience. Once you learn how to create good functional designs the language you choose to implement it in just becomes semantics. Basing your design and thinking about things in terms of objects, classes and interfaces is something I would suggest you focus on.

Ughmahedhurtz
04-24-2009, 03:12 AM
Heh, nice brain stack there. :)

My only general suggestion after doing quite a bit of hobby code and watching the pros do it at my last job is this: COMMENT EVERYTHING. No, really. Just a quick "in layman's terms" comment that explains the gist of what this line is doing and more detailed comments in the headers/constructors/etc. will make you so happy later on when you're tired and can't remember what that one damn line was supposed to be doing. It's easy to get lazy but it costs you in the end. This is even more important when you're learning. If I'm writing something and come across an example on a website, I'll usually include the URL in the comments, too.

Best of luck with your journey!