From Neville Herrmann (ACT) to Everyone 11:24 PM
Functions should have a single exit point
From Mark van der Eynden to Everyone 11:24 PM
We must be old
From Shane van de Vorstenbosch to Everyone 11:25 PM
@neville , it is an interesting trade off. But in this case it is about immediately bailing out and simplifying code.
From Andrew Tuck to Everyone 11:27 PM
Like a lot of programming guidelines, there is grey ie YMMV.
From Nicholas Ring to Everyone 11:29 PM
Re: Guard code. I know it under “early exit” and I have found that even new developers don’t like doing it.
I have been “taught” to do early exit to reduce the rainbow effect (for those that remember Castalia, you might have some idea what I am talking about here)
From Lachlan Gemmell to Everyone 11:29 PM
To be honest I’ve given up on the IDE refactoring features. If you’re writing code using the language as it was in the mid 2000s you’re fine, but if you start using language features that were introduced after refactoring, the IDE refactoring is more frustrating than helpful.
From Nicholas Ring to Everyone 11:30 PM
After using IntelliJ’s refactoring tools, I shudder when I think about using Delphi’s :’(
From Lachlan Gemmell to Everyone 11:36 PM
Also nested class declarations are another thing that just destroys the refactoring engine.
Old school local procedures work well in this situation too.
From Vincent Parrett to Everyone 11:37 PM
My general rule with comments is to comment on the why, not the what.
From Neville Herrmann (ACT) to Everyone 11:40 PM
That’s a good policy
From Lachlan Gemmell to Everyone 11:44 PM
Amen. Delete it all.
From Shane van de Vorstenbosch to Everyone 11:46 PM
Alister’s faster book has an awesome section on keyboard hotkeys.
From Nicholas Ring to Everyone 11:48 PM
MMX can do that with ctrl-alt-U
From Shane van de Vorstenbosch to Everyone 11:56 PM
Just use a with statement to get rid of the dm.
(Troll in every group)
From Vincent Parrett to Everyone 11:57 PM
From Mark Patterson to Everyone 12:17 AM
Do the methods in the interface show the form? If not, I think there will be a memory leak.
From David Duffy to Everyone 12:18 AM
I’ve found TMS FixInsight good for pointing out where things can be improved.
From Mathias Burbach to Everyone 12:20 AM
From Lex to Everyone 12:22 AM
Excellent talk. My refactoring so far has only been a fraction of what Alister described today.
From Shane van de Vorstenbosch to Everyone 12:25 AM
“Ditch with” !!!
From Vincent Parrett to Everyone 12:30 AM
Needs a section on automated builds
From Linden Roth to Everyone 12:32 AM
From Lachlan Gemmell to Everyone 12:32 AM
I’m less opposed to local procedures. Used in moderation they’re fine. You see them used in the VCL code a lot too.
From Linden Roth to Everyone 12:32 AM
small local methods are excellent
From Shaun Cunniffe to Everyone 12:34 AM
for inline methods. Tight scope
From Alister Christie to Everyone 01:06 AM
If you want to re-watch my talk at a later date, here is a previous recording.
From Vincent Parrett to Everyone 01:30 AM
TControl.ScaleValue makes things even easier
From David Marcus to Everyone 01:33 AM
Question: Should TForm.Scaled be set to true?
From Lex to Everyone 01:35 AM
Why not use SVG images rather than bitmaps?
From Vincent Parrett to Everyone 01:36 AM
Lex I’ll chime in about svg’s shortly
From Mark Patterson to Everyone 01:44 AM
Yes, the first thing I was thinking of was SVG, vector graphics.
From Vincent Parrett to Everyone 01:45 AM
they have similar issues to when you scale down large bitmaps… lines become too thin - so you need different svg’s for different sizes - they have to be drawn specifically for the small sizes
I wasted a huge amount of time on svgs before switching back to bitmaps
From Mark Patterson to Everyone 01:46 AM
Can you have SVGs that work over a range of sizes? So maybe 2 SVGs rather than a half dozen bitmaps?
From Vincent Parrett to Everyone 01:48 AM
yes, but you would need an imagecollection that supports that - the svgimagecollection on GitHub is designed to use single svg per image
From Mark Patterson to Everyone 01:49 AM
More work needs to be done
From Vincent Parrett to Everyone 01:49 AM
also when you are sourcing images, it’s hard to find collections where they are drawn that way
From Stephen Brennan to Everyone 01:55 AM
Have you dealt with issues in relation high level of TForm / TFrame class inheritance. i.e. The form or frame properties are loaded from resources consecutively which can cause rendering / scaling issues. Also there were some scaling bugs in Delphi .
From Shaun Cunniffe to Everyone 02:01 AM
How did you get your component pallet to display how it does? Mine is just a list!.
From Andrew Tuck to Everyone 02:01 AM
Do we mention Firemonkey? My app just seems to scale and look nice (no icons) at high dpi.
From Bruce Rogers Sydney to Everyone 02:04 AM
abducted by aliens is a similar risk
From Ray Konopka to Everyone 02:06 AM
Hi Shaun. Right-click on the component palette and select Properties. The Options dialog box will appear. Change the Button Size to Large. Uncheck the Show button captions check box. Uncheck the Auto collapse categories check box.
From Lachlan Gemmell to Everyone 02:08 AM
From David Duffy to Everyone 02:09 AM
What was the property for getting DPI to help with scaling?
From Ray Konopka to Everyone 02:10 AM
From David Duffy to Everyone 02:10 AM
From Ray Konopka to Everyone 02:10 AM
It is defined at the TControl level, so it is available in form event handlers, as well as custom component methods
From Vincent Parrett to Everyone 02:10 AM
You can avoid having to worry about that by using the ScaleValue method (wraps up the MulDiv call that Ray shows)
From Jared Davison (Medical Objects) to Everyone 10:47 AM
From Alister Christie to Everyone 10:48 AM
From Neville Herrmann to Everyone 10:51 AM
From Shane van de Vorstenbosch to Everyone 11:41 AM
Strewth. One tip!!!
From Steve Corbett to Everyone 12:07 PM
It’s good to create a test before re-factering your code.
From Mark Griffiths to Everyone 12:07 PM
New book title: Test faster in Delphi
From Lex to Everyone 12:12 PM
Pascal Analyzer isn’t free
From Nicholas Ring to Everyone 12:13 PM
Pascal Analyzer Lite is free but has restrictions
From Sue King to Everyone 12:32 PM
I think you can export the result and put in a text file for later reference?
From Stefan Glienke to Everyone 12:37 PM
Not via TestInsight - but that might be an idea worth considering
From Teijo Coltheart to Everyone 12:49 PM
Would be nice if there were more settings available via optsets. I was hoping to set Version Info this way for all modules, but it doesn’t seem to be supported.
From Vincent Parrett to Everyone 01:41 PM
latest version of spring.pas - Bitbucket
From Jared Davison (Medical Objects) to Everyone 01:48 PM
does the factory have much overhead. eg. if lots of classes are registerd?
(when creating lots of instances)
From Graeme Keast to Everyone 01:59 PM
From memory you indicated that there were methods to get element ‘Index’ of the array. Is there a method to get the count/size of the array?
From Alister Christie to Everyone 02:04 PM
Here is a link to my slides from my Refactoring presentation: ADUG 2022 - Refactoring - Google Slides
From Mark Di Val to Everyone 02:33 PM
Is there an installation guide?
From Alister Christie to Everyone 02:33 PM
git clone Bitbucket
From Alister Christie to Everyone 02:45 PM
If you want to learn about SOLID coding practices: Clean Coders : Level up your code.
From Sue King to Everyone 02:54 PM
Thanks, Stefan. A great talk and I learnt a lot.
From Guy to Everyone 02:54 PM
From Vincent Parrett to Everyone 02:55 PM
I’ve been using the 2.0 develop version of spring4d for quite some time, very stable and fast!
From Mathias Burbach to Everyone 02:55 PM
Great talk Stefan, even if cellars are not that common in Australia
From Alister Christie to Everyone 02:58 PM
Very much enjoyed your talk, thanks Stefan
From Vincent Parrett to Everyone 02:59 PM