Code center > Darwinbots3
Command Shortcutting
Numsgil:
--- Quote from: spike43884 on April 01, 2015, 11:39:17 AM ---Because you can't build your own if you don't know what it originally does.
--- End quote ---
I would think having multiple commands that do the same thing would make that worse. You'd have a hard time reading code because you'd constantly find commands that you weren't familiar with and have to look up what they do. "What's the difference between mul and superadd?" "Oh nothing, they both do the same thing." Then why have two commands at all?
spike43884:
--- Quote from: Numsgil on April 01, 2015, 12:30:43 PM ---
--- Quote from: spike43884 on April 01, 2015, 11:39:17 AM ---Because you can't build your own if you don't know what it originally does.
--- End quote ---
I would think having multiple commands that do the same thing would make that worse. You'd have a hard time reading code because you'd constantly find commands that you weren't familiar with and have to look up what they do. "What's the difference between mul and superadd?" "Oh nothing, they both do the same thing." Then why have two commands at all?
--- End quote ---
Reading code might be slightly more difficult, but no more difficult than if you didn't know the command in the first place, it only slightly slows down the reading of DNA, but incredibly speeds up the writing. Anyway, you could say that point and stick to it, but then DB2 added inline conditioning which is 10 times worse to someone who can't do it, then the professionals reverted to that. So primarily, balancing out the pro's and con's its a good thing really.
Numsgil:
--- Quote from: spike43884 on April 02, 2015, 01:25:02 PM ---Reading code might be slightly more difficult, but no more difficult than if you didn't know the command in the first place, it only slightly slows down the reading of DNA, but incredibly speeds up the writing.
--- End quote ---
Without any hint of irony I'm going to tell you that reading code is harder than writing code. And adding multiple commands that do literally exactly the same thing violates the principle of least surprise.
Again, if you want to rename all the commands, add your own, remove existing ones, etc. you can do all that with the tools in the current version of Sunweaver. But trying to make the language as broad as possible to make as many people as possible happy is a recipe for a design without a cohesive "vision".
spike43884:
--- Quote from: Numsgil on April 02, 2015, 07:45:57 PM ---
--- Quote from: spike43884 on April 02, 2015, 01:25:02 PM ---Reading code might be slightly more difficult, but no more difficult than if you didn't know the command in the first place, it only slightly slows down the reading of DNA, but incredibly speeds up the writing.
--- End quote ---
Without any hint of irony I'm going to tell you that reading code is harder than writing code. And adding multiple commands that do literally exactly the same thing violates the principle of least surprise.
Again, if you want to rename all the commands, add your own, remove existing ones, etc. you can do all that with the tools in the current version of Sunweaver. But trying to make the language as broad as possible to make as many people as possible happy is a recipe for a design without a cohesive "vision".
--- End quote ---
Heres a quote from far up the page on the principle of least suprise:
--- Quote ---A textbook formulation is "People are part of the system. The design should match the user's experience, expectations, and mental models." What is least surprising may however depend on the expected audience, e.g. end users, programmers or system administrators.
--- End quote ---
Of course as it mentions, what is least suprising may change depending on audience. Its a relatively simple rule, for example an athlete-grade training machine might have to utilise the entire athletes jargon, as an entry-grade one would have to avoid all the athletes jargon, to make it more functional and/or understandable. Of course theres the one solution, have it so its more flexible, being able to switch between jargon and non-jargon. Multiple words for the same thing.
My point dear sir, is now proven. One command does not fit all, thus multiple commands are needed. Now your constant point of reading, and especially reading being harder than writing is total nonsence. They see a command they don't know the exact term for, they can look it up seeing that superadd is the same as abs, and they now know it. But a command is much easier to understand presuming you can use a name thats memorable to its function for you specifically. The mind simply doesn't memorise an entire article word for word, but it can memorise the title which then reinforces the memory of meaning. Learning the alternative for an already known command is easy. Finally, reading certainly isn't harder than writing as even a general rule, let alone a 100% of the time rule. You see there are 3 main learning catagories/styles: Kinastetic (doing), Visual (seeing) and Audio (hearing). Reading is much harder for a kinastetic person to utilise to master, but writing the code helps them a lot more, a Visual person would benefit from reading the code, and watching the simulation, an audio person would do best from hearing someone explain it to them (audio can also extend to a digital conversation sometimes as to read you must speak what your reading in your head). Im Visual-Kinastetic & closely followed by Audio but I can promise you, reading the code is a lot easier in a lot of cases, except for when people do naughty programming and don't factor in 'allowances' or readable code (see here http://www.petesqbsite.com/sections/tutorials/tuts/writing_understandable_code.html). Its a bit like how normally programming languages have nested blocks and such. So its more organised, more readable. Now some of the structural features DB can't incorporate as it needs to be psuedo-natural atleast. But simple things like easier to understand names, makes it much easier. Its just another step on instead of having to do 10 .999 store being able to do 10 .example store
Numsgil:
This gets in to philosophy of programming territory. There are different schools of thought on the matter, but they're all wrong but one :)
I'm a big believer in DRY and once-and-only-once. That conviction comes from years of programming in projects that adhere to that and projects that don't. You aren't going to unconvince me of that. It's also a fairly common attitude among pretty much everyone I've ever met or worked with. eg: OpenGL is broken claims one of the "broken" things about OpenGL is that there's too many ways to do the same thing. It's one of the major things Python is reacting to in its design (see There's more than one way to do it). Here's a dev blog from foursquare where he says (emphasis not added mind you):
--- Quote ---On the flip side, we decided not to have deeply nested URLs, e.g. users/USER_ID/tips/TIP_ID, instead opting for flat tips/TIP_ID. This led to much simpler URLs. And having only one path for, say, the details about a tip, let us avoid making developers choose between multiple ways to do the same thing. As a bonus, this explicit, DRY approach to API design makes monitoring and debugging much easier.
--- End quote ---
If you're of the mindset that the entire community of programmers has everything wrong and are doing it wrong, you're going to find no sympathy from me; I'm one of them >:D
...
Even if I provided 17 different ways of doing everything, it might happen that everyone that isn't you programs their bots with the "standard" instructions. It's not going to help you reading their code. Maybe you need help reading/writing your own code? Maybe you're Brazilian and you want to program in Portuguese. You can do that with the object macros. Really the object macros are in many ways more powerful than what most proper programming languages outside of C/C++ offer. There's no similar functionality in C#. It was specifically left out to avoid the sort of Preprocessor hell that many developers don't like in C/C++. I added it for Sunweaver because it was the easiest way to allow users to provide their own custom commands and extend the language, not because I think it's a grand way of organizing code.
...
--- Quote ---Now some of the structural features DB can't incorporate as it needs to be psuedo-natural atleast.
--- End quote ---
Sure it can. You can do it in DB2 right now, eg:
--- Code: ---' In proximate range
10 *.eye5 >
1 .up store
' In point-blank range
50 *.eye5 >
-1 .shoot store
--- End code ---
Or in Sunweaver you can go one step further:
--- Code: ---{eat
-1 shoot store
}
{move
1 up store
}
10 *eye5 >
move call
50 *eye5 >
eat call
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version