balabuev 102 Posted January 21, 2021 2 minutes ago, Mike Torrettinni said: 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...); In some cases - yes. Imho, it's a kind of subjective things. Share this post Link to post
David Heffernan 2345 Posted January 21, 2021 1 hour ago, Mike Torrettinni said: 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 It's as if the thread above never happened!!!! 1 Share this post Link to post
Mike Torrettinni 198 Posted January 21, 2021 Just now, David Heffernan said: It's as if the thread above never happened!!!! 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. Share this post Link to post
Fr0sT.Brutal 900 Posted January 22, 2021 21 hours ago, balabuev said: ShowWindow(wnd, SW_HIDE); There is multiple SW_* variants so the example is irrelevant... 21 hours ago, balabuev said: EnableWindow(wnd, FALSE); Nice sample of bad naming, yes. Ideally it should be SetWindowEnabled IMHO Share this post Link to post
balabuev 102 Posted January 22, 2021 14 minutes ago, Fr0sT.Brutal said: There is multiple SW_* variants so the example is irrelevant... Just more generalized case of the same concept: Can ShowWindow be used to hide the window? Yes. Can EnableWindow be used to disable the window. Yes. 23 minutes ago, Fr0sT.Brutal said: Nice sample of bad naming, yes. This style of naming is a bias towards minimalism. And, imho, being used carefully - it's quite adequate. Share this post Link to post
Lars Fosdal 1791 Posted January 22, 2021 On 1/8/2021 at 2:27 PM, Lars Fosdal said: Two books that are gold for picking up good coding habits - even this long after they were written: Code Complete 2nd Edition by Steve McConnell Framework Design Guidelines by Krzysztof Cwalina & Brad Abrams (Third Edition) I have to repeat this comment. Among other things, these books give excellent advice on naming conventions. 1 Share this post Link to post
Guest Posted January 22, 2021 14 minutes ago, Lars Fosdal said: Among other things, these books give excellent advice on naming conventions. Чукча – не читатель, чукча – писатель ! I am sorry but couldn't help my self , hope this will draw a smile on Russian speaking readers, also i don't know how to translate it right with its context, so help is appreciated here. Share this post Link to post
Mike Torrettinni 198 Posted January 22, 2021 (edited) 1 hour ago, Kas Ob. said: Чукча – не читатель, чукча – писатель ! I am sorry but couldn't help my self , hope this will draw a smile on Russian speaking readers, also i don't know how to translate it right with its context, so help is appreciated here. 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! 🙂 Edited January 22, 2021 by Mike Torrettinni Share this post Link to post
Guest Posted January 22, 2021 18 minutes ago, Mike Torrettinni said: 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. 😉 It is more like this : I can write, so why i should read ?! Share this post Link to post
Mike Torrettinni 198 Posted January 22, 2021 2 minutes ago, Kas Ob. said: It is more like this : I can write, so why i should read ?! Oh, maybe this should be for Google Translate. Share this post Link to post
balabuev 102 Posted January 22, 2021 (edited) Since the main untranslatable word is already "translated" as Chuck Norris the rest is simple: Chuck Norris doesn't read books, instead Chuck Norris write books. Edited January 22, 2021 by balabuev 1 1 Share this post Link to post