Mike Torrettinni
Members-
Content Count
1509 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Mike Torrettinni
-
Is it really that bad to Use boolean parameters to make your functions do two things?
Mike Torrettinni replied to Mike Torrettinni's topic in General Help
I guess this is the English counterpart: Chuck Norris doesn't read books, he just stares them down until they give him the information he needs. 😉 I think Mr. Triviality will show up now and send us all home for wasting his time. Perhaps he will tell us this twice! 🙂 -
See similar question with accepted answer, perhaps it can help you: https://stackoverflow.com/questions/65821505/delphi-clearing-ado-tables
-
Customizing source editor
Mike Torrettinni replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
Great, I think I will go to 10.5 when released, so will try then. -
Customizing source editor
Mike Torrettinni replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
I use 10.2, does newer version allow quick switching between themes, like a shortcut? -
Customizing source editor
Mike Torrettinni replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
Oh, ok. I thought you have all those different schemes set and use as needed. -
Customizing source editor
Mike Torrettinni replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
Do you switch between color schemas frequently? It would be nice if IDE has a shortcut for this. -
Is it really that bad to Use boolean parameters to make your functions do two things?
Mike Torrettinni replied to Mike Torrettinni's topic in General Help
Please read first post to see what the topic is about, I think it's got all the info. If something is not clear, let me know. -
Is it really that bad to Use boolean parameters to make your functions do two things?
Mike Torrettinni replied to Mike Torrettinni's topic in General Help
True, Perhaps it would be better something like ControlWindow.Enable() or ControlWindow(wnd, cwEnable) or ControlWindow(wnd, [cwEnable, cwActive]) with type TControlWindow = (cwEnable, cwDisable, cwActive, csFocused...); -
Is it really that bad to Use boolean parameters to make your functions do two things?
Mike Torrettinni replied to Mike Torrettinni's topic in General Help
I agree, although the point wasn't about the actual naming, but that boolean parameter does 2 opposite actions. The naming can be pretty much anything we want, I can use like EngedelyezoAblak() or AbilitaFinestra(), it would still be EnableWindow used to disable window. -
Is it really that bad to Use boolean parameters to make your functions do two things?
Mike Torrettinni replied to Mike Torrettinni's topic in General Help
Not really, or yes only when you read the documentation to know what false does. Same would be for DisableWindow(wnd, TRUE); EnableDisableWindow name can give you more sense of what the function does, compared to the fact that EnableWindow can disable window. Well in any case you need to read the documentation and then you know. I just wanted to point out that my original EnableDisableControls wasn't not such a bad name, after all 🙂 -
Is it really that bad to Use boolean parameters to make your functions do two things?
Mike Torrettinni replied to Mike Torrettinni's topic in General Help
Good example. The syntax shows that boolean parameter actually controls to enable or disable window. Perhaps it would be better named EnableDisableWindow 😉 https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enablewindow -
Customizing source editor
Mike Torrettinni replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
I tried this green for a little bit, but not really liking it too much. -
Update the Instances List when in Source Code Editor! - Please vote for quality report
Mike Torrettinni replied to PeterPanettone's topic in Delphi IDE and APIs
Just reading it you are referring to numerous views and it would be good to see the screenshot(s) with what changes and what doesn't change. Otherwise it's hard to imagine, unless replicating in my IDE and making sure I get same results. With screenshots I can decide right away, but to take time to properly test each ticket, it takes a lot more effort. -
Update the Instances List when in Source Code Editor! - Please vote for quality report
Mike Torrettinni replied to PeterPanettone's topic in Delphi IDE and APIs
Oh, if you have to ask, then I completely misunderstood the issue. Feel free to ignore my comment. -
Update the Instances List when in Source Code Editor! - Please vote for quality report
Mike Torrettinni replied to PeterPanettone's topic in Delphi IDE and APIs
The bug report would be so much clearer with screenshots of the issue you are describing. -
Customizing source editor
Mike Torrettinni replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
Wanna share a screenshot of your editor sample in grass green? -
Customizing source editor
Mike Torrettinni replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
I've been using red colored numbers this week and I really like it! They stand out enough but not distracting. 😉 -
Addendum to Martin Fowler quote
Mike Torrettinni replied to Stefan Glienke's topic in Tips / Blogs / Tutorials / Videos
Well, I can charge more for better user experience than the code I write, even if very efficient. But that's my experience and Stefan's suggestion could help. -
Addendum to Martin Fowler quote
Mike Torrettinni replied to Stefan Glienke's topic in Tips / Blogs / Tutorials / Videos
I like it! Could mean we can focus more on user experience and let compiler do its thing better than us. -
Is it really that bad to Use boolean parameters to make your functions do two things?
Mike Torrettinni replied to Mike Torrettinni's topic in General Help
It's OK, always good to know more developers using certain implementation. Just don't turn const -> enum or you might get a truly shocking jolt of electricity 😉 -
The Case of Delphi Const String Parameters
Mike Torrettinni posted a topic in RTL and Delphi Object Pascal
I just read this post on Marco Cantu's blog: https://blog.marcocantu.com/blog/2020-december-Delphi-const-string-params.html But I'm confused by his suggestions at the end: to not use const unless for performance case and that compiler will not change to detect such code. He even suggest the same for libraries. He does suggest how to change the code, but! he doesn't suggest to not write code like this at all. It's almost like he is saying if you do any kind of strange string usage, just don't use const and all is OK. Of course, if you need to change the parameter, don't use const. But that is not what he is implying. I looked into TField.GetValue but I don't see what he is referring to. Does anybody know of a case similar to what he is showing that is better off not using const versus changing the code? -
Is it really that bad to Use boolean parameters to make your functions do two things?
Mike Torrettinni replied to Mike Torrettinni's topic in General Help
Thanks, I already improved some naming and split some methods so the name and what they do are more aligned and exact. It's nice we have so many developers here and so many interesting implementations. -
Is it really that bad to Use boolean parameters to make your functions do two things?
Mike Torrettinni replied to Mike Torrettinni's topic in General Help
Why do you say so? You don't think it's a good idea? It would solve many many questions about using booleans; also it would be one common place where I can connect such methods. Will give it another thought, but it you have a suggestion please let me know. -
Is it really that bad to Use boolean parameters to make your functions do two things?
Mike Torrettinni replied to Mike Torrettinni's topic in General Help
Interesting. I've been thinking about creating a global enum type, like TBooleanValues = (bEnableCotrol, bDisableControl, bRecursive, bNonRescursive,...) and use them as boolean True/False. But this is still just an idea 😉 good to know somebody actually has implemented similar. -
Customizing source editor
Mike Torrettinni replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
I used to put dots, commas at the end or ALT+255 characters, but it's annoying to do that, so knowing that non-italic comments are possible is really nice.