Ссылки о веб-разработке за сентябрь 2012

Pragmatic.js—A pragmatic style guide to JavaScript

JavaScript is a modern, flexible and malleable scripting language, and it deserves to be treated as such—to this extend, I’ve extracted the style guide Mislav and I wrote for Zepto in a new project called Pragmatic.js.

There are a lot of style guides out there, but they are all a long and tedious read and, in my opinion, often read like people are scared of using JavaScript and want to make it look more like C or Java. But it’s not. It’s a super awesome scripting language with lots of wonderful features (and arguably some quirks as well!).

Writing pragmatic JavaScript is all about optimizing the process of writing JavaScript for you as a programmer, using all the facilities the language provides.

Read more (and feel free to contribute!) at the Pragmatic.js GitHub repository.

Newly standardized Opus audio codec fills every role from online chat to music

Opus' quality is best in class across almost the entire bitrate range.

The IETF has standardized the Opus lossy audio codec as RFC 6716. While most audio codecs aim to solve specific problems—relatively high bit-rate music reproduction such as AAC and MP3, low latency voice reproduction such as Speex and the AMR family—Opus provides a "one size fits all" option which, according to its developers, provides best-in-class quality in almost all applications.

The codec was primarily developed by Mozilla and Xiph.org, with contributions from Skype/Microsoft and Broadcom. Opus weds Xiph.org's low-latency high bitrate music-oriented CELT algorithm to Skype's low bitrate speech-oriented SILK. The codec switches between algorithms depending on the bandwidth available, while boasting real-time latencies across the full bitrate/quality spectrum.

The Opus working group's own quality comparison suggests that, between about 12kbit/s and 128kbit/s at least, Opus boasts better quality than any other codec on the market. It loses out slightly at very low bitrates to the AMR-WB and AMR-NB codecs used by GSM telephones, but these codecs require the payment of royalties.

Enlarge / Opus spans the entire range from low bitrate narrow band (speech) to high bitrate wideband (music) with low latency across the board.

The CELT portions of the codec are covered by patents from Broadcom and Xiph.org; the SILK portions by patents from Skype/Microsoft and Huawei. However, all the patent holders have committed to making those patents royalty-free now that Opus is an IETF standard. The codec also includes an open source, BSD-licensed implementation.

This freedom from royalties is important for one of Opus' motivating usage scenarios. Opus is likely to be made a mandatory part of the WebRTC ("Web Real Time Communication") specification. WebRTC defines ways for browsers to access webcams and microphones to create audio and video streams suitable for building real-time voice and video calling apps that work without any plugins or extra software.

The group developing WebRTC is keen to avoid the fighting about codecs that surrounded HTML5's

The flexibility and quality of the codec means that it may see adoption even beyond this role; the low latencies make it attractive for streaming, but the high quality means that even latency insensitive applications, such as music storage, are a good fit for Opus.

простой протокол доступа к объектам

у SOAP довольно плохая репутация среди программистов. Однако можно было бы ожидать, что хотя бы в примитивных случаях он будет работать. Мне «повезло», что оба раза, когда я сталкивался с SOAP, он поворачивался ко мне крайними случаями.

пытаюсь сейчас использовать API Navteq, чтобы сообщать им о проблемах с данными. Одним инструментом сгенерировал из WSDL набор ява-классов (да, к сожалению, приходится делать на яве). Другим классным инструментом сравнительно просто допилил эти классы до состояния, когда можно-таки послать запрос. На всё ушло каких-то полдня. Застопорился я на том, что пароль к тестовому серверу не подходит, и пожаловался разработчикам API. Поскольку они сидят в Америке, ответ приходит на следующий день, если повезёт. Разработчики говорят: «мы тут всё меняем на серверах, используйте вот такой endpoint». Легко сказать, когда думаешь о доступе в терминах одного POST-запроса. А когда пытаешься использовать их технологию тем путём, что они сами рекомендуют, никто не даст тебе низкоуровневого доступа к адресу, который умные инструменты вынули из WSDL, скачанного с сервера. Напомнил про это разработчикам. А, говорят они, ну вот вам другой WSDL на другом тестовом сервере. «Так он же только из вашей сетки доступен!» — говорю. Молчат разработчики, думают.

К счастью, всё это пока что не так весело, как было в 2006 или 2007 году, когда МойКруг подключал AdSense, чтобы делиться доходами от рекламы с авторами постов. Казалось бы, AdSense — это Гугл, а Гугл — это крутые технари. Однако SOAP был и там. Причём опубликованный в WSDL интерфейс сервера не совпадал с реальным интерфейсом того же сервера. Чинить это Гугл отказывался, ибо это сломало бы доступ у ещё каких-то клиентов Гугла. В итоге пришлось забыть про красивые обещания SOAP, и собирать запросы вручную.

именно тогда мне попался на глаза один из лучших, на мой взгляд, образцов программистского юмора: «The S stands for Simple».

← предыдущий месяц