-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrss.xml
More file actions
33 lines (32 loc) · 6.42 KB
/
rss.xml
File metadata and controls
33 lines (32 loc) · 6.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[daewon's log]]></title><description><![CDATA[about programming language]]></description><link>http://daewon.github.io</link><image><url>http://daewon.github.io/public/img/favorite.png</url><title>daewon's log</title><link>http://daewon.github.io</link></image><generator>NodeJS RSS Module</generator><lastBuildDate>Mon, 22 Jul 2013 02:11:06 GMT</lastBuildDate><atom:link href="http://daewon.github.io/rss.xml" rel="self" type="application/rss+xml"/><item><title><![CDATA[The reason Scala has a bottom type]]></title><description><![CDATA[<img src="http://www.gravatar.com/avatar/201e7a836b57569bf241ddd73d90c3bf?r=pg&s=48.jpg&d=identicon"><br/><h3 id="toc_24">Why <code>throw</code> has a type: <code>Nothing</code> in Scala</h3>
<h4 id="toc_25">Scala에서 <code>throw</code> 는 왜 타입이 필요할까? 아래 예문을 살펴보자.</h4>
<pre><code class="scala"><span class="function"><span class="keyword">def</span> <span class="title">error</span><span class="params">(message: String)</span>:</span> Nothing = throw new RuntimeException(message)
<span class="function"><span class="keyword">def</span> <span class="title">divide</span><span class="params">(x: Int, y: Int)</span>:</span> Int = {
<span class="keyword">if</span> (y != <span class="number">0</span>) x / y
<span class="keyword">else</span> error(<span class="string">"can't divide by zero"</span>)
}
</code></pre><p>몇가지 특이한 점을 발견할 수 있다.</p>
<ol>
<li>divid 함수의 반환 타입은 <code>Int</code>이다. 그런데 divid 함수의 본문은 <code>if/else</code> 뿐이며 <code>if</code>와 <code>else</code>의 반환 타입이 다르다.</li>
<li>error 함수의 반환 타입은 <code>Nothing</code>이다. 그런데 error함수의 본문은 <code>throw</code> 뿐이다. <code>throw</code>가 되면 실행이 중지될 텐데 타입이 왜 필요할까?</li>
</ol>
]]></description><link>http://daewon.github.io/post/the-reason-scala-has-a-bottom-type</link><guid isPermaLink="false">the-reason-scala-has-a-bottom-type</guid><dc:creator><![CDATA[<a href="blueiur" target="_blank">daewon</a>]]></dc:creator><pubDate>Mon, 22 Jul 2013 17:00:00 GMT</pubDate></item><item><title><![CDATA[No more loops with Scala]]></title><description><![CDATA[<img src="http://www.gravatar.com/avatar/201e7a836b57569bf241ddd73d90c3bf?r=pg&s=48.jpg&d=identicon"><br/><h3 id="toc_18">자바에서는 일반적으로 loop를 기반으로 컬렉션을 다룬다.</h3>
<p><a href="http://daewon.github.com/post/next-generation-java-programming-style/">차세대 자바 프로그래밍 스타일</a>
에서도 살펴본 것과 같이 loop가 컬렉션을 다루는 가장 좋은 방법은 아니다. loop는 코드의 가독성을 빠르게 망가뜨린다.
함수가 1급 객체인 언어들에서는 이러한 loop를 명시적으로 노출시키지 않고 <strong>고차 함수</strong> 로 추상화 시킨다.
이런 추상화 덕분에 컬렉션을 다루는 방법이 매우 간결하고 직관적이다.</p><p>자바에서도 함수형 스타일로 컬렉션을 다루고자 한 시도로 <a href="http://code.google.com/p/lambdaj/">lambdaj</a> 프로젝트가 있다. </p><p>lambdaj가 만들어진 이유는 다음과 같다</p>
<blockquote>
<p>복잡한 데이터 모델을 다루는 프로젝트에서 비즈니스 로직의 상당 부분은
어떤 작업을 위해서 비지니스 객체의 컬렉션을 순회하는 일의 반복이다.
loop는 조건이 추가되거나 중첩되기 시작하면 코드를 작성하는것 보다 읽기가 더 어려워진다.
그렇기 때문에 비지니스 로직이 조금 더 기술적인 부분과 분리되어 작성되기를 원한다.</p></blockquote>
]]></description><link>http://daewon.github.io/post/from-java-to-scala-scala-collections-hwalyong</link><guid isPermaLink="false">from-java-to-scala-scala-collections-hwalyong</guid><dc:creator><![CDATA[<a href="blueiur" target="_blank">daewon</a>]]></dc:creator><pubDate>Sun, 30 Dec 2012 17:00:00 GMT</pubDate></item><item><title><![CDATA[What's the result of [1, 2, 3].map(parseInt)]]></title><description><![CDATA[<img src="http://www.gravatar.com/avatar/201e7a836b57569bf241ddd73d90c3bf?r=pg&s=48.jpg&d=identicon"><br/><p><strong>[1, 2, 3].map(parseInt)를 실행하면 어떤 결과가 나올까?</strong></p><p><img src="/post/Array.prototype.map_with_parseInt/@img/map.png" alt="wrongresult "></p><p>결과는 [1, Nan, Nan]이 나오는데 원인은 map 함수의 구현과 가변 인자 때문에 발생한다. </p><p>먼저 아래 식에 실행 결과를 확인해 보자</p><pre><code class="javacript">[<span class="string">'1'</span>, <span class="string">'2'</span>, <span class="string">'3'</span>].map( <span class="built_in">function</span>(v, i, o){
<span class="keyword">return</span> parseInt(v)
}; <span class="comment">// [1, 2, 3]</span>
</code></pre>]]></description><link>http://daewon.github.io/post/Array.prototype.map_with_parseInt</link><guid isPermaLink="false">Array.prototype.map_with_parseInt</guid><dc:creator><![CDATA[<a href="blueiur" target="_blank">daewon</a>]]></dc:creator><pubDate>Sun, 09 Dec 2012 15:02:00 GMT</pubDate></item><item><title><![CDATA[Next generation Java Programming Style]]></title><description><![CDATA[<img src="http://www.gravatar.com/avatar/201e7a836b57569bf241ddd73d90c3bf?r=pg&s=48.jpg&d=identicon"><br/><h3 id="toc_20"><a href="http://codemonkeyism.com/generation-java-programming-style/">차세대 자바 프로그래밍 스타일</a></h3>
<p>많은 회사와 개발자들이 자바로부터 새로운 언어인 <strong>Ruby, Python, Groovy, Erlang, Scala</strong> 등으로 이동했다.</p><p>여전히 자바를 사용하고 있을지 모르겠지만, 자바를 사용하더라도 프로그래밍 스타일을 바꿀 수 있고, 새로운 언어로부터 여러 이점을 취할 수 있다.</p><p>최근 15년 동안 자바의 프로그래밍 스타일은 매우 많이 변했다.</p>
<ul>
<li><strong>Final is your new love</strong></li>
</ul>
]]></description><link>http://daewon.github.io/post/next-generation-java-programming-style</link><guid isPermaLink="false">next-generation-java-programming-style</guid><dc:creator><![CDATA[<a href="blueiur" target="_blank">daewon</a>]]></dc:creator><pubDate>Sat, 01 May 2010 14:26:00 GMT</pubDate></item></channel></rss>