It is currently February 4th, 2023, 3:40 am

Opinion of Easy-ness of Code Read-abiliy

Get help with creating, editing & fixing problems with skins
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Opinion of Easy-ness of Code Read-abiliy

Post by JpsCrazy »

Right now, I'm COMPLETELY redoing alllll of the code I did for the one skin I did, and most of all I need your opinion.
The unnecessary background story:
I made a Zelda skin that measure CPU usage, RAM, Free Space, and Battery. After getting more skins I realized, everyone wants what THEY want, not necessarily what the creator wants. Why not make a skin more usable for everyone with everything very simply written out? So that's what I'm doing. Making every option of a measure a variable, and then having a variables.inc file that the skin is directed to. There's 6 measures, and 6 corresponding meters. Every measure is used with meter=bar.
There's 6 measures within the one skin.
Would you rather read something with all the variables grouped in a list like:
[Variables]
Measure1=
Measure2=
Measure3=

InvertMeasure1=
InvertMeasure2=
InvertMeasure3=

UpdateDivider1=
UpdateDivider2=
UpdateDivider3=

etc...
Or like this? (This forum doesn't support tabs so I just typed it in)
[Variables]
Measure1=
[TAB]InvertMeasure1=
[TAB]UpdateDivider1=

Measure2=
[TAB]InvertMeasure2=
[TAB]UpdateDivider2=

Measure3=
[TAB]InvertMeasure3=
[TAB]UpdateDivider3=

etc...
There's going to be EVERY option for any measure that can be used with a meter=bar, including plugins. Just keep that in mind.



And since I'm already posting something... I was planning on testing it just for myself, but might as well ask here.
Can all of these measures/plugins be used with meter=bar/am I missing any measures/plugins that can be used with meter=bar?
The measures I'm using are:
CPU, FreeDiskSpace, Memory, NetIn, NetOut, NetTotal, Perfmon, PhysicalMemory, Plugin, SwapMemory
The plugins I'm using are:
AdvancedCPU, PerfMon, Power, ResMon
[Edit] I'm reconsidering if the Net-s work with meter=bar. I'm starting to think no.
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: Opinion of Easy-ness of Code Read-abiliy

Post by dragonmage »

Personally, I think just grouping all your measures together gives you the same effect as this. I'm not exactly sure what you are trying to accomplish here, so I guess I will wait to see where you go with this.
User avatar
jsmorley
Developer
Posts: 22558
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Opinion of Easy-ness of Code Read-abiliy

Post by jsmorley »

I find a couple of concepts work best for me.

1) DON'T organize a complicated skin with all the measures first and then all the meters. There are two reasons. First, you can get some weird lag since Rainmeter does things sequentially in the skin. So if a network measure is 1,000 lines away from the display meter for it the results can be strange. Second, I find it MUCH easier to read a skin that is "grouped" by function. network measures, network meters, hard drive measures, hard drive meters.

2) Use comments... Describe things at least at that "group" level so a user can skim through the skin and find the network stuff easily. Have a "header" comment section at the very top if there is important hints / information an end user should know.

3) Use names for measures and meters that help the user understand what they are for. I find the approach of having [M-1] or some other arcane naming scheme for measures and meters pointlessly obtuse. I know that short/crypic measure names can make writing complicated CALC measures easier for the author, but there is a trade-off with ease of understanding by the users who want to modify your skins.

I even ALWAYS put the type of "section" right in the name. it allows you to have names that help show the linkage between a measure and a meter while still having unique names.

[MeasureNetWorkInput]
Measure=NetIn

[MeterNetworkInput]
Meter=String

4) Use, but don't overuse, @Includes and MeterStyles. There is no point in having a user have to chase down a rabbit hole trying to unwind a skin using muiltiple @Includes and MeterStyles if they serve no purpose. They are meant to make a skin shorter and to share variables between skins in a suite. If they are not needed in a skin, don't use them.

5) Use variable names that make sense.

Good:
[Variables]
FontFace1=Trebuchet MS

[MeterOne]
FontFace=#FontFace1#

Bad:
[Variables]
F1=Trebuchet MS

[MeterOne]
FontFace=#F1#

Here is a sample skin that while not perfect by any means, pretty much follows these principles.

Code: Select all

;=================================================
; Rainmeter configuration file
; Updated January 12, 2010
;=================================================

;[BEGIN CONFIG FILE]==============================

[Rainmeter]
Author=Jeffrey Morley
BackgroundMode=2
SolidColor=0,0,0,1
Update=500

[Metadata]
Name=JSSystem
Config=JSMeter | JSSystem
Description=Right hand side bar with system information
Instructions=Edit UserVariables.inc to change colors, drives, etc. | See this .ini to see how to add CPU cores
Version=January 12, 2010
Tags=System | CPU | Memory | Drives | Network | Uptime | USB | Screen | Uptime | TopProc
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Variant=0
Preview=

[Variables]
@Include="..\UserVariables.inc"

;[GATHER CPU UTILIZATION]=========================

[MeasureCPU]
Measure=CPU

;[CPU UTILIZATION]===============================

[MeasureCPUText]
Meter=STRING
SolidColor=0,0,0,2
Percentual=1
X=135
Y=20r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=11
StringStyle=NORMAL
StringAlign=RIGHT
AntiAlias=1
NumOfDecimals=1
Text="CPU Usage:"
LeftMouseDownAction=!Execute ["#RunOnCPUClick#"]

[MeasureCPU%]
MeasureName=MeasureCPU
Meter=STRING
Percentual=1
X=175
Y=0r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=11
StringStyle=NORMAL
StringAlign=RIGHT
AntiAlias=1
NumOfDecimals=1
Text="%1%"

;[Top Process]==================================

[MeasureTopProcessName]
Measure=Plugin
Plugin=Plugins\AdvancedCPU.dll
TopProcess=2
CPUExclude=#CPUExclude#
UpdateDivider=2

[MeasureTopProcess%]
Measure=Plugin
Plugin=Plugins\AdvancedCPU.dll
TopProcess=1
CPUExclude=#CPUExclude#
UpdateDivider=2

[MeterTopProcessText]
Meter=STRING
MeasureName=MeasureTopProcessName
MeasureName2=MeasureTopProcess%
W=150
H=15
X=175
Y=19r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=9
StringStyle=NORMAL
StringAlign=RIGHT
AntiAlias=1
ClipString=1
Scale=200000
Text=%1 [%2%]

;[SCREEN RESOLUTION]==============================

[MeterScreenArea1]
Meter=STRING
X=175
Y=22r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=10
StringStyle=NORMAL
StringAlign=RIGHT
AntiAlias=1
Text="Screen: #PSCREENAREAWIDTH# x #PSCREENAREAHEIGHT#"

[MeterScreenArea2]
Meter=STRING
X=175
Y=19r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=8
StringStyle=NORMAL
StringAlign=RIGHT
AntiAlias=1
Text="Second: #SCREENAREAWIDTH@2# x #SCREENAREAHEIGHT@2#"

;[GATHER MEMORY]==================================

[MeasurePhysMemTotal]
Measure=PhysicalMemory
Total=1
UpdateDivider=2

[MeasurePhysMemUsed]
Measure=PhysicalMemory
UpdateDivider=2

[MeasurePhysMemFree]
Measure=PhysicalMemory
InvertMeasure=1
UpdateDivider=2

;[PHYSICAL MEMORY]================================

[MeterMemTotalRound]
Meter=ROUNDLINE
MeasureName=MeasurePhysMemTotal
X=42
Y=25r
W=40
H=40
StartAngle=4.71238898
RotationAngle=6.28318531
LineLength=20
LineStart=15
LineColor=#LineColor2#
Solid=1
AntiAlias=1
Percentual=1

[MeterMemUsedRound]
Meter=ROUNDLINE
MeasureName=MeasurePhysMemUsed
X=42
Y=0r
W=40
H=40
StartAngle=4.71238898
RotationAngle=6.28318531
LineLength=17
LineStart=12
LineColor=#LineColor1#
Solid=1
AntiAlias=1
Percentual=1

[MeterFreeMemText%]
MeasureName=MeasurePhysMemFree
Meter=STRING
X=52
Y=14r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=7
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
DynamicVariables=1
Text="%1%"
Percentual=1
AutoScale=1

[MeterTotalMemText]
MeasureName=MeasurePhysMemTotal
Meter=STRING
X=175
Y=-11r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=9
StringStyle=NORMAL
StringAlign=RIGHT
AntiAlias=1
Text="RAM: %1B"
AutoScale=1

[MeterFreeMemText]
MeasureName=MeasurePhysMemFree
Meter=STRING
X=175
Y=18r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=11
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
Text="%1B"
AutoScale=1

;[GATHER DRIVES]==================================

[MeasureTotalDrive1]
Measure=FreeDiskSpace
Drive=#Drive1#
Total=1
UpdateDivider=2

[MeasureFreeDrive1]
Measure=FreeDiskSpace
Drive=#Drive1#
UpdateDivider=2

[MeasureUsedDrive1]
Measure=FreeDiskSpace
Drive=#Drive1#
InvertMeasure=1
UpdateDivider=2

[MeasureTotalDrive2]
Measure=FreeDiskSpace
Drive=#Drive2#
Total=1
UpdateDivider=2

[MeasureFreeDrive2]
Measure=FreeDiskSpace
Drive=#Drive2#
UpdateDivider=2

[MeasureUsedDrive2]
Measure=FreeDiskSpace
Drive=#Drive2#
InvertMeasure=1
UpdateDivider=2

;[MEASURE READS]==================================

[MeasureDrive1Reads]
Measure=Plugin
Plugin=PerfMon.dll
PerfMonObject=LogicalDisk
PerfMonCounter=Disk Read Bytes/sec
PerfMonInstance=#Drive1#
PerfMonDifference=1

[MeasureDrive2Reads]
Measure=Plugin
Plugin=PerfMon.dll
PerfMonObject=LogicalDisk
PerfMonCounter=Disk Read Bytes/sec
PerfMonInstance=#Drive2#
PerfMonDifference=1

;[MEASURE WRITES]=================================

[MeasureDrive1Writes]
Measure=Plugin
Plugin=PerfMon.dll
PerfMonObject=LogicalDisk
PerfMonCounter=Disk Write Bytes/sec
PerfMonInstance=#Drive1#
PerfMonDifference=1

[MeasureDrive2Writes]
Measure=Plugin
Plugin=PerfMon.dll
PerfMonObject=LogicalDisk
PerfMonCounter=Disk Write Bytes/sec
PerfMonInstance=#Drive2#
PerfMonDifference=1

;[READ ACTIONS]====================================

[Drive1ReadsAction]
Measure=Calc
Formula=MeasureDrive1Reads
IfAboveAction=!execute [!RainmeterHideMeter MeterDrive1ReadsOff][!RainmeterShowMeter MeterDrive1ReadsOn]
IfAboveValue=0
IfEqualAction=!execute [!RainmeterHideMeter MeterDrive1ReadsOn][!RainmeterShowMeter MeterDrive1ReadsOff]
IfEqualValue=0

[Drive2ReadsAction]
Measure=Calc
Formula=MeasureDrive2Reads
IfAboveAction=!execute [!RainmeterHideMeter MeterDrive2ReadsOff][!RainmeterShowMeter MeterDrive2ReadsOn]
IfAboveValue=0
IfEqualAction=!execute [!RainmeterHideMeter MeterDrive2ReadsOn][!RainmeterShowMeter MeterDrive2ReadsOff]
IfEqualValue=0

;[WRITE ACTIONS]===================================

[Drive1WritesAction]
Measure=Calc
Formula=MeasureDrive1Writes
IfAboveAction=!execute [!RainmeterHideMeter MeterDrive1WritesOff][!RainmeterShowMeter MeterDrive1WritesOn]
IfAboveValue=0
IfEqualAction=!execute [!RainmeterHideMeter MeterDrive1WritesOn][!RainmeterShowMeter MeterDrive1WritesOff]
IfEqualValue=0

[Drive2WritesAction]
Measure=Calc
Formula=MeasureDrive2Writes
IfAboveAction=!execute [!RainmeterHideMeter MeterDrive2WritesOff][!RainmeterShowMeter MeterDrive2WritesOn]
IfAboveValue=0
IfEqualAction=!execute [!RainmeterHideMeter MeterDrive2WritesOn][!RainmeterShowMeter MeterDrive2WritesOff]
IfEqualValue=0

;[DISPLAY Drive1]========================================

[MeterDrive1TotalRound]
Meter=ROUNDLINE
MeasureName=MeasureTotalDrive1
X=42
Y=34r
W=40
H=40
StartAngle=4.71238898
RotationAngle=6.28318531
LineLength=20
LineStart=15
LineColor=#LineColor2#
Solid=1
AntiAlias=1
Percentual=1
LeftMouseUpAction=!Execute ["Explorer.exe" "#Drive1#"]

[MeterDrive1UsedRound]
Meter=ROUNDLINE
MeasureName=MeasureUsedDrive1
X=42
Y=0r
W=40
H=40
StartAngle=4.71238898
RotationAngle=6.28318531
LineLength=17
LineStart=12
LineColor=#LineColor1#
Solid=1
AntiAlias=1
Percentual=1

[MeterFreeDrive1Text%]
MeasureName=MeasureFreeDrive1
Meter=STRING
X=52
Y=14r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=7
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
DynamicVariables=1
Text="%1%"
Percentual=1
AutoScale=1

[MeterTotalDrive1Text]
MeasureName=MeasureTotalDrive1
Meter=STRING
X=175
Y=-11r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=10
StringStyle=NORMAL
StringAlign=RIGHT
AntiAlias=1
Text="[#Drive1#] %1B"
AutoScale=1

;[Drive1 READ LIGHTS]====================================

[MeterDrive1ReadsOn]
Meter=IMAGE
W=8
H=8
X=80
Y=10R
ImageName=..\Images\GreenLight.png
Hidden=1

[MeterDrive1ReadsOff]
Meter=IMAGE
W=8
H=8
X=80
Y=0r
ImageName=..\Images\OffLight.png
Hidden=0

;[Drive1 WRITE LIGHTS]====================================

[MeterDrive1WritesOn]
Meter=IMAGE
W=8
H=8
X=89
Y=0r
ImageName=..\Images\RedLight.png
Hidden=1

[MeterDrive1WritesOff]
Meter=IMAGE
W=8
H=8
X=89
Y=0r
ImageName=..\Images\OffLight.png
Hidden=0

[MeterFreeDrive1Text]
MeasureName=MeasureFreeDrive1
Meter=STRING
X=175
Y=-7r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=11
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
Text="%1B"
AutoScale=1

;[DISPLAY Drive2]========================================

[MeterDrive2TotalRound]
Meter=ROUNDLINE
MeasureName=MeasureTotalDrive2
X=42
Y=25r
W=40
H=40
StartAngle=4.71238898
RotationAngle=6.28318531
LineLength=20
LineStart=15
LineColor=#LineColor2#
Solid=1
AntiAlias=1
Percentual=1
LeftMouseUpAction=!Execute ["Explorer.exe" "#Drive2#"]

[MeterDrive2UsedRound]
Meter=ROUNDLINE
MeasureName=MeasureUsedDrive2
X=42
Y=0r
W=40
H=40
StartAngle=4.71238898
RotationAngle=6.28318531
LineLength=17
LineStart=12
LineColor=#LineColor1#
Solid=1
AntiAlias=1
Percentual=1

[MeterFreeDrive2Text%]
MeasureName=MeasureFreeDrive2
Meter=STRING
X=52
Y=14r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=7
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
DynamicVariables=1
Text="%1%"
Percentual=1
AutoScale=1

[MeterTotalDrive2Text]
MeasureName=MeasureTotalDrive2
Meter=STRING
X=175
Y=-11r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=10
StringStyle=NORMAL
StringAlign=RIGHT
AntiAlias=1
Text="[#Drive2#] %1B"
AutoScale=1

;[Drive2 READ LIGHTS]====================================

[MeterDrive2ReadsOn]
Meter=IMAGE
W=8
H=8
X=80
Y=10R
ImageName=..\Images\GreenLight.png
Hidden=1

[MeterDrive2ReadsOff]
Meter=IMAGE
W=8
H=8
X=80
Y=0r
ImageName=..\Images\OffLight.png
Hidden=0

;[Drive2 WRITE LIGHTS]====================================

[MeterDrive2WritesOn]
Meter=IMAGE
W=8
H=8
X=89
Y=0r
ImageName=..\Images\RedLight.png
Hidden=1

[MeterDrive2WritesOff]
Meter=IMAGE
W=8
H=8
X=89
Y=0r
ImageName=..\Images\OffLight.png
Hidden=0

[MeterFreeDrive2Text]
MeasureName=MeasureFreeDrive2
Meter=STRING
X=175
Y=-7r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=11
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
Text="%1B"
AutoScale=1

;[GATHER USB DRIVES]================================

[MeasureTotalUSB1]
Measure=FreeDiskSpace
Drive=#USB1#
Total=1
IgnoreRemovable=0
UpdateDivider=2

[CalcUSB1Removed]
Measure=CALC
Formula=MeasureTotalUSB1
Substitute=" G":""," k":""," M":""," T":""
IfBelowValue=1
IfBelowAction=!Execute [!RainmeterHideMeter MeterFreeUSB1TextPercent][!RainmeterHideMeter MeterUSB1UsedRound][!RainmeterHideMeter MeterFreeUSB1Text][!RainmeterShowMeter MeterUSB1Key][!RainmeterShowMeter MeterRemovedUSB1Text]
IfAboveValue=0
IfAboveAction=!Execute [!RainmeterShowMeter MeterFreeUSB1TextPercent][!RainmeterShowMeter MeterUSB1UsedRound][!RainmeterHideMeter MeterRemovedUSB1Text][!RainmeterHideMeter MeterUSB1Key][!RainmeterShowMeter MeterFreeUSB1Text]

[MeasureFreeUSB1]
Measure=FreeDiskSpace
Drive=#USB1#
IgnoreRemovable=0
UpdateDivider=2

[MeasureUsedUSB1]
Measure=FreeDiskSpace
Drive=#USB1#
InvertMeasure=1
IgnoreRemovable=0
UpdateDivider=2

;[DISPLAY USB1]==================================

[MeterUSB1Key]
Meter=IMAGE
ImageName="..\Images\USBKey.png"
X=42
Y=24r
W=40
H=40
Hidden=1

[MeterUSB1TotalRound]
Meter=ROUNDLINE
MeasureName=MeasureTotalUSB1
X=42
Y=0r
W=40
H=40
StartAngle=4.71238898
RotationAngle=6.28318531
LineLength=20
LineStart=15
LineColor=#LineColor2#
Solid=1
AntiAlias=1
Percentual=1
LeftMouseUpAction=!Execute ["Explorer.exe" "#USB1#"]

[MeterUSB1UsedRound]
Meter=ROUNDLINE
MeasureName=MeasureUsedUSB1
X=42
Y=0r
W=40
H=40
StartAngle=4.71238898
RotationAngle=6.28318531
LineLength=17
LineStart=12
LineColor=#LineColor1#
Solid=1
AntiAlias=1
Percentual=1
Hidden=1

[MeterFreeUSB1TextPercent]
MeasureName=MeasureFreeUSB1
Meter=STRING
X=52
Y=14r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=7
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text="%1%"
Percentual=1
AutoScale=1
Hidden=1

[MeterTotalUSB1Text]
MeasureName=MeasureTotalUSB1
Meter=STRING
X=175
Y=-11r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=10
StringStyle=NORMAL
StringAlign=RIGHT
AntiAlias=1
Text="[#USB1#] %1B"
AutoScale=1

[MeterFreeUSB1Text]
MeasureName=MeasureFreeUSB1
Meter=STRING
X=175
Y=21r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=11
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
Text="%1B"
AutoScale=1

[MeterRemovedUSB1Text]
Meter=STRING
X=175
Y=0r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=10
StringStyle=NORMAL
StringAlign=RIGHT
AntiAlias=1
Text="Removed USB"
AutoScale=1
Hidden=1

;[GATHER NETWORK]=================================

[MeasureNetIn]
Measure=NetIn
UpdateDivider=2

[MeasureNetOut]
Measure=NetOut
UpdateDivider=2

;[NETWORK WEB IP]=================================

[MeasureIPWeb]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=http://www.geobytes.com/IpLocator.htm?GetLocation
RegExp="(?siU)name="ipaddress" size="15" value="(.*)">"
StringIndex=1
UpdateRate=30000

[MeterNetworkImage]
Meter=IMAGE
ImageName="..\Images\lantext.png"
X=42
Y=35r
W=40
H=40

[MeterWANIPText]
Meter=STRING
MeasureName=MeasureIPWeb
X=175
Y=-7r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=10
StringStyle=NORMAL
StringAlign=RIGHT
AntiAlias=1
Text=%1

;[NETWORK INBOUND TRAFFIC]========================

[MeterNetInPre]
Meter=STRING
X=110
Y=20r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=10
StringStyle=NORMAL
StringAlign=RIGHT
AntiAlias=1
Text="DN:"

[MeterNetInText]
MeasureName=MeasureNetIn
Meter=STRING
X=175
Y=0r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=10
StringStyle=NORMAL
StringAlign=RIGHT
AntiAlias=1
AutoScale=1
NumOfDecimals=1
Text="%1B"

;[NETWORK OUTBOUND TRAFFIC]=======================

[MeterNetOUTPre]
Meter=STRING
X=110
Y=15r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=10
StringStyle=NORMAL
StringAlign=RIGHT
AntiAlias=1
Text="UP:"

[MeterNetOutText]
MeasureName=MeasureNetOut
Meter=STRING
X=175
Y=0r
FontFace=#FontFace#
FontColor=#FontColor1#
FontSize=10
StringStyle=NORMAL
StringAlign=RIGHT
AntiAlias=1
AutoScale=1
NumOfDecimals=1
Text="%1B"

;[END CONFIG FILE]================================
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: Opinion of Easy-ness of Code Read-abiliy

Post by dragonmage »

I've got a series of button skins that are completely made of @Includes, just to see if I could.

Code: Select all

[Rainmeter]
X=0
Y=0
H=14
W=54

;Metadata added by RainBrowser
;http://rainmeter.net/RainWiki/index.php?title=Rainmeter_101#.5BMetadata.5D

[Metadata]
Name=
Config=
Description=
Instructions=
Version=
Tags=
License=
Variant=
Preview=

;End of added Metadata

[Variables]
@Include1="#SKINSPATH#Sputnik\Resources\Includes\Sputnik_Main.inc"
@Include2="#SKINSPATH#Sputnik\Resources\Includes\Apps.inc"
@Include3=#CURRENTPATH#Target.inc

@Include4=#SKINSPATH#Sputnik\LeftBar\SmallButtons\Label_Left.inc

@Include5=#SKINSPATH#Sputnik\LeftBar\SmallButtons\Sound.inc


Is that what you meant by overuse? ;)
User avatar
jsmorley
Developer
Posts: 22558
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Opinion of Easy-ness of Code Read-abiliy

Post by jsmorley »

I love it. Of course it makes the "Edit Skin" context menu / RainBrowser function useless, but hey...
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Opinion of Easy-ness of Code Read-abiliy

Post by JpsCrazy »

jsmorley wrote:1) DON'T organize a complicated skin with all the measures first and then all the meters. There are two reasons. First, you can get some weird lag since Rainmeter does things sequentially in the skin. So if a network measure is 1,000 lines away from the display meter for it the results can be strange. Second, I find it MUCH easier to read a skin that is "grouped" by function. network measures, network meters, hard drive measures, hard drive meters.

2) Use comments...

3) Use names for measures and meters that help the user understand what they are for.

4) Use, but don't overuse, @Includes and MeterStyles.

5) Use variable names that make sense.
I completely agree and follow these rules in all the skins I make. (Okay, I made one so far. That's besides the point.)
Organization is key.

1a - I have all the VARIABLES for the measure in the Variables.inc. All the actually Measures and Meters are Measure then Meter right below eachother. So I believe I'm still following that rule. 1b - Thank you, that was basically the root of my question.

2 - I use comments to section off everything, this was just a simple example.

3 - Names are used for ALL measures/meters except for the 10 types of measures I have in variables. But the variable that uses it can be seen on the same page, so there's no scrolling back and forth finding the correct one.

4 - Only 1 @include! It may be kinda long... but hey, it works.

5 - Why of course, again, this was just an example.

My finished(?) Variables.inc code: [Thanks to dragonmage who informed me variables can be used in [Variables] if placed before where it's used]

Code: Select all

[Variables]
;--Measures------------------------
	1=CPU
	2=FreeDiskSpace
	3=Memory
	4=NetIn
	5=NetOut
	6=NetTotal
	7=Perfmon
	8=PhysicalMemory
	9=Plugin
	10=SwapMemory

	Bar=#9#
	Heart1=#2#
	Heart2=#2#
	Heart3=#2#
	Heart4=#1#
	Heart5=#8#

	InvertMeasure_Bar=0
	InvertMeasure_Heart1=0
	InvertMeasure_Heart2=0
	InvertMeasure_Heart3=0
	InvertMeasure_Heart4=0
	InvertMeasure_Heart5=0

	UpdateDivider_Bar=1
	UpdateDivider_Heart1=30
	UpdateDivider_Heart2=30
	UpdateDivider_Heart3=30
	UpdateDivider_Heart5=1
	UpdateDivider_Heart4=1

;--Plugins-------------------------
	AdvancedCPU=Plugins\AdvancedCPU.dll
	PerfMon=Plugins\PerfMon.dll
	Power=Plugins\PowerPlugin.dll
	ResMon=Plugins\ResMon.dll

	Plugin_Bar=#Power#
	Plugin_Heart1=
	Plugin_Heart2=
	Plugin_Heart3=
	Plugin_Heart4=
	Plugin_Heart5=


;--Measure Options-----------------
;----CPU---------------------------
	Processor_Bar=
	Processor_Heart1=
	Processor_Heart2=
	Processor_Heart3=
	Processor_Heart4=
	Processor_Heart5=

;----Free Disk Space---------------
	Drive_Bar=H:\
	Drive_Heart1=C:\
	Drive_Heart2=D:\
	Drive_Heart3=E:\
	Drive_Heart4=F:\
	Drive_Heart5=G:\

	IgnoreRemovable_Bar=0
	IgnoreRemovable_Heart1=0
	IgnoreRemovable_Heart2=0
	IgnoreRemovable_Heart3=0
	IgnoreRemovable_Heart4=0
	IgnoreRemovable_Heart5=0	


;--Plugin Options------------------
;----AdvancedCPU-------------------
	CPUInclude_Bar=
	CPUInclude_Heart1=
	CPUInclude_Heart2=
	CPUInclude_Heart3=
	CPUInclude_Heart4=
	CPUInclude_Heart5=

	CPUExclude_Bar=
	CPUExclude_Heart1=
	CPUExclude_Heart2=
	CPUExclude_Heart3=
	CPUExclude_Heart4=
	CPUExclude_Heart5=

;----PerfMon-----------------------
	PerfMonObject_Bar=
	PerfMonObject_Heart1=
	PerfMonObject_Heart2=
	PerfMonObject_Heart3=
	PerfMonObject_Heart4=
	PerfMonObject_Heart5=

	PerfMonCounter_Bar=
	PerfMonCounter_Heart1=
	PerfMonCounter_Heart2=
	PerfMonCounter_Heart3=
	PerfMonCounter_Heart4=
	PerfMonCounter_Heart5=

	PerfMonInstance_Bar=
	PerfMonInstance_Heart1=
	PerfMonInstance_Heart2=
	PerfMonInstance_Heart3=
	PerfMonInstance_Heart4=
	PerfMonInstance_Heart5=

	PerfMonDifference_Bar=
	PerfMonDifference_Heart1=
	PerfMonDifference_Heart2=
	PerfMonDifference_Heart3=
	PerfMonDifference_Heart4=
	PerfMonDifference_Heart5=

;----ResMon------------------------
	ResCountType_Bar=
	ResCountType_Heart1=
	ResCountType_Heart2=
	ResCountType_Heart3=
	ResCountType_Heart4=
	ResCountType_Heart5=
	
	ProcessName_Bar=
	ProcessName_Heart1=
	ProcessName_Heart2=
	ProcessName_Heart3=
	ProcessName_Heart4=
	ProcessName_Heart5=


;--Colors--------------------------
	ColorBackground=000000
	ColorMagic=00C402
	ColorHeart=850F0F
My skin's code.

Code: Select all

[Rainmeter]
	Author=JpsCrazy
	Update=1000
	MiddleMouseDownAction=!RainmeterRefresh

;------------------------------------------------------

@include=#SkinsPath#\Zelda\Variables.inc

;------------------------------------------------------

[MeasureBar]
	Measure=#Bar#
	InvertMeasure=#InvertMeasure_Bar#
	UpdateDivider=#UpdateDivider_Bar#
	Processor=#Processor_Bar#
	Drive=#Drive_Bar#
	IgnoreRemovable=#IgnoreRemovable_Bar#
	PowerState=Percent
	Plugin=#Plugin_Bar#
	CPUInclude=#CPUInclude_Bar#
	CPUExclude=#CPUExclude_Bar#
	PerfMonObject=#PerfMonObject_Bar#
	PerfMonCounter=#PerfMonCounter_Bar#
	PerfMonInstance=#PerfMonInstance_Bar#
	PerfMonDifference=#PerfMonDifference_Bar#
	ResCountType=#ResCountType_Bar#
	ProcessName=#ProcessName_Bar#

[MeterBatBar]
	Meter=Bar
	MeasureName=MeasureBar
	X=4
	Y=25
	W=91
	H=14
	SolidColor=#ColorBackground#
	BarColor=#ColorMagic#
	BarOrientation=HORIZONTAL

;------------------------------------------------------

[MeasureHeart1]
	Measure=#Heart1#
	InvertMeasure=#InvertMeasure_Heart1#
	UpdateDivider=#UpdateDivider_Heart1#
	Processor=#Processor_Heart1#
	Drive=#Drive_Heart1#
	IgnoreRemovable=#IgnoreRemovable_Heart1#
	PowerState=Percent
	Plugin=#Plugin_Heart1#
	CPUInclude=#CPUInclude_Heart1#
	CPUExclude=#CPUExclude_Heart1#
	PerfMonObject=#PerfMonObject_Heart1#
	PerfMonCounter=#PerfMonCounter_Heart1#
	PerfMonInstance=#PerfMonInstance_Heart1#
	PerfMonDifference=#PerfMonDifference_Heart1#
	ResCountType=#ResCountType_Heart1#
	ProcessName=#ProcessName_Heart1#

[MeterHeart1]
	Meter=Bar
	MeasureName=MeasureHeart1
	X=6
	Y=3
	W=12
	H=10
	SolidColor=#ColorBackground#
	BarColor=#ColorHeart#
	BarOrientation=VERTICAL

;------------------------------------------------------

[MeasureHeart2]
	Measure=#Heart2#
	InvertMeasure=#InvertMeasure_Heart2#
	UpdateDivider=#UpdateDivider_Heart2#
	Processor=#Processor_Heart2#
	Drive=#Drive_Heart2#
	IgnoreRemovable=#IgnoreRemovable_Heart2#
	PowerState=Percent
	Plugin=#Plugin_Heart2#
	CPUInclude=#CPUInclude_Heart2#
	CPUExclude=#CPUExclude_Heart2#
	PerfMonObject=#PerfMonObject_Heart2#
	PerfMonCounter=#PerfMonCounter_Heart2#
	PerfMonInstance=#PerfMonInstance_Heart2#
	PerfMonDifference=#PerfMonDifference_Heart2#
	ResCountType=#ResCountType_Heart2#
	ProcessName=#ProcessName_Heart2#

[MeterHeart2]
	Meter=Bar
	MeasureName=MeasureHeart2
	X=25
	Y=3
	W=12
	H=10	
	SolidColor=#ColorBackground#
	BarColor=#ColorHeart#
	BarOrientation=VERTICAL

;------------------------------------------------------

[MeasureHeart3]
	Measure=#Heart3#
	InvertMeasure=#InvertMeasure_Heart3#
	UpdateDivider=#UpdateDivider_Heart3#
	Processor=#Processor_Heart3#
	Drive=#Drive_Heart3#
	IgnoreRemovable=#IgnoreRemovable_Heart3#
	PowerState=Percent
	Plugin=#Plugin_Heart3#
	CPUInclude=#CPUInclude_Heart3#
	CPUExclude=#CPUExclude_Heart3#
	PerfMonObject=#PerfMonObject_Heart3#
	PerfMonCounter=#PerfMonCounter_Heart3#
	PerfMonInstance=#PerfMonInstance_Heart3#
	PerfMonDifference=#PerfMonDifference_Heart3#
	ResCountType=#ResCountType_Heart3#
	ProcessName=#ProcessName_Heart3#

[MeterHeart3]
	Meter=Bar
	MeasureName=MeasureHeart3
	X=44
	Y=3
	W=12
	H=10
	SolidColor=#ColorBackground#
	BarColor=#ColorHeart#
	BarOrientation=VERTICAL

;------------------------------------------------------

[MeasureHeart4]
	Measure=#Heart4#
	InvertMeasure=#InvertMeasure_Heart4#
	UpdateDivider=#UpdateDivider_Heart4#
	Processor=#Processor_Heart4#
	Drive=#Drive_Heart4#
	IgnoreRemovable=#IgnoreRemovable_Heart4#
	PowerState=Percent
	Plugin=#Plugin_Heart4#
	CPUInclude=#CPUInclude_Heart4#
	CPUExclude=#CPUExclude_Heart4#
	PerfMonObject=#PerfMonObject_Heart4#
	PerfMonCounter=#PerfMonCounter_Heart4#
	PerfMonInstance=#PerfMonInstance_Heart4#
	PerfMonDifference=#PerfMonDifference_Heart4#
	ResCountType=#ResCountType_Heart4#
	ProcessName=#ProcessName_Heart4#

[MeterHeart4]
	Meter=Bar
	MeasureName=MeasureHeart4
	X=63
	Y=3
	W=12
	H=10
	SolidColor=#ColorBackground#
	BarColor=#ColorHeart#
	BarOrientation=VERTICAL

;------------------------------------------------------

[MeasureHeart5]
	Measure=#Heart5#
	InvertMeasure=#InvertMeasure_Heart5#
	UpdateDivider=#UpdateDivider_Heart5#
	Processor=#Processor_Heart5#
	Drive=#Drive_Heart5#
	IgnoreRemovable=#IgnoreRemovable_Heart5#
	PowerState=Percent
	Plugin=#Plugin_Heart5#
	CPUInclude=#CPUInclude_Heart5#
	CPUExclude=#CPUExclude_Heart5#
	PerfMonObject=#PerfMonObject_Heart5#
	PerfMonCounter=#PerfMonCounter_Heart5#
	PerfMonInstance=#PerfMonInstance_Heart5#
	PerfMonDifference=#PerfMonDifference_Heart5#
	ResCountType=#ResCountType_Heart5#
	ProcessName=#ProcessName_Heart5#

[MeterHeart5]
	Meter=Bar
	MeasureName=MeasureHeart5
	X=82
	Y=3
	W=12
	H=10
	SolidColor=#ColorBackground#
	BarColor=#ColorHeart#
	BarOrientation=VERTICAL

;------------------------------------------------------

[MeterImage]
	Meter=Image
	ImageName=ZeldaSmall.png
	AntiAlias=1
User avatar
jsmorley
Developer
Posts: 22558
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Opinion of Easy-ness of Code Read-abiliy

Post by jsmorley »

I do like the indentation. That's a good idea.
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Opinion of Easy-ness of Code Read-abiliy

Post by JpsCrazy »

Why thank you. :D
I tried to make at as inexperienced user friendly as possibly.
Any suggestions?
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Opinion of Easy-ness of Code Read-abiliy

Post by poiru »

Other than the indentation, I personally think these changes are going to negatively impact "Easy-ness of Code Read-abiliy". Just makes it a lot harder to follow the code.
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Opinion of Easy-ness of Code Read-abiliy

Post by JpsCrazy »

If you were JUST changing the Variables, would it be easy to change the measures to what you want?

The actual code for the config is never intended to be looked at by the user, just the variables.inc
In fact, added ;--EDIT THE MEASURES IN VARIABLES.inc------------------ above every measure's section.