Jump to content

removing unused #include?


Burgaud
 Share

Recommended Posts

After several modifications to scripts, I end up with several #include that I am not sure still in use.

What is the best procedure for removing unused #includes then?

a) Delete the #Include and see if script will crash? rinse repeat

b) just have them and forget it...

 

 

Link to comment
Share on other sites

You could also take a look at the thread organize-includes

EDIT :

Quote

b) just have them and forget it...

I would not recommend this, for the sake of clean code ;).

Edited by Musashi

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

Check also this nice feature, it is not perfect, but very useful for me.  We know pretty much the BIG includes that we need, but those that relates to constants are not always very clear :

#AutoIt3Wrapper_Add_Constants=y

 

Edited by Nine
Link to comment
Share on other sites

  • Developers
4 minutes ago, JockoDundee said:

There goes most of my code :)

+80%  in Lines&Characters is quite common yes....

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

The savings mainly come from the #included files which sub include a lot of other files.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

On 2/5/2021 at 5:33 PM, JockoDundee said:

superfluous #includes

Maybe look up the definition of "redundant"?

Link to comment
Share on other sites

6 hours ago, RTFC said:

Maybe look up the definition of "redundant"?

Ok.

75A4AEBC-A309-4F67-8D30-0421502C34B2.thumb.png.d21883be2b66fd27e7efbea9fe9adced.png
I can see your confusion and I sympathize, at the same time and as you can see above, redundant can be used in a way that is not wholly synonymous with superfluous.  
To wit, redundant applied to the subject at hand could mean #includes that are repeated; as is not an uncommon usage, for example:

D7DCD439-68B8-494B-8624-5B139E14EE50.thumb.jpeg.804dd09c6cc8f676b3426d8735dbf3ca.jpeg
Redundant, used in that sense, draws a clear, if subtle distinction with superfluous; for instance an #include that is merely extraneous, as opposed to duplicative. Support for this parochial usage of superfluous in this sense is also extant.

If we apply our faculties for discernment fully, we would see that the OP is specifically referring to the use case most precisely defined as superfluous, (although, I do not deny that being superfluous always carries an unshakeable taint of redundancy).

On 2/5/2021 at 5:33 AM, Burgaud said:

After several modifications to scripts, I end up with several #include that I am not sure still in use.

Moreover, the usage is not purely pedantic;  the logic for a tool designed to root out just duplicative includes instead of extraneous includes could diverge greatly; namely the in the former case one could merely scan #include statements and without further investigation into their contents, be determinative.

Penultimately, and by way of an excuse, I would like to note that in my original post, the word superfluous was intentionally emphasized.

On 2/5/2021 at 8:33 AM, JockoDundee said:

Yes, but does it produce a list of superfluous #includes?

And as is evident, the language mirrors your statement in my rejoinder, clearly intending to make the distinction between the two adjectives (to which you very astutely were aware of, at least on some level )

On 2/5/2021 at 7:09 AM, RTFC said:

CodeScanner will produce a list of redundant #includes.

Finally, and IMHO, when we are presented with such clues, we should do our best to indulge our conversational partner by striving to look for their intended meaning with an earnest effort; and avoid the temptation of issuing a reflexively puerile response.

Edited by JockoDundee
My parenthetical ending above “some level)” caused an emoticon to be inadvertently created, so I added a space before the paren.

Code hard, but don’t hard code...

Link to comment
Share on other sites

https://www.google.com/search?q=redundant&ie=UTF-8&oe=UTF-8&hl=en-us&client=safari

Honestly I’m tired of reading your mindless drivel.  You know what he meant as did we all but you like to misconstrue stuff in your twisted views  that you may think is logic. Please stop

 

adjective
  1. not or no longer needed or useful; superfluous.
    "many of the old skills had become redundant"
Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

  • Developers
1 hour ago, Earthshine said:

Honestly I’m tired of reading your mindless drivel.  

Just hit the ignore button when you feel he's making stupid remarks!  (so guess you don't need to react often ;) ) 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

7 hours ago, Earthshine said:

Honestly I’m tired of reading your mindless drivel.

Honestly, I believe you, it can’t be fun.
For others not aware, here is the most recent “mindless drivel”, (posted yesterday) that Earthshine may have found especially “tiring to read”, in response to him steadfastly insisting that fast boot times are more attributable to faster CPU’s than the use of SSD’s.  

 

 

Code hard, but don’t hard code...

Link to comment
Share on other sites

  • Moderators

JockoDundee & Earthshine,

Enough. If you want to continue then do so by PM. Any more posts like those above in open forum and you will both find it hard to post at all for a while.

All clear?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...