Image Image Image




Post new topic Reply to topic  [ 39 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Looking to re-learn Windows Programming in C
PostPosted: Thu Jun 19, 2008 4:12 am 
Offline
Senior member
User avatar

Posts: 223
Favourite Bot: N/A
Hi,
I want to re-learn to programm in C for Windows, I used to do this 18 years ago when I used to be a Windows Programmer, and after that I've stopped programming for a very long time, and now started again with the evaluators stuff (for now I'm only doing console applications).
I used the Programming Windows book by Charles Petzold, but unfortunately the book was missed in one of the few moves between houses.
Any idea of which book should I get? I'm thininking about the 5-th edition of the Petzold book.
Should I go with MFC or still programm the old way?
TIA & Regards ...


Top
 Profile  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Thu Jun 19, 2008 10:48 pm 
Offline
PokerAI fellow
User avatar

Posts: 808
Favourite Bot: Lego Mindstorms
Hi,

I'd say that book is a bit out of date. It was originally written for windows 3.x with some stuff added up to windows 98...

Have you considered going for c# instead? The .NET libraries make it very easy to get applications working - compared to MFC etc, and much much easier compared to direct win32 c code. The guy who wrote the book you lost wrote a similar book targeting c# instead - http://www.amazon.com/Programming-Microsoft-Windows-C/dp/0735613702/ref=pd_bbs_sr_6?ie=UTF8&s=books&qid=1213911599&sr=8-6.

Good luck.

- PeppaPig


Top
 Profile  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Sun Jun 22, 2008 10:34 am 
Offline
Regular member
User avatar

Posts: 85
I started to learn programming at university and they only taught as VB.net and C# for the first 2 years. Now I find it horrible to try and use other languages c/c++, java etc because I am so used to everything that .Net has to offer, along with a nice IDE. In hindsight it would probably be better teaching strategy to start with some other language so that students dont feel dependent on programming using visual studio.


Top
 Profile E-mail  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Sun Jun 22, 2008 10:53 am 
Offline
Senior member
User avatar

Posts: 149
Favourite Bot: khan
Depends on what you actually want to do. If you want to write windows applications in general, I strongly recommend C# for it's ease of use and nice IDE. On the other hand, C/C++ are more fast and powerful (someone said that C# code runs 3x slower than C++ code). I for one want to implement my bot in C# then port the core to C++ and leaving the scraper. As for books, I can't really recommend you something since I only learned for example code on the net and from bugging friends to help me with portions. But you may want to look over Thinking in C# (http://www.angelfire.com/theforce/chewy ... Sharp_.pdf) to get an idea about C#.

_________________
/* no comment */


Top
 Profile E-mail  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Sun Jun 22, 2008 1:20 pm 
Offline
Senior member
User avatar

Posts: 465
Favourite Bot: Mine, of course!
As far as speed and functionality, it will be hard to beat raw C/C++. It is also by far the most portable. A DLL compiled in C/C++ can be loaded and run by Java and .Net. A .Net DLL is managed code and has restrictions. For example, you cannot inject a .Net DLL into the poker client!

With that in mind, you can consider sticking with your C and compile DLL's. Go to C# .Net or something else for your Windows GUI. As far as books, sorry I just use the Books Online within Visual Studio. Of course, google is my friend.


Top
 Profile  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Mon Jun 23, 2008 5:48 am 
Offline
Senior member
User avatar

Posts: 223
Favourite Bot: N/A
There was an old thread in here about "the best language to program a bot", and I altough I do not program bots but evaluators (and still didn't finished the first combined one), there was an important point someone made, that when you get used to a language you want to stick with that language.

And when you get older, you even want more to stick with that language, as you get toooo much lazy.

Part of the problem is that the new examples of Visual C++ are not pure C, they are C++, and I'm still a pure C guy, but it seems that I will soon have to let go my dinosaur mind and move to some new language.

BlueSillicon's proposal of C DLLs for core functions and another language for GUI seems like a good alternative, and more because I think that C or C++ will be hard to beat in raw performance.

Regards ...


Top
 Profile  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Tue Jun 24, 2008 5:02 am 
Offline
Regular member
User avatar

Posts: 65
Favourite Bot: Fembot
Guys just so you know:

C# and VB.net is NOT an order of magnitude slower than C++ or C. At worst it will be about 10% slower but in the last few years the .net framework has been optimized massively and is now so close to 100% that it really makes no sense coding some parts of your system in anything else.

By FAR the most expensive tasks in a bot is looking up data from the database (opponent stats, aggregates etc) and if you use a significant DB you'd be much better off optimizing your data queries with indexes or by using a DB with advanced optimization and caching techniques like SQL Server.

I've been writing C, C++, and now C# code for 20 years. Nobody writes C or C++ anymore except when maintaining legacy systems. Not even Google uses it for new projects.


Top
 Profile E-mail  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Tue Jun 24, 2008 6:41 am 
Offline
Senior member
User avatar

Posts: 223
Favourite Bot: N/A
db6 wrote:
I've been writing C, C++, and now C# code for 20 years. Nobody writes C or C++ anymore except when maintaining legacy systems. Not even Google uses it for new projects.

Thanks, now I feel like a Cobol programmer :-(


Top
 Profile  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Tue Jun 24, 2008 7:53 am 
Offline
PokerAI fellow
User avatar

Posts: 686
Location: Midwest, USA
Favourite Bot: N/A
db6 wrote:
Nobody writes C or C++ anymore except when maintaining legacy systems.
:?

Seriously, you're in your own little world.


Top
 Profile  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Tue Jun 24, 2008 10:12 am 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
This is a random survey:

Image

I don't think anything is really dying.

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Tue Jun 24, 2008 2:47 pm 
Offline
Senior member
User avatar

Posts: 465
Favourite Bot: Mine, of course!
What . . . no Visual FoxPro? Oh yeah, Microsoft killed VFP :cry:


Top
 Profile  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Tue Jun 24, 2008 3:16 pm 
Offline
Regular member
User avatar

Posts: 58
Favourite Bot: Openholdem
C was the first I learned at my scool and prob. the only thing I used until graduation.

_________________
We see the winners and "learn" from them, while forgetting the huge unseen cemetery of losers.


Top
 Profile E-mail  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Wed Jun 25, 2008 1:04 am 
Offline
Regular member
User avatar

Posts: 65
Favourite Bot: Fembot
indiana wrote:
This is a random survey:

Image

I don't think anything is really dying.


I didn't say anything is dying. All I'm saying is that pretty much any company founded in this millennium is probably not using C++ and is certainly not using C.


Top
 Profile E-mail  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Wed Jun 25, 2008 1:05 am 
Offline
Regular member
User avatar

Posts: 65
Favourite Bot: Fembot
BTW what's the red and the green bars in that graph?


Top
 Profile E-mail  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Wed Jun 25, 2008 3:15 am 
Offline
PokerAI fellow
User avatar

Posts: 686
Location: Midwest, USA
Favourite Bot: N/A
The red and green bars are marked in the graph.

BTW, an often quoted site for programming popularity is the TIOBE Programming Community Index. It seems to disagree with Indiana's random survey quite a bit.

db6 wrote:
All I'm saying is that pretty much any company founded in this millennium is probably not using C++ and is certainly not using C.
That's just not even remotely true.


Top
 Profile  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Wed Jun 25, 2008 3:48 am 
Offline
Regular member
User avatar

Posts: 65
Favourite Bot: Fembot
Quote:
That's just not even remotely true.


Is too.

Just so we're clear: Are we talking about Windows development or just everything? Since C# is a windows thing obviously if you're doing Lunix development you're not going to use .net.

If you mean for all platforms then yes, C++ is still popular for Lunix.


Top
 Profile E-mail  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Wed Jun 25, 2008 7:48 am 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Timmy - this survey was how many titles etc. Amazon or Adisson-Whisley (don't remmeber exactly) sold, yours look a better choice, but is still kind of random - based on number of google searches and etc. Number of google searches is not indicative (and books and courses bought), as if you have to maintain a legacy, you would search for it in google.

All these surveys will more reflect the number of code written, but not what code is being produced right now.

BTW - Your survey also shows some good decline in C and C++ (and Java) against C# :)

I worked for quite some time with many different languages, I can at least say that languages like Java and C# are more productive than C++.

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Thu Jun 26, 2008 6:19 am 
Offline
Junior member
User avatar

Posts: 20
Favourite Bot: Daehtob
I'm definately not an expert on this matter but I need to start racking up some posts. So here's my 2 cents.

C for windows programming is most definately not the way to go. And 18 years is a long time to still feel comfortable with any language, but if you have retained some of your C skills then moving to C++ as a 'better C' might be a relatively easy step.

(C# might not be that difficult either but I am not qualified to comment as I have yet to make that leap myself as most of my programming is done for embedded systems in assembly or C)

IMHO The biggest challenge with moving to a modern language however will be moving away from procedural based spaghetti code to an Object Oriented paradigm. C++ as a 'better C' may prove to bridge this gap quicker than jumping right into a fully OO language.


Top
 Profile E-mail  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Fri Jun 27, 2008 5:56 pm 
Offline
Junior member
User avatar

Posts: 11
Favourite Bot: none
I learned C before i learned Java and C++ and C# and i thinks it was a good base to get into programming. however, if you have programmed before you should immediately start with a high level programming language like Java or C#.
Once you learned one language it's easy to learn another one (except PERL maybe, that's something different).


Top
 Profile E-mail  
 
 Post subject: Re: Looking to re-learn Windows Programming in C
PostPosted: Sun Jun 29, 2008 12:53 pm 
Offline
PokerAI fellow
User avatar

Posts: 1239
Favourite Bot: my bot
Adrian, I've read all of your posts on this forum and I've come to the conclusion that you are a pretty smart guy. Given your background and talent, it should take you about two hours to be productive in c#. There is a free version of Visual Studio to get started. This will be much more productive than either windows C or MFC. I wouldn't be too concerned about runtime performance: you can can break out into C if you really have to. If platform portability is an issue, or you need to call java libraries then you might consider java, but Swing is hard to learn and slow to run compared to the .NET equivalent.

I have occasionally seen good C programmers stumble with OO. If you think that you have a problem with OO, then take the time to get your head round it: it's definitely worthwhile. I started a long time ago, before all those around me were interested by reading Object-Oriented Software Construction, Second Edition, by Bertrand Meyer and OO Modeling and Design by Rumbaugh etc. I imagine there are better introductions to OO now.


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 39 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 4 guests


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: