4 ms·
HTML Version - 56 Characters, no dependencies: <ul><li>They</li><li>create</li><li>themselves</li></ul> OJJS Version - 57 Characters, thousands of lines of js
by justindocanto 13y ago
HTML Version - 56 Characters, no dependencies:
<ul><li>They</li><li>create</li><li>themselves</li></ul>
OJJS Version - 57 Characters, thousands of lines of js dependencies:
var myList = oj.BulletList('They','create','themselves');
The fact that just writing the html output is the same (and in this case less) amount of characters then the ojjs functions makes me unsure about this. especially considering all the extra dependencies.
- tokenizer 13y agoI would also argue that in terms of maintenance, it would be more time consuming for me to debug native html, css, and javascript, and then fix those bug in a completely different environment.
- justindocanto 13y agoAbsolutely. I agree. And there are lots of other points worth arguing too. My point in bringing up something like the difference in character count (not counting characters in the dependencies) is that just calling the function is already more work than basic html. That immediately is a NO for me. One could argue maintenance, incompatibilities, bloat, optimization, debugging, and so much more.
- pilgrim689 13y ago> My point in bringing up something like the difference in character count (not counting characters in the dependencies) is that just calling the function is already more work than basic html. To nitpick, to get your HTML, the OJ example could actually be: > BulletList('They','create','themselves') So no, it's not more work (41 characters).
- evanmoran 13y agoWhen you write oj.BulletList({collection:lotsOfData}) it will be much smaller I promise=).
- justindocanto 13y agoEven if i had an unordered list with 1,000 items (which why would I ever have that), it would still be less characters then the jquery dependency alone. That doesnt even include the ojjs source itself. I get what you're trying to do, because i did something similar with forms in PHP, but the dependencies and functions are too much... especially for production use. my advice is i would maybe focus on doing less things more efficiently. Or even better, offering a way like TW Bootstrap does, where you can choose your components and it spits out what you want. I wouldn't use 95% of the functionality of this code so having thousands of lines of code that i will never use is very unattractive for me when im thinking about optimization, debugging, etc. ADDITION: And i mean something that compiles your main ojjs js file, BEFORE the plugins. For example: I would never need any of the css functionality in this but it's included in the core. That's what i meant. I'm aware you have the ability to add 'plugins'. My idea of choosing parts was to choose parts within the current 'core' code. However, it looks like you are investing a lot of time into this and it's not a bad idea, so i applaud that. Just think it needs a little organizing/re-thinking in some aspects. Good luck :)
- evanmoran 13y agoGreat feedback, thank you! If you don't want a jQuery dependency then you probably don't want OJ =). As for the CSS support it is actually quite elegant. Maybe 100 lines with full support for '&:nested' selectors, and nestable '@media' query support. One thing that I've been considering is right now 40-50% of the oj.js filesize is support for the Form Elements (TextBox, ListBox, CheckBox,Button) and the "collection" elements (BulletList,NumberList,Table). I'm still considering pulling these out of the core and making them plugins. The issue is they manipulate the basic tags (input,textarea,table,ul,etc) so they seem pretty fundamental. Is that something you would want?
- sixdimensional 13y agoYou might look at Zepto.js for a "lightweight" jQuery if it still does what you need for OJ.