A Bit Baffling

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: A Bit Baffling

Re: A Bit Baffling

Post by nnnik » 07 May 2018, 14:02

We decided to eliminate = for assignments.

Re: A Bit Baffling

Post by Era » 07 May 2018, 13:12

I understand your point. When I've learned more about v1, I'll study v2. Maybe have some suggestions. In the meantime, I do hope they decide to eliminate :=

Re: A Bit Baffling

Post by lexikos » 07 May 2018, 07:10

Era wrote:And if they do encapsulation, you can't even see the code to know what the h is going on!
...
Functions are not encapsulated, thus the code is visible, readable, modifiable.
The average AutoHotkey user relies on numerous functions without ever reading or modifying the code inside those functions. Some of those aren't even built-in, but functions posted on the forum. You don't need to "see the code to know what the h is going on" if the function or object holds to its contract.
Anyway, OOP mostly serves purposes unrelated to personal, individual coding. It's at base a clerical system, an effort at version control when people program in groups. Plus its theoretical abstractions appeal to academics and its complexity creates job protection via obscurantism.
Certain aspects of OOP (i.e. the ones that I've implemented) have clear value to me as an individual developer, so your argument falls flat from my perspective.

This isn't my job and I code alone 99% of the time, so I'll just accept what you (and others) say about benefits to group programming and "job protection". If OOP is for groups and academic types, let groups and academic types have it; everyone else may benefit from what they produce.

I'm not interested in theoretical arguments for or against OOP in general. I am more interested in feedback that has some direct real-world application, such as what changes in v2 make the program harder to use, or what changes could make it easier to use.

Re: A Bit Baffling

Post by Era » 06 May 2018, 16:19

You know best. To me, though, it does have to do with V2. Sorry I didn't respond to your query.

Re: A Bit Baffling

Post by lexikos » 06 May 2018, 16:02

I must hope that you become at some point aware that your blithe self-confidence can be hard for others to understand.
I don't think proof is possible because the dispute isn't fundamentally about programming; it's about religion. True believers in OOP will defend it endlessly.
Your posts are the same.

Since this has apparently nothing to do with AutoHotkey v2 Development, I have moved the topic to Offtopic.

Re: A Bit Baffling

Post by Era » 06 May 2018, 00:11

nnnik wrote:You prove your main argument that the over head of OOP exists.

You have not yet defeated the counter argument that the over head gives the programmer better abilities over the long run.
You're right, but I don't think proof is possible because the dispute isn't fundamentally about programming; it's about religion. True believers in OOP will defend it endlessly.

And I'm actually not saying that OOP is useless. As the first post mentions, OOP has its virtues in gang-programming.

Re: A Bit Baffling

Post by nnnik » 05 May 2018, 21:43

You prove your main argument that the over head of OOP exists.
You have not yet defeated the counter argument that the over head gives the programmer better abilities over the long run.

Re: A Bit Baffling

Post by Era » 05 May 2018, 16:20

In any sensible programming language, Hello World! would require only a single line of code, not ten.

So, by effectively proving my primary argument (although clearly you are quite unconscious of having done so), I must hope that you become at some point aware that your blithe self-confidence can be hard for others to understand.

Re: A Bit Baffling

Post by swagfag » 05 May 2018, 15:59

Era wrote:My dear Mr. ? SwagFag:
Functions can be provided with input/output descriptions via comments...so you don't need to tax your pretty head with reading the code within. I/O comments are quite like OOP in that way, without the messy code hiding and cascade. You can tell people what to put in , and what to expect out. Just like a laxative. Get it?
i mean, i can understand how the benefits of oop might elude the novice programmer, but once youve moved on from your basic 10 liner helloworld scripts onto actual projects, whether they be personal or not, youll realize what an immensely powerful tool oop truly is.

keep on truckin, mang. im sure ull get there someday ;)

Re: A Bit Baffling

Post by nnnik » 05 May 2018, 04:39

Do you believe in conspiracy theories?

1. Functions are encapsulation of code, the code is visible, readable, modifiable both for objects and for functions. They are black boxes until you can gain a white box perspective - that holds truth for anything.
Therefore functions using functions to do stuff have the same kind of issue as objects if you dont know the functions that are used yet. Same holds truth for Objects.

2. I am not an english native but towards me it didn't seem like "no brainer" was meant as an insult but rather to tell what he felt about it - it's an unfortunate misunderstanding we should all calm down

Re: A Bit Baffling

Post by Era » 05 May 2018, 04:03

nnnik wrote:
Era wrote:My dear Mr. ? SwagFag:
Functions can be provided with input/output descriptions via comments...so you don't need to tax your pretty head with reading the code within. I/O comments are quite like OOP in that way, without the messy code hiding and cascade. You can tell people what to put in , and what to expect out. Just like a laxative. Get it?
So it's okay if functions are black boxes but if classes are it isn't?

Also please stop that belittling tone with our helpers.
1. Functions are not encapsulated, thus the code is visible, readable, modifiable. So, they're not black boxes as are inherited objects hidden away somewhere up the chain of inheritance.

2. As for my tone, if you read my initial message you'll see that I was complementary and respectful. The tone became a bit dark as others got snide with comments like: "trite," "artificial," utter nonsense," "no brainer," "he was just trying to troll."

Anyway, OOP mostly serves purposes unrelated to personal, individual coding. It's at base a clerical system, an effort at version control when people program in groups. Plus its theoretical abstractions appeal to academics and its complexity creates job protection via obscurantism.

Re: A Bit Baffling

Post by nnnik » 05 May 2018, 01:49

Era wrote:My dear Mr. ? SwagFag:
Functions can be provided with input/output descriptions via comments...so you don't need to tax your pretty head with reading the code within. I/O comments are quite like OOP in that way, without the messy code hiding and cascade. You can tell people what to put in , and what to expect out. Just like a laxative. Get it?
So it's okay if functions are black boxes but if classes are it isn't?

Also please stop that belittling tone with our helpers.

Re: A Bit Baffling

Post by nnnik » 05 May 2018, 01:44

Era wrote:
nnnik wrote:Only very few things make sense as functions.
  1. Functions are for the parts in your script that you are never going to reuse as objects are meant for and superior for reuseability.
  2. Functions are for the parts of your script that access super globally, because if you don't need them everywhere encapsulating them in an object makes more sense.

Reuseability is a complete myth. How many times have you actually plugged a previous bit of code into new source code? Probably never. This is because context defines the massively unpredictable interactions between input and output. So the hoped-for black box reuse is a complete non-starter.

I've been hearing for three decades about how this and that will allow you to reuse code. Beyond any but the most simplistic, short, code snippet, reuse is more trouble than it's worth.

Crockery.
I have reused code before - many times actually. You can even make Functions reuseable but they are not that great at that. One example of reuseable functions is gdip.ahk

Re: A Bit Baffling

Post by gregster » 04 May 2018, 19:22

Often enough... I started to create classes when I noticed how often I re-used my code. And often enough I don't use classes. It depends on the use case. Simple as that.
But you still didn't answer lexikos:
lexikos wrote:Please give an example of a move toward OOP in v2 that you find baffling.
I am entertained easily, but like this, this attempt of a drama is getting trite quickly.

Re: A Bit Baffling

Post by Era » 04 May 2018, 18:33

How many times, gregster??

Re: A Bit Baffling

Post by gregster » 04 May 2018, 17:42

Reuseability is a complete myth. How many times have you actually plugged a previous bit of code into new source code? Probably never. This is because context defines the massively unpredictable interactions between input and output. So the hoped-for black box reuse is a complete non-starter.
You can dislike OOP and it is certainly not the only way to do something, but this is utter nonsense. You can speak for yourself, but it just sounds like you are not doing it right... or not much at all. This seems just like an artificial confrontation with a lot of commonplaces instead of facts.
But hey, you can always fork...

Re: A Bit Baffling

Post by Era » 04 May 2018, 16:55

swagfag wrote:just using it as an example, this was posted just a while ago: https://autohotkey.com/boards/viewtopic ... 18&t=48182

full disclosure, i hit expand, scrolled past 5 screenfuls of text and instantly my gut wrenched with aversion. i didnt even want to try and read, let alone comprehend the code

the dude is trying to click some buttons in a game, imagine how nice it wouldve been if you had a Button class, which had its coordinates, its corresponding image for imagesearching, its own randomize coordinates and click methods, and all this errorLevel checking fuckery tucked and handled neatly away from sight. U would then have the script read for each Button, do Button.click() and it would be immediately apparent what the script does, and if you needed to know what click() does specifically, you could peek into the class and its definition.

instead you have to go line by line(and no u cant assume and skip over) and cram all of that in your head at once to maybe get the big picture of whats going on with the program
My dear Mr. ? SwagFag:
Functions can be provided with input/output descriptions via comments...so you don't need to tax your pretty head with reading the code within. I/O comments are quite like OOP in that way, without the messy code hiding and cascade. You can tell people what to put in , and what to expect out. Just like a laxative. Get it?

Re: A Bit Baffling

Post by Era » 04 May 2018, 16:50

kczx3 wrote:I don’t think anyone got trolled here...

I didn't feel trolled, just misunderstood.

Re: A Bit Baffling

Post by Era » 04 May 2018, 16:48

nnnik wrote:Only very few things make sense as functions.
  1. Functions are for the parts in your script that you are never going to reuse as objects are meant for and superior for reuseability.
  2. Functions are for the parts of your script that access super globally, because if you don't need them everywhere encapsulating them in an object makes more sense.

Reuseability is a complete myth. How many times have you actually plugged a previous bit of code into new source code? Probably never. This is because context defines the massively unpredictable interactions between input and output. So the hoped-for black box reuse is a complete non-starter.

I've been hearing for three decades about how this and that will allow you to reuse code. Beyond any but the most simplistic, short, code snippet, reuse is more trouble than it's worth.

Crockery.

Re: A Bit Baffling

Post by Era » 04 May 2018, 16:44

jeeswg wrote:- If you're saying that anything done via object classes can be done just as well if not better with custom functions alone, I'm tempted to agree. Suggestions of any *well-argued* exceptions are welcome.
- I'd say that often people write both custom object classes and custom functions in an unnecessarily unclear way. I'd also say that object classes can be written in a way that is as readable as custom functions. However, in practice, I would say that people use object classes where functions would be sufficient or preferable, and that the classes will end up being more unreadable than the functions would have been.
- Personally, for anyone writing a class, I find that OTB instantly makes the class harder to follow, I would use Allman style.
- Since this is in the AHK v2 development forum, I suppose that you are saying that AHK is becoming 'too OOP'. Which bits are becoming 'too OOP' in your view, and what would you propose instead?
I totally agree. And if they do encapsulation, you can't even see the code to know what the h is going on! Inheritance, too, can be a nightmare of trying to figure out the chain of causation.... Leave your scripts readable and visible. Cascade is a stupid technique for scripting AHK...

Top