My dream begin....since 2 days i learning C

For everything that's not in any way related to PureBasic. General chat etc...
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: My dream begin....since 2 days i learning C

Post by IdeasVacuum »

C++ can be used for procedural style programming, no issue there, it's up to you how you use it, and your C++ source can include C source.

What I really do not get though Kwaï is why you are trying to write a translator from PB source to C source? At the end of the day, they are both tools, both a means to an end..... but PB is better than C in most ways.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
the.weavster
Addict
Addict
Posts: 1576
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: My dream begin....since 2 days i learning C

Post by the.weavster »

BCX translates Basic syntax to C which you can then compile with Pelles C: http://www.basic-compiler.com/blog/?page_id=2
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: My dream begin....since 2 days i learning C

Post by Kwai chang caine »

Grasshopper my old friend... Do not run before you have learned to walk :P
Yes you have right, but i want just to create a "simple translater".

Replace the extension ".pb" to ".c"
Put on a file ".h" all the pb "Define" and "Declare Function(xxx)"
Replace "If a = 2" by "if (a==2)"
Replace "Select" by "Switch"
Replace "WaitWindowEvent" by "CallBack"
Manage the memory (Surelly the more difficult) :|
Etc ...

Surely it's not a second "BCX", i have not enough knowledge :oops:
But perhaps i can translate 80% or more of PB in C

And perhaps, when i have do already this, a MASTER of the C of this forum stop to laughing of me :oops:, and want help me for finish... :D

Sometime numerous things appears impossible...and when a little man try ...everybody laugh... :lol: :lol: :twisted:
Accross the sea without arm and leg ... :lol: :lol: impossible :lol: :lol: you are realy a joker :lol:
So..a french man do this....and nobody now, laugh :oops:
http://www.rowoflife.org/blog.html?tag= ... es+et+bras

I don't want compare me with this genial man :oops:
But if we never try....we never win :oops:
Me ..i not accross the sea, without arm and leg...but i want accross the C...without brain and knowledge :lol:

I have already make a simple translater between GFABasic and QBasic, and i have translate 90% of the GFABasic...and i'm very happy to not write this with the hand :mrgreen:

For the moment, since i learning C, and thanks to FRED, who have create PB nearly like the C, i have not see anything impossible to translate PB to C...then i continue to learn slowly, but surely, the begining of my second passion and dreamed C :D

So i ask a question, and nobody answer !!!! Why ???
If nobody want help me a little bit, obviously it's very more hard to do what i want to do :?
And you have not a little bit pity for a crazy KCC :oops:

Then PLEASE !!!! i want just a simple answer, at your advice at all :

If for PB the loop :

Code: Select all

Repeat  
 Evenement = WaitWindowEvent() 
Until Evenement = #PB_Event_CloseWindow
Hide a callback or this loop is exactely like the loop C

Code: Select all

while (GetMessage(&msg, NULL, 0, 0))
 {	 
	 TranslateMessage(&msg);
	 DispatchMessage(&msg);
	}
What I really do not get though Kwaï is why you are trying to write a translator from PB source to C source? At the end of the day, they are both tools, both a means to an end..... but PB is better than C in most ways.
PB is better than C for the easy use, but the problem it's the community is not enough big :cry:
And i found often code in C and can't translate to PB.
At my advice create this style of translater can be help mixing the two community.

In french forum, i write, write and write again all the advantages to use PB.. 8)
But nobody believe me...and want take the time to try
Obvioulsy there are to numerous bad basic and C programmer is not really funny man, it's often professional with no time to lose :?

The C is the Creator, PB is in C, and FRED have the generous idea to delete the difficulty of C
Numerous of you have do the road in the other sense....C to PB
But me...thanks to PB....i touch with my finger the beginning of the C.
The same C that y dreamed since several years.

Nobody can understand that a man want touch is dream without abandon the langage who have helped to touch is dream ????
Me i "have a dream".....strange ...i have already hear this sentence somewhere ??? :lol:

So i have a dream...mixing the easily of PB and the recognition of C
Perhaps after that the two worlds can be live together, because PB and C is not really different after all :wink:
BCX translates Basic syntax to C which you can then compile with Pelles C: http://www.basic-compiler.com/blog/?page_id=2
Yes thanks another member give to me this link 8)
Like what, it's not really a crazy idea...my idea :mrgreen:

So it's again another BASIC :?
Me...i love PB for his power, his easily, and numerous things again, and FRED, and obviously you all, even if sometime nobody want help KCC :cry:
And C for the history of the langage, the Creator, The power also, the biggest world or programmer, the numerous examples etc........
It's the reason why, i dream to mix this two langages :wink:

And since the beginning, the C give to PB all is knowledge, see the COMATE of SROD, the PureDishelper of TsSoft, etc ....
And if PB a day can make C.....perhaps this time PB can give at the C community the currency :D
Because all the PB programmer not know programming in C .....but have real and big idea 8)

And i don't want to use another BASIC :?

So perhaps this link can be help me ????
The source is included, but it's BCX source :cry:
ImageThe happiness is a road...
Not a destination
LuCiFeR[SD]
666
666
Posts: 1033
Joined: Mon Sep 01, 2003 2:33 pm

Re: My dream begin....since 2 days i learning C

Post by LuCiFeR[SD] »

KCC, I for one am NOT laughing at you... I am giving you some serious advice. You see, if you go rushing into writing your "dream" With very little understanding of "C" all you will write is very BAD code. C is not as forgiving as basic when you make mistakes.

What I am suggesting to you is the same as others have said to you. Learn the basics of C. Write some programs with it without using WinAPI stuff if you can, just to get to grips with pointers, how you manipulate strings etc. THEN once you feel comfortable with it, start making more complex programs. I would also buy a good book on C.

Otherwise, all you will end up with is shit flavoured spaghetti code which will be a nightmare for you to enhance in the future.
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

Re: My dream begin....since 2 days i learning C

Post by utopiomania »

Because since twenty years i dream to programming in C, and never dare to try
So thanks to PB, now i can begin to learn the C
Forget about C. Whats the point? If you cannot write a best selling app in PB, switching to
C WILL NOT help you.

Use your wits to write something fresh and new using PB, and forget about C, its dead.

Learning C is no problem, learn .NET instead if you need to move on.
Last edited by utopiomania on Fri Nov 05, 2010 10:08 pm, edited 1 time in total.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: My dream begin....since 2 days i learning C

Post by Mistrel »

I agree with LuCiFeR[SD]. Writing GOOD C/C++ code is extremely hard to do. And also to do consistently.

I would recommend familiarizing yourself with Cygwin, Bash, Make, Diff, and general command line compiling before delving too deeply. Either that or you'll want to get intimate with some IDE. Pick *one* IDE and stick with it for consistency until you've got a grip on things.

I'm no expert on C but I think "The UNIX Programming Environment" is a dated but good classic. I also have a 1997 edition of "Sams' Teach Yourself C in 24 Hours" which I think is pretty good. "The C Programming Language" should also be your bible.

Personally, I could not get a grip on C++ after attempting to get into it for years. I finally took a few classes on it in college and it's completely second nature now. It will depend greatly on the quality of the education though. I had fantastic professors; one who worked at Microsoft, another for Novell, HP, an IBM systems analyst (very old school), and one who authored several books.

Don't write off higher education. It can be extremely helpful.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: My dream begin....since 2 days i learning C

Post by IdeasVacuum »

The programming languages are our tools - a good mechanic does not dream about a set of spanners........

A really nice intro to C: C Programming in Easy Steps by Mike McGrath
http://www.techbookreport.com/tbr0065.html

A fully comprehensive book on C that is still a very good read: C Programming: A Modern Approach by K.N. King
http://www.cprogramming.com/books/king.html

I have been programming in C/C++ for more years than I care to remember (well, too old to remember). I use whatever tool is the most appropriate for the task in hand. PB is that tool most of the time.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: My dream begin....since 2 days i learning C

Post by Kwai chang caine »

KCC, I for one am NOT laughing at you...
No no, i'm not offended, just a little bit disappointed :(
I know that i have in this forum, some friends, and i know too, you are one of them, don't worry :?
Forget about C. Whats the point? If you cannot write a best selling app in PB, switching to
C WILL NOT help you.
Use your wits to write something fresh and new using PB, and forget about C, its dead.
Learning C is no problem, learn .NET instead if you need to move on.
If a day you meet a splendid blond woman....and you fall in love with her :shock:
Believe you it's possible to forget ??? :lol: :lol: :lol:

Furthermore i love old ladies....
Image
so in the language...i love also old langage...it's like that
I don't choose....I am nostalgic and only like old things, I let at the other all the recent things 8)
Like the cockroach...i use all the things that nobody want because it's too old :mrgreen: :lol: :lol:
Image
You see, if you go rushing into writing your "dream" With very little understanding of "C" all you will write is very BAD code
Yes sure...so i'm a dreamer, but i have limit at the dream :lol:
I don't believe that with this style of program, the code will be good :oops:
It's a little bit with all the langage, finally all be translater, for a the end translate to ASM/BIN or directly in BIN
But the better code is directly to coding in ASM or BIN, all of them know that.

I know anything at ASM, but the specialists say that VB create the worst code ASM of the word
And it's not a reason for this code "works", very bad, but works when even :oops:
Furthermore...VB it's nearly the most used language thanks to VBA in office :?

I'm a little bad programmer, so i know it's impossible for me to create a good code. :oops:
But just a little tool, for translate the more simply possible two language.

So if you are a day ahead a chinese man...or even more simple again, an english man...(if obviously are not english :wink:) we use GOOGLE translate for talk in this forum 8)
And sometime, even english man like SROD, use GOOGLE for understand KCC, when he talk in english :shock: :lol: :lol:
We all know it's a very shit translate :evil:
The word is not in the good place, it's sometime not the good word...but GOOGLE translate stay when even a better friend, when we are ahead an incomprehensible sentence :shock: and he help when even to understand 8)
So it's better to have a shit translater...rather nothing no ??? :wink:
The important thing...it's to understand finally, no ??

So KCC want to create the worst translater PB/C of the word...in fact the first GOOGLE computer code translating :lol: :lol: :lol:
I finally took a few classes on it in college and it's completely second nature now
Yes you are right.
School stay the better place to learning 8)
So when i was young, i run so faster to quit school, and si far...that today...it's very difficult to return.
And the school is very very expensive, when you are not a chidren :cry:
But now, i wait for an answer in my job, for can take lesson in C.
It's a long time for have this answer, and perhaps she is negative :cry:
So pending this time to wait....i try to learn myself..like for the english :lol:

@IdeasVaccum
Thanks for this links...i hope this book exist in french, because it's already so difficult to learn the C :cry:
I use whatever tool is the most appropriate for the task in hand. PB is that tool most of the time.
Yes in FACT, PB stay for me the better langage i know..and i say that at everybody around me, and in the forum of C, the forum of VB, etc...
But a dream, is a dream...and without dream...the life is not interesting...

Perhaps that finally, the C stay a dream for KCC, .......and i wait since 20 years........but if we never try....how can i know ??? :wink:

@At all
Thanks a lot for your answer and your advice 8)
I wish you a good day

@At other
I have always not my answer !!!!! :lol:

Then PLEASE !!!! i want just a simple answer, at your advice at all :

If for PB the loop :

Code: Select all

Repeat  
 Evenement = WaitWindowEvent() 
Until Evenement = #PB_Event_CloseWindow
Hide a callback or this loop is exactely like the loop C

Code: Select all

while (GetMessage(&msg, NULL, 0, 0))
 {	 
	 TranslateMessage(&msg);
	 DispatchMessage(&msg);
	}
ImageThe happiness is a road...
Not a destination
User avatar
Blood
Enthusiast
Enthusiast
Posts: 161
Joined: Tue Dec 08, 2009 8:34 pm
Location: United Kingdom

Re: My dream begin....since 2 days i learning C

Post by Blood »

utopiomania wrote:
Because since twenty years i dream to programming in C, and never dare to try
So thanks to PB, now i can begin to learn the C
Forget about C. Whats the point? If you cannot write a best selling app in PB, switching to
C WILL NOT help you.

Use your wits to write something fresh and new using PB, and forget about C, its dead.

Learning C is no problem, learn .NET instead if you need to move on.
There is so much wrong in this statement it's hard to know where to begin.
  1. There are lots of reasons why you would want to learn C. http://www.cprogramming.com/whyc.html
  2. C is not dead. http://www.tiobe.com/index.php/content/ ... index.html
  3. .NET is not a language, it is a framework.
Honestly PureBasic is not the alpha and omega of programming. If you want to grow as a developer you must learn other languages and C is a perfect place to start. Yeah, it's tough going to begin with but it pays off as there is nothing quite like knowing the basics through and through. What you will learn using C will help you as a developer in PureBasic or in any other language out there.
C provides the infinitely-abusable goto statement, and labels to branch to. Formally, the goto is never necessary, and in practice it is almost always easy to write code without it. We have not used goto in this book. -- K&R (2nd Ed.) : Page 65
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Re: My dream begin....since 2 days i learning C

Post by Joakim Christiansen »

I agree with you Blood.

And I support KCC!
If he want to learn C and make it fun by doing some PB to C translator then that's just great! It sounds interesting and fun actually! And So What if it may not rule the world, it is still a good practice!

Myself I only know enough of C++ to be able to program micro controllers and I personally think the whole language is a mess with all its includes and what not... But this (and C) is what people use! So I guess one has to bite his tongue and just learn it... Or not, because I am more productive in PureBasic than any other language! :lol:
I like logic, hence I dislike humans but love computers.
User avatar
Blood
Enthusiast
Enthusiast
Posts: 161
Joined: Tue Dec 08, 2009 8:34 pm
Location: United Kingdom

Re: My dream begin....since 2 days i learning C

Post by Blood »

Don't get me wrong, PureBasic is a good language. But learning C is nothing but a good thing, yes it's harder than a BASIC dialect to use but very rewarding for future development.

I look forward to see what Kwaï chang caïne develops! :D
C provides the infinitely-abusable goto statement, and labels to branch to. Formally, the goto is never necessary, and in practice it is almost always easy to write code without it. We have not used goto in this book. -- K&R (2nd Ed.) : Page 65
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: My dream begin....since 2 days i learning C

Post by Kwai chang caine »

Thanks a lot at you two 8)
BLOOD wrote:What you will learn using C will help you as a developer in PureBasic or in any other language out there.
Yes it's what i have see, just with the code of a window and his events :shock:
I have learned too much on what is really a callback....etc ....
So thanks to that i have can help a little bit a member of this forum, and it's nearly the first time :oops:
http://www.purebasic.fr/english/viewtop ... 31#p338431
It's thanks to PB (and obviously his members SROD, NETMAESTRO) that i have learned how use a little bit the callback 8)
But also with the C, who have reinforced what i have learning with PB.
BLOOD wrote:# There are lots of reasons why you would want to learn C. http://www.cprogramming.com/whyc.html
# C is not dead. http://www.tiobe.com/index.php/content/ ... index.html
Thanks to this link 8)
Very interesting :wink:
Joakim Christiansen wrote:And I support KCC!
Thank you very much, i really need some members with much more knowledge that me like you, for do this converter 8)
Joakim Christiansen wrote:And So What if it may not rule the world, it is still a good practice!
Yes, in fact like i love PB, and dream to programming C, i have this idea.
I'm just a little bit astonish, that i'm the only one to have it :shock:

It's sure that a man who know C and not PB, don't see really the interest :shock:
But a man who know PB and C....it's more astonished :cry:

In fact, it's just to simplify my life....a little bit like ROSETTA code but with an application.
I have already since a long time this style of idea, but with the HTML too.
Imagine PB can do, ASM, HTML, C , so the most important language of the world....what a power !!!! and what a simplicity to programing only one code for have three interface 8)

That appear a crazy and really impossible thing, but if you see the post that i have give the link above of CAS....with Great RASHAD we have just give 2/3 functions ...and CAS with that he already know have 10 or more functions 8)

The number is the force...LINUX and numerous program begin like this, thanks to GNU, i think ...
Everybody give a little bit of his time for give a little bit of code, perhaps just a function, just a little function, and other another little function, etc ....and LINUX born :D
BLOOD wrote:But learning C is nothing but a good thing, yes it's harder than a BASIC dialect to use but very rewarding for future development.
Yes ..the C is the military learning of the programmation :?
No present...all day crawling through the mud by being yelled at like a dog :evil:
When i back in PB...i have the feeling to return in a big and sweet sofa :lol:
But it's important to have shit to become a real programmer :mrgreen:
And KCC ....want to return to the army of programming, for became perhaps a day a real programmer like FLYPE, SROD, NETMAESTRO, TsSoft and much more again ....and especially GNOZAL who never go to programming school for learning all he know 8)
I love GNOZAL, it's also one of my hero 8)
BLOOD wrote:I look forward to see what Kwaï chang caïne develops!
It's very kind to interest to my idea...because I feel a bit lonely :(

Like i say...my project is a dream.....and often the dreaming never realized.
But if i never try...i'm sure that never come :oops:

For the moment...i learn how use VC6 and VC2008.
Why create a ".h" a ".c", how #include a .h, and declare prototype, etc ....
Because before this idea, i never open a C IDE :lol: :oops: :oops:

And for learning that, i begin by the end :oops:
Like KCC never do like he must begining :evil: justly the management of callback for a window :D

As you see, I do not work yet on the feet of FRED or FREAK :lol:
That may be why it has not even responded to my question, :(

Code: Select all

Repeat 
Evenement = WaitWindowEvent()
Until Evenement = #PB_Event_CloseWindow

while (GetMessage(&msg, NULL, 0, 0))
{   
    TranslateMessage(&msg);
    DispatchMessage(&msg);
   }
he still had pain :mrgreen: :lol: :lol:
"Meme pas mal" like we say in french (Even not ache) :lol:

But even if i can create a little "Parser" who translate 70% of PB...it's already usefull, at lesser for me :oops:
I remember the time where a member create a "PB Converter" to translate all the version of PB (3.94 ==> 4)
I have use it numerous time, he don't translate all..but it's each time, a real good beginning, for continue, and finish the to complex functions at the hand. 8)
If all the file ".c" ".h", and all the base functions (if/Endif, For/next, .....OpenWindows, Callback....) is already translate...it's perhaps already useful no ???

And like i have say above, ..perhaps at this moment....a MASTER of C...whant to help me to do one ore several complex functions ?????

@Joakim Christiansen and BLOOD

Thanks sincerelly again....i try to not to disapoint you ...but with KCC...it's important to be patient... :oops:
Perhaps the C is replaced by D, E, F, G.....Z when KCC had finish, his dream :lol:
ImageThe happiness is a road...
Not a destination
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

Re: My dream begin....since 2 days i learning C

Post by utopiomania »

@Blood, I know .NET is a framework.. Use a language that uses it, was my point.

I can program in C, I can code bare-metal machine code, but so what. What's so
special in beeing able to program in C, in itself?

Nothing. Its like putting my mom in a Bugatti Veyron Super Sport. She wil use it to putt along for some groceries or for a visit.

My focus is, a good programmer can do much more with GWBasic than I can do with C.

Have you heard the saying: "If God gave you Lemons, then make some Lemonade'? I'm trying to make some Lemonade with PB.

But, if programming itself is the goal, C is fine. Also if you like older ladies, Basic is a Cougar too. :)
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: My dream begin....since 2 days i learning C

Post by Kwai chang caine »

Me to i like great mother and nice car 8)
Image

Calling C, it's a little bit like calling at the roots of the programming, a bit like walking barefoot in the grass :mrgreen:
ImageThe happiness is a road...
Not a destination
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

Re: My dream begin....since 2 days i learning C

Post by utopiomania »

a bit like walking barefoot in the grass :mrgreen:
Nice one! :D Ok, I understand what you mean, go for it!
Post Reply