frankenstein code POLL

the evil of a buggy script brought about by a freak of nature code, cue dramatic sound, Frankenstein tried programming.


Frankenstein coding has been one of my learning tricks for figuring out what some of the scripts the community has released. while i hate to be that guy i have even had attempts and successes in frankenstein-ing some scripts that have asked for commistion in order to be able to add the functionality with-out the need to pay as i am a broke, cheap, ba-- bum. i am simply looking to see what the general community opinion of such code bashing. note this is used not as laziness but as an attempt to learn programming beyond the free startup tuts as again i am a cheap bum.
As long as you arent taking credit for writing the code, you can take credit for making the edit though.


The only way I was able to learn ruby script was by watching videos and dissecting code.


But everyone learns differently, some people needs hands on, some people just need to take notes.
As long as I do not have to support the end result I don't mind the code getting messed up during a learning process.
I think it's maybe not the best place to learn, as you miss out on the very basics; things like different data types and why to (or not to) choose them.


I won't be answering your poll because my answer wouldn't be reflected - more like not okay, scope of what needs to be learned too large for frankencoding.
I've moved this thread to Learning Javascript. Please be sure to post your threads in the correct forum next time. Thank you.
It is definitely not the best place to learn XD


The flailings and frustations, the way it so easy breaks and rarely just works. Despite this actually seeing things move can be quite motivating. There is the danger of being stuck as a cargo cult programmer too.


Nevertheless those experience can be helpful when trying to learn basics at a later point.
Start with the basics. Go to codeacademy if you can't afford to take classes. Starting programming by copy and pasting other's code is a recipe for frustration and failure.
I learn how to code by myself only doing frakenstein code, and at some point i started to not need to do frankestein code, soo i think its okay, its a way to learn very effective and intuitive
EDIT:Well, this its possible doesn't apply to every people, i was always different on ways of learning, reverse engineering learning more than usual learning, but if someono its good whit that type of learning i think the frankstein code learning method can works
I too learnt all I know about coding mainly from "Frankenstein" coding. I would go through and make changes in sections of code and learn exactly how that changed things on screen or mechanically and after a while I didn't need to guess anymore as to how to draw scenes and windows properly. I still may not be a professional tier coder, but I can get anything I want accomplished without assistance now, and that was all that I really needed.


I have to agree that learning in this manner is acceptable... as I did try to do Code Academy as recommended above, but it was not helping me in any way. At least not in the way that taking the trial and error learning approach did for me.
LoL. Im betting I'm considered the premier Frankenstein coder around here!  While I do hack other's code to bits to learn, I don't really see how a novice could code here successfully otherwise.  A good number of the coders I consider excellent have given me the cold sholder when I ask for help developing "best practices" or simple how-tos.  So as far as this site goes, I find I'm largely on my own.  It's not so bad tho.  I did learn much on my own and try to help others here when I think I can.
I guess this can be somewhat helpful for some of those having at least an introductory experience on some languages to be familiar with a framework using those languages. For instance, RMXP, RMVX and RMVXA uses Ruby, while RMMV uses Javascript.


On the other hand, I'm quite skeptical on the effectiveness and efficiency on learning to write good code via Frankenstein coding.


About my experience:

Spoiler
At the time I begin to script in RMVXA, I rely on Frankenstein coding a bit heavily. Of course I won't pretend that those are my own works.


After I've watched DiamondPlatinum3's RGSS3 tutorials and written 5 rudimentary scripts, I immediately edited Yami's Classical Active Time Battle, by making a bug fix, followed by making a compatibility fix, and then adding some addons(eventually dozens of them). Of course all credits still belong to Yami, because I was just editing his/her stuffs.


But after I've edited several scripts that way, I've already dropped down the Frankenstein coding and begin to establish my own style.


Then, other than sometimes continuing to edit Yanfly and Yami's scripts(but it's not about Frankenstein coding anymore), most of my scripts are already my own stuffs, it's because I was already familiar enough with RMVXA to write easy, simple and small scripts that works without trivial bugs, even though the code qualities still suck like hell.


But after having 9 months of experience, I realized I was actually writing ridiculously bad codes even when they all works well on the user level. The strongest evidence on this is that my addons of Yami's CATB was so pporly written that I don't want to touch CATB anymore.


So instead I started to learn and practice established programming best practices and established scripting best practices, participate in Learning Ruby and RGSSx(and counterparts in some toher RMVXA forums), read stuffs written by godlike scripters like Tsukihime, and eventually share what I have in RGSS3 scripting.


I did that for another 7 months, resulting in Enhanced Classical Active Time Battle, which is an advanced complex script being much more powerful and having much high code quality than all those ugly CATB addons written by me.


On the other hand, I didn't use Frankenstein coding at all when I started to practice plugin development in RMMV.


It's because at that time, I already have nearly 2 years of experience with RMVXA, and I observed that RMMV is really similar to RMVXA.


It means that most of what I've in RMVXA are readily transferable to RMMV, so I don't think I've to use Frankenstein coding  anymore.



So mine tells me that, the below route might also work for some other scripters/plugin developers wishing to be writing good codes within a framework:


1. Have an introductory experience on all languages used by a framework to be familiar with


2. Use Frankenstein code to write several rudimentary scripts/plugins without taking any credit belonging to anyone else


3. Drop the Frankenstein code approach and write several easy, simple and small scripts that works without trivial bugs


4. Learn and practice established scripting/plugin development best practices by learning and practicing established general programming best practices, participating in scripting/plugin development forums, and absorbing wisdoms from scripters/plugin developers known to be producing high quality codes


5. Share what you've on scripting/plugin development to further consolidate what you've by taking useful feedback from your own and/or the others


Of course, I don't think this works for even most people, let alone everyone. But regardless of whether it works or not, my bottom line is never taking any credit for scripts/plugins that are direct edit of someone else's works.


In short, I think Frankenstein coding can work for some beginning scripters/plugin developers to be familiar with the frameworks they're working on, but the key is always knowing what Frankenstein coding really is and when to stop relying on Frankenstein coding and start focusing on learning and practicing established best practices.
I think it's great.  


First learn how to code, any way you can.


Then learn how to code better.


Background:


Right now, I'm working on a puzzle game in MV.  I have some experience writing very simple programs in Excel and SAS.  But nothing like a full fledged game.  I've never created Objects, or lots of Functions, or anything like that.


Now my game has a couple thousand lines.  It's not good code, but it works well enough, for now.  But even if it fails entirely-- I've learned a great deal: Logic and syntax that took me hours to find now only take me minutes.  


Also I can read other peoples code much, much better.  


Also-- the more I work, the more I sense what I'm doing wrong.


At times I've even sort of regretted trying to edit someone else's script.  All the hours spent picking it apart and putting it back together seem totally wasted, when I could have just written a better version myself.  


And then I remember: I can write a better version now, I couldn't have then.


That said-- I agree with learning at least the very basics from CodeAcademy.  Loops and arrays and variable declarations and so forth.


Frankenstein Scripts are more of a step between "I can sort of read this..." and "I can write without any help".
Personally I wouldn't go the copy and paste route; you'd lose out on learning the basics of putting your code in the system. 
Yes, you can get things working through copy, pasting, testing. But, you probably won't get a full understanding of how the code works.


This can lead to bad practices in the future, bad code organization, hard to read, you may not even understand it when you take a look at it in the future.


Learning the basics has much more value, because then you can take your time understanding the system, and build on top of existing code.


You'll have less bugs down the line, because you know how everything works, and you'll have a better idea of how to implement your ideas pragmatically -- something copy paste can't teach.
I would, at the most basic level, suggest avoiding copying and pasting solutions or code. If you really must use or re-purpose someone else's algorithm (this happens a lot in real life, where programmers and stack overflow are involved), at least type it in yourself so that you're getting everything. A copy and paste approach makes it really easy to miss out on implementation details. The most important thing to heed is, don't use anything you don't understand. Reasons for this should be pretty obvious (aside from libraries and API). If you don't know how it works, you should think twice about including it in your implementation. 


An alternate to 'frankensteining' for learning would be just to practice code reading. "loli-senpai, what is code reading?", you ask. Code reading is literally reading through someone else's program or script and learning or deciphering what they do. This, in fact, is a lot better than unassisted copying. Just like with a human language, you probably wouldn't copy part of someone's report or essay and try to rearrange it until you think you know how and why they wrote it. Reading literature, reports, and other forms of written language when working with human languages is crucial to learning how to write it yourself. This is why reading is important within all forms of education- not only are you picking up a means of collecting information, you're also encoding into yourself how to share information. If you were learning, say, Japanese, and never read or translated any Japanese texts, you might develop fluency in spoken Japanese, but any writing you would do would be vastly different than how Japanese is written; anything you wrote would be in the colloquial form of the language. Reading code is a great way to learn how certain functions/methods are used, and an even better way to pick up design patterns (a design pattern is a general reusable solution, like a factory method or a singleton).

Original thread: https://forums.rpgmakerweb.com/threads/frankenstein-code-poll.65021/