Code center > Darwinbots3
Command Shortcutting
Peter:
You might like ruby
As far I know it's the only language that got several method synonyms.* It's a easy language to learn, easy to write. May (generally) be harder to read other people's code.
*Perl got some of them too, but I think that's more because of legacy.
spike43884:
--- Quote from: Numsgil on April 03, 2015, 01:26:57 PM ---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 ---
--- End quote ---
1stly - Not all of the programming community thinks exactly like you numsigl. In every single aspect, nor do they all think like me. Don't believe your using the method 99% of people approve of, theres many methods people believe are right. We could go even deeper, why not just use binary. Its beautifally simple, and quick to run but instead we made, hundreds, upon hundreds of languages to program in, which do the same thing, translate it into binary. Why? because we think differently! YES, WE THINK DIFFERENTLY! I know it might be some sort of marvellous revelation to you, but if your still thinking about how it should certainly follow "99.999% of the programming community" with using DRY & OAOO then make every bit of DB3 in binary, without using any other language.
You see, Im a person who solidly hates Lua. Its just not really very simple or understandable to me, but I adore HTML and enjoy Python. Because people write things differently. Plus you'll most likely encounter the chance that one person may use multiple of the names for one command for when their doing a different task, like they might use a lot of rotation then .up in a pondmode bot, because your litterally going up, against the simulations gravity...but might use .forward in a non-pondmode sim, because your going forward and not against gravity.
Also, to your point alternative commands make it harder to read...Would you rather read 1000 lines of JAVA, or 1000 lines of SUNWEAVER or would you prefer to read 100000 lines of BINARY, because currently your suggesting you'd rather read the 100000 lines of BINARY.
Now I admit, and im happy to admit that theirs a chance I'll be the only one to EVER use the alternative commands, but that chance is tiny, absolutely tiny. And before you say that im talking balony, how many people do you know that write every part of all of the programming projects they ever do in binary, or even in the same language for every single part of every single project they've ever, and will ever do. That chance that all of them only program in binary my dear friend is tiny.
Finally to my statement that not all of the organisation things can/are implemented in DB2/DB3 is quite clear because we can't make an external file which is referenced to store X part of data, a bit like how you have a seperate CSS in HTML.
P.S. Responce to Peter talking about ruby: I might try out ruby some time then, i've heard of it but never used it or read its code...What is it used to program normally?
spike43884:
Heres a simpler way to put it, if you want to do DRY then without using any sort of translator or tool to translate/interpret it for you tell me what this says in english:
01001101 01111001 00100000 01100100 01100101 01100001 01110010 00100000 01100110 01110010 01101001 01100101 01101110 01100100 00101100 00100000 01111001 01101111 01110101 01110010 00100000 01110000 01101000 01101001 01101100 01101111 01110011 01101111 01110000 01101000 01111001 00100000 01101001 01110011 00100000 01110100 01100101 01110010 01110010 01101001 01100010 01101100 01100101 00100000 01110111 01110010 01101111 01101110 01100111 00101110 00100000 01001110 01101111 01110111 00100000 01110011 01110100 01101111 01110000 00100000 01100010 01100101 01101001 01101110 01100111 00100000 01110011 01110100 01110101 01100010 01100010 01101111 01110010 01101110 00100000 01100001 01101110 01100100 00100000 01110011 01110101 01110010 01110010 01100101 01101110 01100100 01100101 01110010 00100000 01110100 01101111 00100000 01110100 01101000 01100101 00100000 01100101 01110110 01101001 01100100 01100101 01101110 01100011 01100101 00100000 01110000 01110010 01100101 01110011 01100101 01101110 01110100 01100101 01100100 00100000 01100010 01100101 01100110 01101111 01110010 01100101 00100000 01111001 01101111 01110101 00101110
Panda:
--- Quote from: spike43884 on April 04, 2015, 08:14:15 AM ---Heres a simpler way to put it, if you want to do DRY then without using any sort of translator or tool to translate/interpret it for you tell me what this says in english:
01001101 01111001 00100000 01100100 01100101 01100001 01110010 00100000 01100110 01110010 01101001 01100101 01101110 01100100 00101100 00100000 01111001 01101111 01110101 01110010 00100000 01110000 01101000 01101001 01101100 01101111 01110011 01101111 01110000 01101000 01111001 00100000 01101001 01110011 00100000 01110100 01100101 01110010 01110010 01101001 01100010 01101100 01100101 00100000 01110111 01110010 01101111 01101110 01100111 00101110 00100000 01001110 01101111 01110111 00100000 01110011 01110100 01101111 01110000 00100000 01100010 01100101 01101001 01101110 01100111 00100000 01110011 01110100 01110101 01100010 01100010 01101111 01110010 01101110 00100000 01100001 01101110 01100100 00100000 01110011 01110101 01110010 01110010 01100101 01101110 01100100 01100101 01110010 00100000 01110100 01101111 00100000 01110100 01101000 01100101 00100000 01100101 01110110 01101001 01100100 01100101 01101110 01100011 01100101 00100000 01110000 01110010 01100101 01110011 01100101 01101110 01110100 01100101 01100100 00100000 01100010 01100101 01100110 01101111 01110010 01100101 00100000 01111001 01101111 01110101 00101110
--- End quote ---
I'm pretty sure for DRY, you would be expected to use a sort of translator/tool for that to say something in English (but nobody would write it like that in the first place using DRY) - there is reason for software and libraries having documentation, partly for everybody to agree on a standard. I agree with Numsgil here, a single standard would be better than, probably, obfuscating code (if everybody would just write things in different ways).
In any case, it would not take that long for you to learn the new commands, even if you do make mistakes on the way. Hopefully, the IDE will help you will them.
Peter:
I don't get the issue, you can add synonyms yourself. You're better at picking the synonyms you like than Numsgil would be.
Philosophy of python is to have one obvious way to code it, isn't that the opposite of what you want. They stripped quite some functions in python 3, just because they wanted to limit the possibilities to program the same task.
I know they use Ruby(on rails) for websites, might be more. I really haven't done a lot with it.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version