My wishlist for PureBasic 4.50
> when you open a year-old procedural code, can you immediately
> understand what you were doing?
Sure. Any programmer worth his salt can. Seriously. If one can't, then
perhaps one shouldn't be a programmer. (Note: I'm talking about reading
one's own code, not others' code).
> understand what you were doing?
Sure. Any programmer worth his salt can. Seriously. If one can't, then
perhaps one shouldn't be a programmer. (Note: I'm talking about reading
one's own code, not others' code).
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
I totally disagree with this statement. If you CAN immediately grok old code you either are a very very top level developer who has very good knowledge of the source or you don't write very complex code.PB wrote:Sure. Any programmer worth his salt can. Seriously. If one can't, then perhaps one shouldn't be a programmer. (Note: I'm talking about reading
one's own code, not others' code).
Procedural code is by it's nature messy. It has no form or structure. It is just a bunch of procedures and calls to those procedures... and that's it. It's entirely up to the developer to rely on discipline in order not to get in a mess. With every will in the world you will forget and cruft starts to appear.
This is by no means a procedural only problem, but using OOP you can reduce the complexity using loosely coupled classes and one things that helps immensely is name spaces.
Thinking you can easily understand old code a year down the line is wrong unless you've paid very close attention to writing good comments and refactoring bad code religiously.
Did you look at Vala?Kale wrote:I just want a version of C# or Java which compiles natively through FASM!
It's 95% C# syntax and compiles to gcc.
The only downside I saw (at least on Windows) is that Windows GUI apps need the GTK DLL's, but for the ones that mostly work on Linux it's a non issue. Suppose this limitation could be solved with a static Win-GUI lib especially for Vala (don't know if somebody is working on something like that though).
BTW: there is also Genie, a Python implementation that comes along with Vala (only 4 additional files for the parser stuff). So I suppose it's just a matter of time that somebody will implement an additional BASIC like parser into the Vala package.
have fun coding
fsw
EDIT: typos...
Last edited by fsw on Mon Aug 10, 2009 5:56 pm, edited 1 time in total.
Never heard of it, very interesting, thanks.fsw wrote:Did you look at Vala?
It's 95% C# syntax and compiles to gcc.
We can debate of this during days (years), but the same is true for object oriented code, and at an extended level. You won't be able to read at all a well written code from a top-knotch C++ programmer, unless you actually are of the same level. Why ? Because it will use the langage to the its full potential, and believe me, it's not just a few classes and methods flying around in the basic way. It's template all over, multiple inheritance, implicit operator overload, destructor/constructor overload, predicates, complex patterns use, and more. That's from experience.Kale wrote:I totally disagree with this statement. If you CAN immediately grok old code you either are a very very top level developer who has very good knowledge of the source or you don't write very complex code.PB wrote:Sure. Any programmer worth his salt can. Seriously. If one can't, then perhaps one shouldn't be a programmer. (Note: I'm talking about reading
one's own code, not others' code).
Procedural code is by it's nature messy. It has no form or structure. It is just a bunch of procedures and calls to those procedures... and that's it. It's entirely up to the developer to rely on discipline in order not to get in a mess. With every will in the world you will forget and cruft starts to appear.
This is by no means a procedural only problem, but using OOP you can reduce the complexity using loosely coupled classes and one things that helps immensely is name spaces.
Thinking you can easily understand old code a year down the line is wrong unless you've paid very close attention to writing good comments and refactoring bad code religiously.
Now, i don't have any problem to read Timo's PureBasic IDE code, which is all PureBasic. Why ? Because it's nicely structured amongst differents files and directories, uses a consistent and easy to follow naming convention. And it's quite a big beast. So yes, it's a programmer issue, and if you are a bad programmer, moving to OOP just won't help you. Not at all.
I corrected that for you.Fred wrote:You won't be able to read at all a well written code from a top-knotch C++ programmer, unless you actually are of the same level. Why ? Because it will abuse the langage to the its full potential,

I agree fully. But i disagree with PB's point that if you are worth your salt you should be able to comprehend old sources. Developers all have different abilities but to make a sweeping statement like if your any good you should be able to read old source is nonsense. It all depends on your skill level, who wrote the code, was it a team effort, is there documentation, was a style used throughout, was refactoring encouraged, was hungarian notation used, etc, etc. It goes on and on.Fred wrote:Now, i don't have any problem to read Timo's PureBasic IDE code, which is all PureBasic. Why ? Because it's nicely structured amongst differents files and directories, uses a consistent and easy to follow naming convention. And it's quite a big beast. So yes, it's a programmer issue, and if you are a bad programmer, moving to OOP just won't help you. Not at all.
http://www.codinghorror.com/blog/archives/000684.html
If you read my post above i also explained this is not only a procedural problem but is a problem of all code. I just mentioned the benfits of OOP's organisation, nothing more.
Last edited by Kale on Mon Aug 10, 2009 6:31 pm, edited 3 times in total.
Well, I never said that you would absolutely understand 100% of an OOP code at first sight, just said (or tried, well, I'm not a good english speaker) that OOP is just easier to read by it's own nature.
I meant your own year(s)-old code.You won't be able to read at all a well written code from a top-knotch C++ programmer, unless you actually are of the same level.
I don't think code readability depends that much on the language you use (unless its Perl or LispAny code of your own that you haven't looked at for six or more months might as well have been written by someone else.
-- Eagleson's law

Although i believe the languages that make it the most easy to screw up are hybrid languages (C++ being the prime example). The biggest problem being that the people think they produce better code but don't because the language offers OO features but doesn't enforce them. So the result is an ugly mix.
If i were to design a new language from the ground up, OO would definitely be a part of the design. I just don't believe in glueing it onto PB this late in the process.
quidquid Latine dictum sit altum videtur
Agreed.freak wrote:I don't think code readability depends that much on the language you use (unless its Perl or LispAny code of your own that you haven't looked at for six or more months might as well have been written by someone else.
-- Eagleson's law). Its rather a matter of discipline.
Although i believe the languages that make it the most easy to screw up are hybrid languages (C++ being the prime example). The biggest problem being that the people think they produce better code but don't because the language offers OO features but doesn't enforce them. So the result is an ugly mix.
If i were to design a new language from the ground up, OO would definitely be a part of the design. I just don't believe in glueing it onto PB this late in the process.
I do really like the OOP preprocessor extensions written by some guys here.
It gives you the possibility to take a look at OOP in PureBasic. They arent perfect, but the main things exist. So if someone wants to use OOP (like I do at the moment) there is nothing that averts you.
If you really want to use OOP, there are better choices like c++ and so on. However you have to ask yourself: What do I want?
I decided to programm in PB and would be pretty happy, if PB supports OOP natively, but it isnt a "must have". The main thing is that it makes fun (and c++ or java is not fun, its beastly) and as long as PB is well working (and not a patch work) I will still be happy in future.
It gives you the possibility to take a look at OOP in PureBasic. They arent perfect, but the main things exist. So if someone wants to use OOP (like I do at the moment) there is nothing that averts you.
If you really want to use OOP, there are better choices like c++ and so on. However you have to ask yourself: What do I want?
I decided to programm in PB and would be pretty happy, if PB supports OOP natively, but it isnt a "must have". The main thing is that it makes fun (and c++ or java is not fun, its beastly) and as long as PB is well working (and not a patch work) I will still be happy in future.
pb 5.11
I have to disagree with you, Kale. I can fully understand what all my
8-year-old PureBasic sources do. I just have a good memory.
> who has very good knowledge of the source
If one wrote it, why can't one remember it or have good knowledge of it?
> or you don't write very complex code
Of course I do. Don't start down that route of "you must be a hobby coder".
I do retract what I said about "worth his salt", as it is a bit of a harsh and
egotistical statement; but to me, it's egotistical to say that someone must
write kiddy code if they can remember and understand it completely. I've
been coding for over 30 years so I know what I'm doing, and am very in
touch with my style and what I write.
8-year-old PureBasic sources do. I just have a good memory.
> who has very good knowledge of the source
If one wrote it, why can't one remember it or have good knowledge of it?
> or you don't write very complex code
Of course I do. Don't start down that route of "you must be a hobby coder".
I do retract what I said about "worth his salt", as it is a bit of a harsh and
egotistical statement; but to me, it's egotistical to say that someone must
write kiddy code if they can remember and understand it completely. I've
been coding for over 30 years so I know what I'm doing, and am very in
touch with my style and what I write.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
I find that my old sources suck, is buggy like hell, uses stupid "magic" to get things done. (magic = some code you don't understand but is needed to make things work)
And I always get a itch to redo the crap.
Oh and I hardly understand why I did all that stupid stuff, my coding has in general become more and more streamlined, uniform and better layed out over the years.
So I guess I'm in the category of coders that aren't worth their salt as I can barely understand any of my oldest code, nothing makes sense, it's horribly illogical. Luckily for me though, back then I hardly did any large projects though...
And I always get a itch to redo the crap.
Oh and I hardly understand why I did all that stupid stuff, my coding has in general become more and more streamlined, uniform and better layed out over the years.
So I guess I'm in the category of coders that aren't worth their salt as I can barely understand any of my oldest code, nothing makes sense, it's horribly illogical. Luckily for me though, back then I hardly did any large projects though...

- John Puccio
- User
- Posts: 26
- Joined: Fri Jun 12, 2009 6:56 am
- Location: My Keyboard
I have code that I wrote 30 years ago and it makes no sense to me now. 20 years ago, I have to study it for a while. 10 years ago, I can read it and understand what it does easily. The whole idea behind the Basic language is readability. Basic was invenetd as an exercise in NL (Natural Language) it was part of an Artificial Intelligence experiment. Basic is supposed to be self doccumenting (readable).
But Basic also give the programmer alot of freedom to "speak" in a child like way, and a beginner usually does. So I guess the answer is, what is your coding (speaking) style? If you code in a way that is self documenting and avoid sortcuts (goto) your code should be readable by any reasonably skilled Basic progrmmer OOP or not. As far as OOP goes, the reason I came to PureBASIC is this..
http://www.geocities.com/tablizer/oopbad.htm
JP
But Basic also give the programmer alot of freedom to "speak" in a child like way, and a beginner usually does. So I guess the answer is, what is your coding (speaking) style? If you code in a way that is self documenting and avoid sortcuts (goto) your code should be readable by any reasonably skilled Basic progrmmer OOP or not. As far as OOP goes, the reason I came to PureBASIC is this..
Fred's philosphy is right on the money. It was his ideas and the PureBASIC Syntax that drew me to this language. I avoid OOP and ugly syntax as much as possible. Has anyone here read this?We can debate of this during days (years), but the same is true for object oriented code, and at an extended level. You won't be able to read at all a well written code from a top-knotch C++ programmer, unless you actually are of the same level. Why ? Because it will use the langage to the its full potential, and believe me, it's not just a few classes and methods flying around in the basic way. It's template all over, multiple inheritance, implicit operator overload, destructor/constructor overload, predicates, complex patterns use, and more. That's from experience.
Now, i don't have any problem to read Timo's PureBasic IDE code, which is all PureBasic. Why ? Because it's nicely structured amongst differents files and directories, uses a consistent and easy to follow naming convention. And it's quite a big beast. So yes, it's a programmer issue, and if you are a bad programmer, moving to OOP just won't help you. Not at all.
http://www.geocities.com/tablizer/oopbad.htm
JP