800 lines

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

800 lines

Post by heartbone »

The demo-version of PureBasic is limited as shown below:
- No DLL can be created
- you can’t use the whole external Win32 API support
- no development kit for external libraries
- maximum number of source lines: 800


There are a lot of possibilities with 800 lines.
If each of those 800 lines averaged 2.5 machine code bytes, then it would be 2K.
The earliest Atari VCS ROM games were 2,048 bytes, and look at what they were able to accomplish.

Image

Today, within PureBasic each one of those 800 lines could be compiled into thousands of times more than 2.5 machine code bytes.
IMO the power of the free tool provided by Fantaisie Software seems to be greatly unrecognized and/or underutilized.
I'm thinking that a fantastic window of opportunity is being missed here.
I know that many hundreds of thousands of today's young people want to try to make games, but don't know where to start.

The PB community's strength seems to be in the creation of custom business, scientific, and artistic applications along with simple video games.
The emphasis of what can be done with PB should be in those areas, although the 3D simulation capabilities should be made known.

The original thinking of Fantaisie that people would start trying to program using the demo-version, and then they'll naturally be stopped by the limit and be motivated to order the full package.
I'm thinking that most people need more support to get started programming.

The problem is the dearth of attractive sub-800 line COMPLETE example programs available for distributiuon.
If there are complete programs that can be compiled by the current demo-version, they are scattered, un-indexed, difficult to track down, or unavailable to the demo running public.

How about Fantaisie Software asking the members of this community to give it (the promotion of the PureBasic compiler) their best shot by creating and posting a complete program that can be compiled by the demo-version?

Then Fantaisie could select a CDs worth of the best efforts, and provide a link to a sizable, multi-faceted, complete demo programs library for download by the general public, on the demo compiler download page?
( That demo code base could also serve as a test suite. :wink: )
If Fantaisie were to announce such plans, I for one would work to provide a few Atari 2600 remakes done better.
BOWLING, DODGE'EM, and OTHELLO are what I would first try to squeeze into that 800 line limit.
Of course for the end user, it would probably be best if possible to keep the source to 750 lines. :wink:

For the PureBasic development team, I have two questions about the demo-version.
1) Are comments part of the 800 lines?
2) Is the restriction 800 lines, or 800 statements?

Thanks in advance for your consideration of this effort.
Keep it BASIC.
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: 800 lines

Post by Tenaja »

3) Are IncludeFiles counted in the 800 lines?
4) How are binary files counted?
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: 800 lines

Post by IdeasVacuum »

I think a Full Version with a restricted life should be considered too. Much easier to evaluate properly, especially if you want to transfer an existing app's code. As for the youngsters - how about an Educational License at a reduced price?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
staringfrog
User
User
Posts: 58
Joined: Wed Feb 27, 2013 9:36 am

Re: 800 lines

Post by staringfrog »

I keep saying, the most essential thing for PB today is not a free copy but a set of new books covering in depth various aspects of the language (such as APIs, 3D, Assembly etc). There are a lot of PB pundits around this forum who are able to answer most complicated questions — but why had only Gary once managed to write a book on the matter?

As to free copies, both full and limited... If one respects PB team's efforts, they should consider buying it, as it won't really set them back much. Rather, it's like a pledge of allegiance to the language :) Not that I bemoan recent Fred's attempts to stem illegal distribution of PB at some known resources (by expelling owners of the distributed copies from the site). This should be done, too, to keep the whole thing going.

All in all, don't get focused on rather mythical category of 'young but poor developers' much. Instead, consider a wider audience of advanced PC users who need such a magnificent tool (and not the whole monster of Visual Studio) for their everyday tasks, recreational projects, and geek whims — together with good instructions and manuals.
Coding's men's knitwork.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: 800 lines

Post by IdeasVacuum »

but why had only Gary once managed to write a book on the matter?
...because, by the time your book is completed, PB has moved to a new version and your book is out of date. This is one of the issues hit by Krylar when resurrecting his book Programming 2D Scrolling Games Book - Free Now
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
staringfrog
User
User
Posts: 58
Joined: Wed Feb 27, 2013 9:36 am

Re: 800 lines

Post by staringfrog »

IdeasVacuum,

No-no, I beg to differ on this. Despite the risk of sounding like someone with unasked-for advices, I can tell you how to do this. See, what Gary did once, was more like a feat, an act of pure (basic) heroism, and most generous offering as well. If not for his book, I would never take PureBasic seriously, let alone buy it.

What we (as PB followers) need to continue his tradition is organization and planning. Instead of describing PB as a whole, take different aspects of it. There's nothing much new in ASM, innit? Just reveal some basic logic behind working with assembly commands in PureBasic, give some typical and most winning examples of its use, and here you are, with your "Using ASM with PureBasic" first edition best-seller. The same with WinAPIs (God I hate to study them APIs on C++ examples which I but vaguely can read).

The other thing is working on a book in team, not solely. This is just technical writing, after all (though what Gary did was, again, something different, and in a nice blend of British English, with all those 'bits and bobs' and all). Plan parts of your book within the group of writers/compilers, then hand the ready material over to your editor, and here's your collective expert book-formatted manual (which of course should be revised from time to time).

P.S. Thanks for the link
Last edited by staringfrog on Sun Jun 22, 2014 2:12 pm, edited 2 times in total.
Coding's men's knitwork.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: 800 lines

Post by rsts »

IdeasVacuum wrote:
but why had only Gary once managed to write a book on the matter?
...because, by the time your book is completed, PB has moved to a new version and your book is out of date. This is one of the issues hit by Krylar when resurrecting his book Programming 2D Scrolling Games Book - Free Now
Maybe the book isn't out of date but it's extremely likely any example code won't compile anymore unless there's a thorough editing each time a new version is released with examples tailored for each release.

Or maybe, a programming manual without any examples :) Or extremely basic examples, in either case the book probably isn't necessary.
staringfrog
User
User
Posts: 58
Joined: Wed Feb 27, 2013 9:36 am

Re: 800 lines

Post by staringfrog »

Maybe the book isn't out of date but it's extremely likely any example code won't compile anymore unless there's a thorough editing each time a new version is released with examples tailored for each release.

Or maybe, a programming manual without any examples :) Or extremely basic examples, in either case the book probably isn't necessary.
Tosh.

1. Not a book. Books on aspects. Nothing new in ASM. Nothing new in WinAPI. No books on using PB with them. Etc. In other words, let PB be a new key to an old piece of knowledge (especially when it is not exactly 'an old piece of knowledge' for many newcomers).

2. A good book can't be totally out of date, only partly. In most cases, it's only a matter of timely revision. It is also a matter of particular language builds. When you buy a book on PHP4, you don't expect it to be a book on PHP5. There are zillions of books on PHP, nonetheless.

3. Do you mean that PB is being developed without clear purpose (so that its concepts and syntax can't be foreseen in the nearest future)? Then, PB is an awful language to learn. And a mug's game, to pay for it.

4. There's PB html online help (from which chm is compiled, I figure) which is done sort of collectively (I presume). What prevents you from compiling books, in the same collective fashion?

5. Books make markets. So this should be primarily Fred's concern, I believe. However, the best books on the subject matter could be provided by PB community. Thus, it should be Fred's initiative to arrange this collective expert book-making process. And to ensure that information in those books should not get obsolete as soon as they are released.

I think it's all very clear indeed. Either a programming language (especially one that exists over a decade!) has a plenty of study books to learn it, or it turns into some arcane hackers' preserve that can be mastered by profane users only by asking thousands of questions at the forums, with hopes that some guru would pay attention to their concerns. A pretty strange form of studying BASIC, isn't it?
Coding's men's knitwork.
Zach
Addict
Addict
Posts: 1675
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: 800 lines

Post by Zach »

edit: Apologies in advanced. I started with a simple, brief reply, but went off on a tangent apparently...

LTS releases should help solve the problem of development changing the language drastically before such a book could be written / finished. Or at least I should hope so.

We don't necessarily need books that cover new commands in a Beta version and whatnot, but if someone set up their book project in a carefully thought out, proper manner, the updating said book to the next version of PB, while still involving some legitimate work effort, should not be so painful as it has been in the past.

Furthermore, the beta versions and syntax changes can be used to help update the book ahead of time, so that when a new official version of the compiler does come out, sporting new features etc. There need only be a cursory glance over the code samples, to make sure they compile properly and account for any last minute bugfixes or minor syntax changes.

A great many headaches would probably be easily avoided, by also keeping code samples / lessons, practically simple. And structured in a way that it teaches other programmers good habits on a multitude of issues. Writing easy to maintain code, which is sufficiently stand-alone from other pieces of the puzzle, that it snaps right in (modules and such?), proper commenting of code, indenting of code, organization of source code files, etc.

A great way to do this is to make the whole book a "sum of its parts". Use different sections to teach different methods and ways to do things, but in a way so that all the code is independently testable as the user progresses through the book (good way to teach how to do unit testing in PB), but at the very end, they will have written an entire program of decent size which can be compiled using all its parts.

When I used to read programming books, they never really had one entire end-goal program, but various chapters taught you different things by having you build lots of small programs for very specific tasks, and that seems kind of boring.

Even a simple program, such as a checkbook / bank account program, could be used to encompass the teaching of a lot of things beginner programs will want/need to learn. Such a program doesn't NEED to feature such complex options or do certain tasks in a certain way, but you could teach a great deal of Purebasic to someone, by writing a book around designing a checkbook balancer, or maybe even a Calendar or something that can hold miscellaneous auxiliary information on contacts, produce pop-up alarms for reminders, etc.

In addition to all the stuff mentioned above (source code management, code structure, unit testing, commenting code, etc)
It could teach users important things on:

GUI design and user friendliness
(Teach Win32/GTK/OSX etc API's where applicable)

Database creation and access/manipulation

Filesystem access and how to create/access/manipulate/delete files, how and when to use temporary files to store data
(querying the filesystem for information, walking directory paths, etc)

Working with the sound system to load/play sounds

Working with the 2D/3D system to draw something (a small graphic logo or other such trinket, drawing graphs, etc)

Using any Math library functions they might need

Working with the XML library to store/retrieve data (great for exportable backups you could import into another program that reads a general format)

Working with the HTML/Web facilities PB offers (generate a report you can display, including graph data they learn to draw with the 2D/3D libraries - then print the report to a printer)

Teaching practical "right tool for the right job" ideas on using internal data structures, like Arrays, Lists, Maps, as well as Structures and working with structured data and container. Iterators, loops, conditionals, etc.

These are just what I could think of off the top of my head.. I'm sure there are lots of other things in the Purebasic command-set that could be taught in this way, using a single program project for a book.
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Re: 800 lines

Post by heartbone »

Man, it reads like you may have realized it with your preface, and perhaps your ideas are a logical fit for this thread in the context of trying to find a solution to some of the problems underlying beginners trying to learn the language, but it does not even come close to addressing any of the main ideas in my post.

Of course my questions were not aimed at you, and perhaps the people who should reply, can't be bothered to read or reply to all of the threads, so thanks Zach for your reply. It's better than nothing.
Keep it BASIC.
staringfrog
User
User
Posts: 58
Joined: Wed Feb 27, 2013 9:36 am

Re: 800 lines

Post by staringfrog »

heartbone,

you should actually blame me for this flagrant offtopic. Pardon, man, we thought '800 lines' had something to do with book-making business ;D

Zach,

you rob me of words. But naturally, I think revising Gary's book (by himself or else by some forum gurus) would suffice, when it comes to covering PB in general (and not in aspects, as I suggest)
Coding's men's knitwork.
BorisTheOld
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Apr 24, 2012 5:08 pm
Location: Ontario, Canada

Re: 800 lines

Post by BorisTheOld »

Zach wrote:In addition to all the stuff mentioned above (source code management, code structure, unit testing, commenting code, etc)
It could teach users important things on: .........
These are all good ides, but.................

The problem with writing any sort of technical documentation is that one needs to have a clear understanding of who the users are. In PB's case, users range from absolute beginners to those with 40 or more years experience. Writing a book about PB to serve such a wide audience would be a Hurculean task. And I suspect that only about 10% of the book would be useful to any one person. I certainly wouldn't want a book that explains how to code a Chequebook Balancer -- I've progressed a little beyond that in the past 50 years. :)

My own view is that books about programming languages are a waste of time. A well written language reference is a much more useful document, especially if there are meaningful code examples for every library and language feature.

PB is an excellent and versatile language, but the language reference and sample programs are barely adequate. Partly it's a lack of clarity or detail in the material, and partly it's because English is not the native language of the writers. I consider myself to be a fairly experienced programmer, but I often find it difficult to make sense of the material in the PB documentation.

If PB users want to be involved in creating documentation, then improving the existing reference material would be of much greater benefit to everyone.

However, if your idea is for someone to write a book about coding PB games in fewer that 800 lines, then you might be onto something. :)
For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
Zach
Addict
Addict
Posts: 1675
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: 800 lines

Post by Zach »

BorisTheOld wrote:
Zach wrote:In addition to all the stuff mentioned above (source code management, code structure, unit testing, commenting code, etc)
It could teach users important things on: .........
These are all good ides, but.................

The problem with writing any sort of technical documentation is that one needs to have a clear understanding of who the users are. In PB's case, users range from absolute beginners to those with 40 or more years experience. Writing a book about PB to serve such a wide audience would be a Hurculean task. And I suspect that only about 10% of the book would be useful to any one person. I certainly wouldn't want a book that explains how to code a Chequebook Balancer -- I've progressed a little beyond that in the past 50 years. :)

My own view is that books about programming languages are a waste of time. A well written language reference is a much more useful document, especially if there are meaningful code examples for every library and language feature.

PB is an excellent and versatile language, but the language reference and sample programs are barely adequate. Partly it's a lack of clarity or detail in the material, and partly it's because English is not the native language of the writers. I consider myself to be a fairly experienced programmer, but I often find it difficult to make sense of the material in the PB documentation.

If PB users want to be involved in creating documentation, then improving the existing reference material would be of much greater benefit to everyone.

However, if your idea is for someone to write a book about coding PB games in fewer that 800 lines, then you might be onto something. :)
It's not about learning to code a particular application. It's about learning the principles being taught by writing the program and absorbing the methods and concepts being discussed in the text while you do it. The type of program is practically irrelevant, so long as it is simple enough for a beginner to begin to grasp, and complex enough to have a demonstrable use for the command sets being taught through the lesson of writing it.

I think that sort of prejudice hinders an individuals progress in learning something new. I think it is also important to recognize that a large part of the community are hobbyists, and maybe some of them have capitalized on their knowledge to make a living off Purebasic in one form or another, but I don't think that represents the majority of the userbase; just look at the positive response to the two most popular (and only) beginner books available on this forum. Many people appreciate such "simple" works and probably do learn quite a bit from them.

Maybe I am in the minority, but I find documentations, while being an informative reference once I have grasped the basics of something, too hard to learn something by alone. Unless it is very basic things. A lot of newcomers need to be taught concepts such as good coding, program structure, etc. A documentation does a poor job at that, as everything is broken down into esoteric references and code snippets with a very narrow scope of view.

Many people learn both by example, and by having engaging/interactive fun. It's sort of like the style of the "Dummies" books, where they use more relatable every day examples to explain things. Something people can easily relate to in order to grasp on to a concept or idea. Like that one teacher in school who was "a bit off" in the head, or unconventional, but everyone loved their class because they learned a lot without realizing it by having so much fun.

If its good enough for kids, why not adults? We're all just larger versions of children anyway... You are never too old to learn something new.
staringfrog
User
User
Posts: 58
Joined: Wed Feb 27, 2013 9:36 am

Re: 800 lines

Post by staringfrog »

BorisTheOld and Zach,

as a matter of fairness, personally I like PB documentation, and it surely improves in the past years. Code examples are quite demonstrative, as well (tho' their corpus could be enlarged further, of course). And yet, chm documentation only represents single trees, and not the forest. That's when books come in handy, in the first place.

I second Zach on the idea that 'simple' books are always in need, and actually it takes a great deal of work to reach brevity and clarity. What are the ways of building up the main program loop, which one is preferred, and when? What's the better way to handle various events, when to bind a gadget to a callback and why bother? When to enumerate and when to PB_Any? There are tons of simple questions like these, and they need to be answered, time again, and from today's viewpoint. Gary's book remains sort of seminal general reference on the language, and PB community should take care of its updating, I believe.

However, my idea is a bit different. What I suggest is a series of books on most winning aspects of the language. All about 3D (and only). User libs and building your own lib (and only). PB and ASM. That's how books about tough languages are being written. Probably, the most salient feature of PureBasic is easy handling of WinAPI (tho' there are known demerits, too). In many ways, PB is much easier to use with Windows functions than C++, due to simplicity of the language itself and its pre-built structures. Nonetheless, try and search the web on using WinAPI with PB. All but nothing! Scarce snippets of code here on the forum, and on devout users' websites, and no coherent text on the subject to be found anywhere. A few pages in Gary's book, and they are quite enlightening. On the other hand, take books on 'Programming Windows'. All of them couple WinAPI with C++ (or VB, at least). So — why not writing a book not exactly on PureBasic, but on WinAPI with PureBasic, to demonstrate the beauty of both when they are crossed. That would be 1) a great promotion of PB among programming enthusiasts, 2) a highly useful reference 3) intended for both experts and noobs (like meself). Plus, there's a plethora of books on WinAPI, to be taken as a step-by-step basis.
Coding's men's knitwork.
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Re: 800 lines

Post by heartbone »

BorisTheOld wrote:...PB is an excellent and versatile language, but the language reference and sample programs are barely adequate. Partly it's a lack of clarity or detail in the material, and partly it's because English is not the native language of the writers. I consider myself to be a fairly experienced programmer, but I often find it difficult to make sense of the material in the PB documentation...
I totally agree.
But I do like the documentation in its PDF form because its all one document which can be searched.
I almost had to resort to looking stupid by posting a forum question about where is the timer function, but was saved by a last minute search on 'millisecond'. None of the other normally associated English words worked.
Keep it BASIC.
Post Reply