PureBasic / SpiderBasic maintenance

Everything else that doesn't fall into one of the other PB categories.
Joubarbe
Enthusiast
Enthusiast
Posts: 555
Joined: Wed Sep 18, 2013 11:54 am
Location: France

PureBasic / SpiderBasic maintenance

Post by Joubarbe »

Hi,

I've learned programming with PB in the past and today I'm a web developer using TypeScript, mostly. Now that I know about OOP (note that I'm not asking PB to become OOP :)), I'm wondering about something said on the SpiderBasic website, which very likely also applies to PB:
SpiderBasic is not object oriented because we do believe that object oriented programs are very hard to maintain.
PB/SB are not as dynamic as modern languages, such as Python or JavaScript. It can be a good thing or a bad thing, that's not my point here. In these languages, especially in the Web, reorganizing the code, rethinking the design, is almost a daily task. Everything is moving very fast (too fast) and the growing number of existing frameworks is not something good, in my opinion. But it says something: either we don't know how to properly maintain our code, or the existing solutions (test-driven programming for instance) are not applied, or cannot be.
Either way, all these languages are OOP. I'm not a computer scientist, and I can't figure out whether the programming problems we encounter nowadays are related to that paradigm (partially, at least).

So... how PureBasic is easier to maintain than an OOP language? I'm obviously talking about big projects here.
HanPBF
Enthusiast
Enthusiast
Posts: 562
Joined: Fri Feb 19, 2010 3:42 am

Re: PureBasic / SpiderBasic maintenance

Post by HanPBF »

For organizing big projects we have in PureBasic
- modules
- procedures
- interfaces (enough OOP)
- overloading: default parameters
- inheritance: interface B extends A
- regions in editor

Only little things do not work:
- no tree in procedure browser (but most users would simply use more files)
- only text based parsing for jumping around in source code (ctrl-l; ctrl-dblclick on procedure name)
- some little things more which are all not so important

Maintenance means to manage more things than "OOP".

The nowadays "current" paradigma used is often OOP with functional extension (exp. Kotlin)

I don't think programming language is responsible of over 5% of the problems to be solved when programming.

OOP is dangerous when a new programmer may think simply having this paradigm in a programming language solves many to all problems.
Then, with OOP the chaos created is "ubiquitous" (probably more than it would be with procedures)...
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: PureBasic / SpiderBasic maintenance

Post by netmaestro »

Fred or Freak would be most qualified to answer here, but you can bet that if they say it, it's true.
BERESHEIT
Joubarbe
Enthusiast
Enthusiast
Posts: 555
Joined: Wed Sep 18, 2013 11:54 am
Location: France

Re: PureBasic / SpiderBasic maintenance

Post by Joubarbe »

I don't doubt it. As you said, it would be great if they could answer :)

A best practices guide would maybe enlighten some of us as well. Even the best language can be badly used, and if they say that it's easy to maintain, they must have something clear in mind.
Bitblazer
Enthusiast
Enthusiast
Posts: 732
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: PureBasic / SpiderBasic maintenance

Post by Bitblazer »

Why dont you simply learn both paradigmas and use what works best for the current job and for yourself?

Personally i did commercial projects with c# and .net after private projects with Purebasic and i enjoyed both. Currently i am back to PB for a project because its a great tool for that project and i enjoy using it. In the future i plan to use either spiderbasic or a c# variation for an android project and if a new interesting project shows up for an industry job, i will use the language/software best suited for that. Learn to use multiple tools so you can pick the most efficient one to get something done based on experience instead of trying to use a screwdriver as a hammer just because you are a screwdriver expert ;)

Btw. there are afaik (from learning 13+ programming languages) 4 (radically) different paradigms, but i havent yet had a problem where 2 of those where the ideal solution, but maybe tomorrow. As they say "the only constant in life, is change".
webpage - discord chat links -> purebasic GPT4All
Thorium
Addict
Addict
Posts: 1271
Joined: Sat Aug 15, 2009 6:59 pm

Re: PureBasic / SpiderBasic maintenance

Post by Thorium »

The problem with OOP is that it has big promisses, but mostly does not deliver on them. Most people don't stick strictly to OOP, they mix OOP and imperative. And that defeats the point of OOP and makes it hard to maintain. But if you stick strictly to OOP you will have a lot of problems organizing your objects.

If you are interessted to learn about the problems of OOP and possible reasons why it's used so much even if it does not deliver on it's promisses. I recommend you to Brian Wills YouTube channel.
He actualy proves his points by rewriting OOP code into imperative procedural code, while making it smaler and simpler. And that not just with small examples. He rewrote a emulator for example.

https://www.youtube.com/watch?v=V6VP-2aIcSc
https://www.youtube.com/watch?v=QM1iUe6IofM
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 664
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Re: PureBasic / SpiderBasic maintenance

Post by Kurzer »

I've programmed my whole life procedurally (I am 49 now and I'm self-taught, never learned that in an education.). I've programmed professionally and privately, but I have always shied away from "thinking outside the box" (that means trying out other paradigms or languages).

Some attempts to deal with OOP failed because I didn't have enough time to learn the new language and especially the related paradigms. Often there was also a problem using the development environment because I didn't know the processes (headerfiles, makefile, link to objectcode and so on). For me there was always only "just press the compile button and the exe is done".

Although I used to program Basic, Rexx, Pascal, Assembler and Microcontroller Assembler, I was never "forced"to switch to OOP.

Now to your concern. After mk-soft introduced his OOP module, there was a "soft" introduction to OOP for me. Maybe what I can create with his OOP module is not the "whole world of OOP", but I can continue to program my projects in PureBasic and decide how much OOP I want to use. I find this very pleasant because it allowed me to continue working on a project without first having to reach another level of "OOP enlightment" to be able to realize certain things.

Therefore I would recommend to have a look at the OOP module and the corresponding examples of mk-soft: http://www.purebasic.fr/english/viewtop ... 12&t=64305
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2023: 56y
"Happiness is a pet." | "Never run a changing system!"
Joubarbe
Enthusiast
Enthusiast
Posts: 555
Joined: Wed Sep 18, 2013 11:54 am
Location: France

Re: PureBasic / SpiderBasic maintenance

Post by Joubarbe »

Just a feeling here... I don't have enough experience (will I ever have it?) or computer scientists skills to state whether or not OOP is a bad idea, but I'm working with TypeScript every day, and I feel that something's wrong out there. I miss the control I had with PureBasic. Too many things going in background. A simple C# app takes 100Mb of RAM. You import so many things you don't even know the original framework; you just learn the layers that are built over it. And these layers, at the end, are a multitude of blocks, heterogeneous and disorganized. I wish that in the future we're going back to "one-block" type of programming. Anyway, I'm gonna watch these videos!

As for the mk-soft module, I don't think that's a good idea. I've spent some times with his module in the past. Too verbose for me. Still, I get what you're saying. That's why I like languages such as TypeScript and Python, dynamically typed (respectively weak and strong typing), not forced into classes, unlike Java or C#.
Thorium
Addict
Addict
Posts: 1271
Joined: Sat Aug 15, 2009 6:59 pm

Re: PureBasic / SpiderBasic maintenance

Post by Thorium »

Joubarbe wrote:Just a feeling here... I don't have enough experience (will I ever have it?) or computer scientists skills to state whether or not OOP is a bad idea, but I'm working with TypeScript every day, and I feel that something's wrong out there. I miss the control I had with PureBasic. Too many things going in background. A simple C# app takes 100Mb of RAM. You import so many things you don't even know the original framework; you just learn the layers that are built over it. And these layers, at the end, are a multitude of blocks, heterogeneous and disorganized. I wish that in the future we're going back to "one-block" type of programming.
Thats not realy a OOP problem, you can use OOP even in assembler, if you want, without any frameworks. It's just a different way of structuring your code. The problem i have with OOP is, that it only takes into account how you think as a human, not what makes sense from the computers perspective. That often leads to poorly written code, because the coder itself has to understand how the computer works in order to make code that is easy to process for the computer. Possibly the OOP mindset is birthing a lot of abstraction frameworks, which actualy overcomplicate a lot of tasks.
Joubarbe wrote: That's why I like languages such as TypeScript and Python, dynamically typed (respectively weak and strong typing), not forced into classes, unlike Java or C#.
The difference is if it's a compiler language or if it's a script language. A compiler language like PureBasic is static by design. It's not dynamic, but can be a lot faster than a dynamic script language like Python. Both have their place and uses.
Joubarbe
Enthusiast
Enthusiast
Posts: 555
Joined: Wed Sep 18, 2013 11:54 am
Location: France

Re: PureBasic / SpiderBasic maintenance

Post by Joubarbe »

This part is probably a good answer to my original question.

Go looks interesting. I'm gonna take a look at it.
Thanks for the links. I agree with him on that one.
Post Reply