My dream begin....since 2 days i learning C
-
- 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
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.
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.
If it sounds simple, you have not grasped the complexity.
- the.weavster
- Addict
- Posts: 1576
- Joined: Thu Jul 03, 2003 6:53 pm
- Location: England
Re: My dream begin....since 2 days i learning C
BCX translates Basic syntax to C which you can then compile with Pelles C: http://www.basic-compiler.com/blog/?page_id=2
- Kwai chang caine
- 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
Yes you have right, but i want just to create a "simple translater".Grasshopper my old friend... Do not run before you have learned to walk
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

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


Sometime numerous things appears impossible...and when a little man try ...everybody laugh...



Accross the sea without arm and leg ...





So..a french man do this....and nobody now, laugh

http://www.rowoflife.org/blog.html?tag= ... es+et+bras
I don't want compare me with this genial man

But if we never try....we never win

Me ..i not accross the sea, without arm and leg...but i want accross the C...without brain and knowledge

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

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

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

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
Code: Select all
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
PB is better than C for the easy use, but the problem it's the community is not enough bigWhat 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.

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..

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 ???

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

Yes thanks another member give to me this linkBCX translates Basic syntax to C which you can then compile with Pelles C: http://www.basic-compiler.com/blog/?page_id=2

Like what, it's not really a crazy idea...my idea

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

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

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

Because all the PB programmer not know programming in C .....but have real and big idea

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


Not a destination
-
- 666
- Posts: 1033
- Joined: Mon Sep 01, 2003 2:33 pm
Re: My dream begin....since 2 days i learning C
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.
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.
- utopiomania
- Addict
- Posts: 1655
- Joined: Tue May 10, 2005 10:00 pm
- Location: Norway
Re: My dream begin....since 2 days i learning C
Forget about C. Whats the point? If you cannot write a best selling app in PB, switching toBecause 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
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.
Re: My dream begin....since 2 days i learning C
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.
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.
-
- 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
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.
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.
If it sounds simple, you have not grasped the complexity.
- Kwai chang caine
- 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
No no, i'm not offended, just a little bit disappointedKCC, I for one am NOT laughing at you...

I know that i have in this forum, some friends, and i know too, you are one of them, don't worry

If a day you meet a splendid blond woman....and you fall in love with herForget 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.

Believe you it's possible to forget ???



Furthermore i love old ladies....

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

Like the cockroach...i use all the things that nobody want because it's too old




Yes sure...so i'm a dreamer, but i have limit at the dreamYou see, if you go rushing into writing your "dream" With very little understanding of "C" all you will write is very BAD code

I don't believe that with this style of program, the code will be good

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

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.

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


And sometime, even english man like SROD, use GOOGLE for understand KCC, when he talk in english



We all know it's a very shit translate

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


So it's better to have a shit translater...rather nothing no ???

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



Yes you are right.I finally took a few classes on it in college and it's completely second nature now
School stay the better place to learning

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

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

So pending this time to wait....i try to learn myself..like for the english

@IdeasVaccum
Thanks for this links...i hope this book exist in french, because it's already so difficult to learn the C

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...I use whatever tool is the most appropriate for the task in hand. PB is that tool most of the time.
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 ???

@At all
Thanks a lot for your answer and your advice

I wish you a good day
@At other
I have always not my answer !!!!!

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
Code: Select all
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}

Not a destination
Re: My dream begin....since 2 days i learning C
There is so much wrong in this statement it's hard to know where to begin.utopiomania wrote:Forget about C. Whats the point? If you cannot write a best selling app in PB, switching toBecause 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
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 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
- .NET is not a language, it is a framework.
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
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
Re: My dream begin....since 2 days i learning C
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!
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!

I like logic, hence I dislike humans but love computers.
Re: My dream begin....since 2 days i learning C
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!
I look forward to see what Kwaï chang caïne develops!

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
- Kwai chang caine
- 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
Thanks a lot at you two

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
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
But also with the C, who have reinforced what i have learning with PB.
Very interesting

I'm just a little bit astonish, that i'm the only one to have it
It's sure that a man who know C and not PB, don't see really the interest
But a man who know PB and C....it's more astonished
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
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
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
No present...all day crawling through the mud by being yelled at like a dog
When i back in PB...i have the feeling to return in a big and sweet sofa
But it's important to have shit to become a real programmer
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
I love GNOZAL, it's also one of my hero

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
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
And for learning that, i begin by the end
Like KCC never do like he must begining
justly the management of callback for a window
As you see, I do not work yet on the feet of FRED or FREAK
That may be why it has not even responded to my question,
he still had pain
"Meme pas mal" like we say in french (Even not ache)
But even if i can create a little "Parser" who translate 70% of PB...it's already usefull, at lesser for me
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.
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...
Perhaps the C is replaced by D, E, F, G.....Z when KCC had finish, his dream

Yes it's what i have see, just with the code of a window and his eventsBLOOD wrote:What you will learn using C will help you as a developer in PureBasic or in any other language out there.

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

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

But also with the C, who have reinforced what i have learning with PB.
Thanks to this linkBLOOD 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

Very interesting

Thank you very much, i really need some members with much more knowledge that me like you, for do this converterJoakim Christiansen wrote:And I support KCC!

Yes, in fact like i love PB, and dream to programming C, i have this idea.Joakim Christiansen wrote:And So What if it may not rule the world, it is still a good practice!
I'm just a little bit astonish, that i'm the only one to have it

It's sure that a man who know C and not PB, don't see really the interest

But a man who know PB and C....it's more astonished

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

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

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

Yes ..the C is the military learning of the programmationBLOOD 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.

No present...all day crawling through the mud by being yelled at like a dog

When i back in PB...i have the feeling to return in a big and sweet sofa

But it's important to have shit to become a real programmer

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

I love GNOZAL, it's also one of my hero

It's very kind to interest to my idea...because I feel a bit lonelyBLOOD wrote:I look forward to see what Kwaï chang caïne develops!

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

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



And for learning that, i begin by the end

Like KCC never do like he must begining


As you see, I do not work yet on the feet of FRED or FREAK

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);
}



"Meme pas mal" like we say in french (Even not ache)

But even if i can create a little "Parser" who translate 70% of PB...it's already usefull, at lesser for me

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.

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...

Perhaps the C is replaced by D, E, F, G.....Z when KCC had finish, his dream


Not a destination
- utopiomania
- Addict
- Posts: 1655
- Joined: Tue May 10, 2005 10:00 pm
- Location: Norway
Re: My dream begin....since 2 days i learning C
@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.
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.

- Kwai chang caine
- 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
Me to i like great mother and nice car

Calling C, it's a little bit like calling at the roots of the programming, a bit like walking barefoot in the grass


Calling C, it's a little bit like calling at the roots of the programming, a bit like walking barefoot in the grass


Not a destination
- utopiomania
- Addict
- Posts: 1655
- Joined: Tue May 10, 2005 10:00 pm
- Location: Norway
Re: My dream begin....since 2 days i learning C
Nice one!a bit like walking barefoot in the grass![]()
