[new feature] Show me the code

Erel

B4X founder
Staff member
Licensed User
Longtime User
One of the expectations from the IDE is to bring the relevant information to the developer.

It is nice that the IDE shows you the subs signatures and comments however it is even nicer if it will allow you to see the subs code without needing to jump back and forth:

w6Qx7osSFM.gif
 

AnandGupta

Expert
Licensed User
Longtime User
WOW ! WOW !!
Never thought that can be possible !!!

Thanks a lot :)

Regards,

Anand
 

Erel

B4X founder
Staff member
Licensed User
Longtime User

AnandGupta

Expert
Licensed User
Longtime User
Just to be clear.
  1. Our own code, in service / code etc. module, will show code
  2. .bas library added from forum, will show code
  3. .bxlib library added from forum, will show code
  4. .jar library added from forum, will NOT show code
Right ?

Regards,

Anand
 

Cableguy

Expert
Licensed User
Longtime User
Just to be clear.
  1. Our own code, in service / code etc. module, will show code
  2. .bas library added from forum, will show code
  3. .bxlib library added from forum, will show code
  4. .jar library added from forum, will NOT show code
Right ?

Regards,

Anand

I would erase the "from the forum" part, as it is not conditioned by where it came from, but by the type.

B4x libs are a set of modules/files and are quite unlike "standard" libs.
Bas files are code modules/classes.
These two, plus the "in project code" should be visible by the new feature...
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4x libs are a set of modules/files and are quite unlike "standard" libs.
I don't see it like this. b4xlibs are very similar to natively written libs. Just kept in a different structure that allows them to be cross platform.

To make things clear: it will NOT show code from b4xlibs.
 

AnandGupta

Expert
Licensed User
Longtime User
To make things clear: it will NOT show code from b4xlibs.
Well it is good for library writers who will not want their codes to be seen, for obvious reason. At least not easily.

But then the feature is less useful to beginners like me who need/like to study the code of others library, while using the 'said' library function. Looking at our own codes is not very useful, to me at least.

Though this feature is very much useful to masters who have tons of code and make libraries, and need to refer to a 'said' function code.

Hoping, this will become useful to me in few years, when I have substantial codes :)

Regards,

Anand
 
Last edited:

Sandman

Expert
Licensed User
Longtime User
it will NOT show code from b4xlibs
For me this is the correct approach.

I'm not making libs for other people, but I do use them quite a bit for myself. And once I'm done with a library I consider it pretty much a "black box" where I (in my main project, where I use the libraries) don't care about the inner workings of them. This is also a good approach as it helps me be disciplined on how I design my libraries - if I need to constantly peek inside it to use it correctly, I would probably consider it poorly designed and constructed. (This mindset can be compared to the official libraries, which we all use without knowing what Erel made in them. They are well designed, we just use them, and life is good.)
 

Jorge M A

Well-Known Member
Licensed User
Wow! A very powerful addition in favor of RAD!

I would only allow me to make one suggestion:
That the appearance of the SUB code was "on demand", that is, by selecting the full name of the SUB, and pressing ALT+F12 (Peek Definition), so that the behavior would be standard with other IDEs, and avoid that the sudden display of the code could be obstructive or distracting.

Thank you very much @Erel!

upload_2019-11-15_8-44-44.png
 

AnandGupta

Expert
Licensed User
Longtime User
This mindset can be compared to the official libraries, which we all use without knowing what Erel made in them. They are well designed, we just use them, and life is good.
I agree on this context.
But many a times we the beginners are suggested "b4xlibs is a zip file, open it and make changes in .bas and zip it back", search the forum for it.

So for us it will be of immense help if it was supported. For masters here who make libraries it is ok for them but for learners it would have helped. Anyway when Erel is making this feature he will decide what is good for us and what is not. I leave on him.

Regards,

Anand
 

OliverA

Expert
Licensed User
Longtime User
But many a times we the beginners are suggested "b4xlibs is a zip file, open it and make changes in .bas and zip it back", search the forum for it.
I think it gets a little bit complicated with b4xlibs. It is up to the author of the lib if you are allowed to look at/copy/modify the source (example @Star-Dust, who is providing b4xlibs with the understanding that people do not look at/copy/modify the code). Therefore, b4xlibs should be treated like regular libraries.

But then the feature is less useful to beginners like me who need/like to study the code of others library, while using the 'said' library function. Looking at our own codes is not very useful, to me at least.
For those libraries that allow you to look at the code, you could, for studying purposes, unpack the libraries and include the relevant .bas files in your project. This may seem like an extra step, but remember, at least you are looking at basic code. For java libraries, whose source is available online, you pretty much need to know some Java to become familiar with the internal workings of them. Plus the code viewing (proposed here) would never integrate as well as the unpacked b4xlib.
 

klaus

Expert
Licensed User
Longtime User
But many a times we the beginners are suggested "b4xlibs is a zip file, open it and make changes in .bas and zip it back", search the forum for it.
I don't agree with this!
In my opinion, you have never been suggested, as a beginner, to modify a b4xlib and rezip it!
And this will deal to problems, because when the developer updates the library, your modifications will NOT be included. Which means that you need to look what changes were made and update your version.
But, it can be interesting to study what has been done and how in a b4xlib. I have done it to study some b4xlibs from Erel.
 
Top