Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Source Code Efficiency Minor Issue
Source Code Efficiency Minor Issue [message #58529] Wed, 08 June 2022 18:46 Go to previous message
aminhere is currently offline  aminhere
Messages: 3
Registered: June 2022
Location: Waterloo
Junior Member
Hello friends,

I recently discovered the U++ framework and I am having great success using it. I would like to sincerely thank the developers for all the hard work.

One recurring issue I have noticed while examining some code constructs like for example 'CodeEditor.cpp' is that all code does not make use of [else if] statements. For example, let us consider this piece of code from the previously mentioned cpp file:
-----------------------------------------------------
if(IsSelection() && auto_enclose) {
	if(code == '(') {
		Enclose("(", ")");
		return true;
	}
	if(code == '{') {
		Enclose("{", "}");
		return true;
	}
	if(code == '[') {
		Enclose("[", "]");
		return true;
	}
}

// MODERATOR: use code tag four source code.
-----------------------------------------------------
I am a novice programmer, and I am of the opinion that if we used [else if] statements for the 2nd and 3rd [if] cases, we would be able to save some processing power no matter how minute.
I understand that more experienced programmers like yourselves already know about this concept. That leads me to believe that this was done for some other reason. I would very much appreciate it if you would help me understand as to why this was done so that I am able to learn from you.

Thank you kindly,
Amin

[Updated on: Wed, 08 June 2022 20:56] by Moderator

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic: Know what you're using. Size of some common types.
Next Topic: U++ libraries and TheIDE converted to Meson build system
Goto Forum:
  


Current Time: Fri Mar 29 13:08:17 CET 2024

Total time taken to generate the page: 0.01571 seconds