Where is FB now?

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Where is FB now?

Post by BasicCoder2 »

marcov wrote:
I think it is wiser to discuss where FB should be in 5 (and 10) years, and forget World Domination.

My question would also be: Where is FB now?

Has it ever been anywhere apart from being a powerful update to QBASIC for people like me who live in the QBASIC past and for the few here with the expertise to use it as they might C++. Indeed I wonder why they would not simply use C++ instead?

Earlier on (5 years ago) there seemed to be activity with regards to writing simple 2D games but that has faded away.

What software has anyone written in FreeBasic, both with and without using libraries, that anyone actually uses?

It seems to me that the bottom line is that without wide spread support a language is handicapped beyond redemption for any serious programming for, as far as I can tell, no one can write the complex programs from scratch that we see today instead they build on the work of others that is encapsulated in libraries.
.
grindstone
Posts: 862
Joined: May 05, 2015 5:35
Location: Germany

Re: Where is FB now?

Post by grindstone »

The arguments for and against FreeBasic could fill a book, but I think its main advantage is that it's similary suitable for beginners and for experts. When you get first in touch with FB, it will last not longer than 10 minutes to get a "Hello world" message on the screen, and, on condition that you got the knowledge, you can also write a whole OS with it.

And FB definitely would have no future if it was not able to use libraries. It's the great benefit of the human race that we can build on the work of our predecessors, so not everyone has to invent the wheel again.

I would say: Don't be pessimistic. It's up to a bunch of idealists like us to make FreeBasic popular (or at least keep it alive)!

Greetings
grindstone
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Where is FB now?

Post by MrSwiss »

BasicCoder2 wrote:Indeed I wonder why they would not simply use C++ instead?
They might just hate:
  • curly braces "{}"
    endless break statements in switch (block)
    forced line endings ";"
    etc.
This list is by no means complete. Keep smiling ;-) ...
ike
Posts: 387
Joined: Jan 17, 2011 18:59

Re: Where is FB now?

Post by ike »

Indeed I wonder why they would not simply use C++ instead?
You dont need Boing747 to go to work. Bus or car is better choice

C++ may be better for a team of 10 working on same project, or writing a library 100000 lines of code, but for everyday life FB may be better

SIMPLE PROGRAM in C++

Code: Select all

#include <FL/Fl.H> 
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Output.H>
using namespace std;

//---------------------------------------------------
 
class SimpleWindow : public Fl_Window{
 
   public:
      SimpleWindow(int w, int h, const char* title );
      ~SimpleWindow();
      Fl_Button* copy;
      Fl_Button* quit;
      Fl_Input* inp;
      Fl_Output* out;
    
   private:
      static void cb_copy(Fl_Widget*, void*);
      inline void cb_copy_i();
  
      static void cb_quit(Fl_Widget*, void*);
      inline void cb_quit_i();
};

//----------------------------------------------------

int main (){
  
   SimpleWindow win(300,200,"SimpleWindow");
   return Fl::run();
}

//----------------------------------------------------

SimpleWindow::SimpleWindow(int w, int h, const char* title):Fl_Window(w,h,title){
    
   begin();
      copy = new Fl_Button( 10, 150, 70, 30, "C&opy");
      copy->callback( cb_copy, this );
     
      quit = new Fl_Button(100, 150, 70, 30, "&Quit");
      quit->callback(cb_quit, this);
   
      inp = new Fl_Input(50, 50, 140, 30, "Input:");
      out = new Fl_Output(50, 100, 140, 30, "Output:");
   end();
   resizable(this);
   show();
}

//----------------------------------------------------

SimpleWindow::~SimpleWindow(){}

//----------------------------------------------------

void SimpleWindow::cb_copy(Fl_Widget* o, void* v) {    
    ( (SimpleWindow*)v )->cb_copy_i();
}


void SimpleWindow::cb_copy_i() {

   out->value(inp->value());  
}

//----------------------------------------------------

void SimpleWindow::cb_quit(Fl_Widget* , void* v) {

   ( (SimpleWindow*)v )->cb_quit_i();
}


void SimpleWindow::cb_quit_i() {

    hide();
}

//----------------------------------------------------

SAME IN FB

Code: Select all


#include once "fltk-c.bi"

namespace T
DIM AS Fl_Input PTR in1, in2
DIM AS Fl_Button PTR btn1, btn2
DIM AS Fl_Window PTR win
end namespace
'#############################################################
SUB T_btn1_cb CDECL (widget AS FL_WIDGET PTR)
   Fl_Input_SetValue (T.in2, *Fl_Input_GetValue(T.in1))
END SUB 
SUB T_btn2_cb CDECL (widget AS FL_WIDGET PTR)
   Fl_WindowHide T.win
END SUB 
'#############################################################
SUB FormTCREATE()
   IF T.win THEN RETURN

   DIM AS INTEGER xx,yy,ww,hh
   Fl_ScreenWorkAreaXYWH xx, yy, ww, hh
   T.win = Fl_Double_windowExNew2((ww-300)/2, (hh-180)/2, 300, 180, "WINDOW")
   Fl_WindowSetModal (T.win)
   T.btn1 = Fl_ButtonNew(0, 10, 50, 25, "Copy") 
   Fl_WidgetSetCallback0 T.btn1, @T_btn1_cb 
   T.btn2 = Fl_ButtonNew(0, 40, 50, 25, "Quit") 
   Fl_WidgetSetCallback0 T.btn2, @T_btn2_cb 
   T.in1 = Fl_InputNew(100, 70, 150, 25, "Input") 
   T.in2 = Fl_InputNew(100, 100, 150, 25, "Output") 
   Fl_GroupEnd T.win
END SUB

SUB FormTSHOW()
   Fl_WindowShow T.win
END SUB

'MAIN
FormTCREATE
FormTSHOW
Fl_Run

Last edited by ike on May 09, 2015 18:57, edited 1 time in total.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Where is FB now?

Post by BasicCoder2 »

@MrSwiss

Yes 90% of my syntax errors in C was forgetting the ;
I notice Python uses a :

It is like the .NET 2.0 versions of c# and vb.
Some say vb is too verbose others that c# is too cryptic.
I assume c# exists to make it easier for c++ or Java programmers to feel comfortable or maybe to make them feel they are using a professional grown up language.
Apparently c# programmers make more money. Same .NET framework but perception is reality.

The problem with FreeBasic is although some very talented people are involved in the FB project there are many more involved in the popular languages. So if I wanted to interface RoboRealm I would have to use JavaScript or Python. Python is very well supported with extra things you can import.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Where is FB now?

Post by BasicCoder2 »

@ike,
Very nice. I haven't used fltk before but managed to run your program thanks to the guru D.J Peters after visiting,
http://www.freebasic.net/forum/viewtopi ... 14&t=21548

I like seeing code written in both C++ and FreeBasic as I would like to be able to move between both languages as I am familiar with C++ and it would be an easier learning curve to get better with C++ than learning a completely new language.

.
ike
Posts: 387
Joined: Jan 17, 2011 18:59

Re: Where is FB now?

Post by ike »

I have seen so many failed projects because they made mistake at first step: choosing right tools

They choose C++ which is good tools, but not for simple medium size projects, because you will spend more time and
source code is not readable to average programmer.

or

JAVA, CSHARP -> miserable failure (wouldnot touch it with 2m stick)
==============================

you can use NOT OO style

Code: Select all

#include <fltk/Window.h>
#include <fltk/Widget.h>
#include <fltk/run.h>
using namespace fltk;

int main(int argc, char **argv) {
  Window *window = new Window(300, 180);
  window->begin();
  Widget *box = new Widget(20, 40, 260, 100, "Hello, World!");
  box->box(UP_BOX);
  box->labelfont(HELVETICA_BOLD_ITALIC);
  box->labelsize(36);
  box->labeltype(SHADOW_LABEL);
  window->end();
  window->show(argc, argv);
  return run();
}
Post Reply