миллион раз поднимался этот вопрос, миллион раз на него отвечали. Ответ прост: если ты пишешь на фреймворке, то это совсем не значит, что ты хороший программист. Однако если ты НЕ пишешь на каком-либо фреймворке - то это говорит, что специалист плохой. Почему? Да потому что хорошие специалисты давно поняли, что изобретение велосипедов никому не нужно и понимают, что отлаженное тысячами будет работать лучше, чем отлаженное единицами. На больших системах вопрос минимализма решается другими способами - кешированием, сжатием и архивированием, а не спичечной оптимизацией, т.к. время разработки стоит дороже железа.
igordata Gromo ладно ув. "эксперты", мне больше нет смысла с вами спорить, тоже что и с деревом, вернее с двумя, один визитки делает, у второго свой фрэймворк и кмс одновременно
Михаил Я визитки не делаю. Что-то мне подсказывает, что громо тоже. А дерево - ты. Тебе разные люди сказали, что неоходимость фреймворков вытекает не из умения а из стандартизации и доверия.
и этим я вполне могу похвалиться, т.к. это полностью моя разработка с самого начала. голословное утверждение. то же самое могу сказать и про тебя и, скорее всего, буду больше прав.
тогда не нужно это выдавать парням новым за хороший стиль и давать как пример. нет нет не будешь, вы господа не можете разарбатывать на джс, максимум, что вам доверят это простую анимацию - "чтобы двигалось и красиво было". а про кофескрипт вы пожалуй и не слышали.
как пример - небольшая объектная обёртка над картами гугл без использования фреймворков [js]/* * Map Locator * @author Gromo * @version 0.0.3 * http://maps.google.co.uk/maps/api/js?se ... s=geometry */ (function(_global){ /** * @namespace MapLocator * @name MapLocator * @param {object} initial google map options - center, Zoom, mapTypeId, etc... */ MapLocator = function(options) { /** * Owerwrite this function if you need third-party search mechanism * @public * @param {google.maps.LatLng} object of first location, found by address * @param {int} distance in meters */ this.onSearchSuccess = function(latlng, distance){ // set marker this.marker.setIcon('http://maps.google.com/mapfiles/ms/icons/blue-pushpin.png'); this.marker.setPosition(latlng); this.marker.setMap(this.map); // load locations via ajax function // assign locations using setLocations // display locations using showOnMap this.showOnMap(latlng, distance); }; /** * Overwrite this function if you want to do something on search error * @public * @param {string} search status on error */ this.onSearchError = function(status){ console.log("Map Locator search response : " + status); }; /** * Overwrite this function if you want to change behaviour when marker is clicked * @public * @param {object} location object * @return {string} baloon text or false if baloon shouldn't be displayed */ this.onMarkerClick = function(location){ this.showInfo(location); }; /** * Overwrite this function if you want to change content of location baloon * @public * @param {object} location object * @return {string} baloon text or false if baloon shouldn't be displayed */ this.getLocationInfo = function(location){ return '<div>' + location.title + '</div>'; }; /** * Define this function if you want to change behaviour on map click * @public * @param {google.maps.LatLng} location * @param {string} full address of found location */ /* this.onMapClick = function(latlng, address){ // set marker this.marker.setIcon('http://maps.google.com/mapfiles/ms/icons/blue-pushpin.png'); this.marker.setPosition(latlng); this.marker.setMap(this.map); this.marker.showInfo(address); // replace address with found one jQuery('#address').val(address); }; */ this.locations = []; this.options = { "center": new google.maps.LatLng(0, 0), "mapTypeId": google.maps.MapTypeId.ROADMAP, "zoom": 16 }; if(typeof options === 'object'){ for(var key in options){ this.options[key] = options[key]; } } }; MapLocator.prototype = { /** * @public * @param {string} google map container id * @param {array} locations [{id: 1, lat: 40.7152, lng: -74.0111, title: "Kaffe 1668"}] */ init : function(mapId, locations) { this.map = new google.maps.Map(document.getElementById(mapId), this.options); this.geocoder = new google.maps.Geocoder(); this.circle = new google.maps.Circle({fillOpacity:0,strokeOpacity:0,map:this.map}); this.marker = new google.maps.Marker(); this.infoWindow = new google.maps.InfoWindow(); this.marker._sl = this; this.marker.showInfo = function(content){ this._sl.infoWindow.setContent(content); this._sl.infoWindow.open(this.getMap(), this); }; if(typeof locations !== 'undefined'){ this.setLocations(locations); this.fitAllLocations(); } if(typeof this.onMapClick !== 'undefined') google.maps.event.addListener(this.map, 'click', this.proxy(this, 'clickMap')); }, /** * @public * @param {string} search address * @param {int} distance in meters */ search : function(address, distance){ if(typeof distance == 'undefined') distance = 0; this.geocoder.geocode({ "address": address }, this.proxy(this, 'geocode', {"distance":distance})); }, /** * @public * @param {array} locations [{id: 1, lat: 40.7152, lng: -74.0111, title: "Kaffe 1668"}] */ setLocations : function(locations){ for(var i=0; i<this.locations.length; i++) this.locations.marker.setMap(null); for(var i=0; i<locations.length; i++){ var location = locations; var latlng = new google.maps.LatLng(location.lat, location.lng); var marker = new google.maps.Marker({position: latlng, map: this.map}); location.latlng = latlng; location.marker = marker; location._sl = this; location.showInfo = function(){ this._sl.showInfo(this); }; google.maps.event.addListener(marker, 'click', this.proxy(location, 'showInfo')); } this.locations = locations; }, /** * @public * @param {int} location id */ selectLocationById : function(id){ var location = this.getLocationById(id); if(location){ location.marker.setMap(this.map); this.map.setCenter(location.latlng); location.showInfo(); } }, /** * @public * @param {int} location id * @return {object} location of null if not present */ getLocationById : function(id){ var locations = this.locations; for(var i=0; i<locations.length; i++) if(locations.id == id) return locations; return null; }, /** * @public * @param {google.maps.LatLng} map center * @param {int} radius in meters */ showOnMap : function(center, distance){ this.circle.setCenter(center); this.circle.setRadius(parseInt(distance)); this.map.fitBounds(this.circle.getBounds()); var locations = this.filterLocations(center, distance); for(var i=0; i<locations.length; i++) locations.marker.setMap(this.map); }, /** * displays all locations on the map * @public * @param {array} array of locations. if empty - local locations will be used */ fitAllLocations : function(locations) { locations = locations ? locations : this.locations.slice(); var bounds = new google.maps.LatLngBounds(); if(this.marker.getMap()){ locations.push({'latlng': this.marker.getPosition() }); } if(!locations.length) return; if(locations.length > 1){ for(var i=0; i<locations.length; i++){ var latlng = locations.latlng ? locations.latlng : new google.maps.LatLng(locations.lat, locations.lng); bounds.extend(latlng); } this.map.setCenter(bounds.getCenter()); this.map.fitBounds(bounds); } else { var latlng = locations[0].latlng ? locations[0].latlng : new google.maps.LatLng(locations[0].lat, locations[0].lng); this.map.setCenter(latlng); } }, /** * @private * @param {object} Geocoder search result * @param {string} Geocoder search status */ geocode : function(results, status){ if (status == google.maps.GeocoderStatus.OK) { this.onSearchSuccess(results[0].geometry.location, this.geocode.distance); } else { this.onSearchError(status); } }, /** * @private * @param {object} Location object * this - location, this._sl - MapLocator object */ showInfo : function(location) { this.infoWindow.setContent(this.getLocationInfo(location)); this.infoWindow.open(this.map, location.marker); }, /** * @private * @param {object} */ clickMap : function(e) { this.geocoder.geocode({ "latLng": e.latLng }, this.proxy(this, 'onMapClickProxy')); }, /** * @private * @param {object} results * @param {string} status */ onMapClickProxy : function(response, status) { if (status == google.maps.GeocoderStatus.OK) { this.onMapClick(response[0].geometry.location, response[0].formatted_address); } }, /** * @private * @param {google.maps.LatLng} circle center * @param {float} radius in meters * @retun {array} list of locations */ filterLocations : function(center, radius){ var locations = []; for(var i=0; i<this.locations.length; i++){ var location = this.locations; location.marker.setMap(null); var distance = google.maps.geometry.spherical .computeDistanceBetween(center, location.latlng); if(distance < radius){ locations.push(location); } } return locations; }, /** * Proxy to call function in context of object (jQuery.proxy analog) * @private * @param {object} context of the function * @param {string} function name */ proxy : function(fn, proxy, attr){ proxy = fn[proxy]; if(typeof attr === 'object') for(var key in attr) proxy[key] = attr[key]; return function(){ return proxy.apply(fn, arguments); }; } } })(window || this);[/js] загружать транслятор другого языка для javascript ? имхо, глупость, т.к.: 1. другие работать с этим не будут 2. затрудняется отладка в дебагере 3. сомневаюсь, что в трансляторе есть поддержка контекста запуска функций (this - это особенность именно языка js), так что по-любому придётся писать нативный js 4. сомневаюсь, что есть поддержка callback функций (т.к. это тоже особенность языка js - код может выполняется параллельно, а не последовательно как в других языках) и, чтобы не быть голословным, ув. тов. профи в джс, приведи и свой пример кода.
отпишусь и по теме, а то как-то неприлично просто так письками мериться не учитывая вопрос ТС самый дельный совет по факту если не ошибаюсь, то mootools очень схож с prototype, a prototype - это фреймворк, который сделал очень большую ошибку пытаясь расширить функционал встроенных DOM объектов в js - http://perfectionkills.com/whats-wrong- ... g-the-dom/ и хотя над prototype постоянно работают, будет не очень приятно узнать, что твой сайт не работает в какой-то новой версии браузера без обновления фреймворка, или что внешняя js функция не работает из-за конфликта с теми изменениями, который сделал фреймворк. По этим показателям jQuery имеет преимущество, т.к. он является более мобильным, не затрагивая при этом функционал текущих объектов. stos я бы советовал писать страницы с обязательным использованием doctype и стандартов html, что гарантирует (по возможности) одинаковую интерпретацию во всех браузерах - правила написания хтмл тегов, атрибутов, закрытия тегов и т.д...
Без аргументов тут только ты. Все что ты сказал это "нет", "это не правильно" и "вы все говно". И этого стиля ты продолжаешь придерживаться. Ну и хер с тобой. С Новым Годом.