Java for All the pieces

I used to ask interviewees, “What’s your favourite programming
language?” The reply was practically at all times, “I simply select the appropriate language
for the job.” Duh. Does anybody ever intentionally choose the incorrect language? This
was clearly a solution to keep away from really naming a language for concern of selecting one I
didn’t like.

If the interviewee gave a solution in any respect, it was, “I’m most conversant in
language X,” which didn’t reply my query both.

On the time I’d myself have replied one thing like, “I like Python greatest
as a result of it makes me glad to program in it, however I solely use it in such-and-such
a scenario. The remainder of the time I take advantage of XYZ…”

A few yr in the past, although, I began to kind an odd concept: That Java is the
proper language for all jobs. (I pause right here when you vomit in your
mouth.) This rests on the argument that what you understand to be true doesn’t
match actuality, and that’s by no means a preferred strategy, however let me clarify anyway.

Python actually is my favourite language, and it really makes me glad after I code
in it. It pushes the glad spot in my head. It matches pseudo-code so nicely that
it’s a real pleasure to work in it.

Years in the past I learn Bruce Eckel’s influential Sturdy Sort vs. Sturdy
Testing
. In it he argued
that static typing (what he calls sturdy typing) is without doubt one of the many aspects of
program correctness, and that should you’re going to examine the opposite aspects (such
because the algorithm and the logic) with unit exams, then the categories may also get
checked, so it’s possible you’ll as nicely go for dynamic typing and profit from its
benefits.

Bruce used Python for instance his code, and that clinched it: I made a decision that
I’d from then on write all the pieces in Python. Sadly I used to be half-way
by means of a big Java program at work, however my co-worker and I agreed that it
ought to have been written in Python, and maybe at some point we’d get a superb excuse
to rewrite all of it that means.

A number of issues modified my thoughts 180° in lower than a yr:

  • At one firm I wrote a simulator that allowed me to run
    my Java companies with out a fully-functional web site. On this
    simulator I ran scripts that examined varied
    situations together with failures. For these scripts
    I made a decision to make use of JavaScript,
    primarily as a result of it’s included in Java 6 and secondarily
    as a result of many individuals understand it. I reasoned {that a} scripting
    language would enable us and Q/A to write down exams simply.
    An intern, Justin Lebar, argued that we must always merely
    use Java. The simulator is in Java, so why not write
    the scripts in it too? It’s sitting proper there and
    everyone knows it. I went forward with JavaScript, which compelled
    me to write down varied code to bridge the 2. It additionally
    meant that stack traces have been a lot tougher to learn,
    since they didn’t level to the road within the script that
    was being executed. Q/A by no means wrote any exams.
    Total we gained nothing from
    JavaScript and Justin had been proper.

  • On the identical firm we saved our logs in JSON format
    (which is a good concept, by the way in which), and a co-worker
    wrote a Python program referred to as logcat to parse the
    logs and generate the usual columnar output,
    with many good options and flag (together with a binary
    seek for timestamp). On OurGroceries, my private
    venture, we wanted one thing comparable and I recommended
    once more to make use of Python. My accomplice Dan Collens recommended
    Java, because it’s proper there and we all know it and
    it’s quick. He wrote it and he was proper: it’s blazing
    quick. I’ve since in contrast the Python logcat to a Java one
    and the latter is about ten occasions sooner. No matter
    time was saved by the developer when writing the Python code (if any)
    have been misplaced many occasions over as dozens of customers had
    to attend ten occasions longer every time they fished
    by means of the logs.

  • And at last, I went to write down a easy program
    that put up an online interface. I thought of utilizing
    Python, however this is able to have required me to determine
    out methods to serve pages from its library. I had
    already performed this in Java (with Jetty), so I may
    be up and operating in Java in much less time. I noticed
    that as I accumulate information about third occasion Java
    libraries and develop my very own utility library, it
    turns into more and more costly to make use of another
    language. I’ve to determine these issues out once more
    and write them once more, as a substitute of copying and
    pasting the code from the earlier venture. Observe
    that this doesn’t argue for Java, but it surely does argue
    for utilizing a single language.

The massive argument towards Java is that it’s verbose. Maybe, however so
what? I suppose the true argument is that it takes longer to write down the code. I
doubt that is very a lot true after the primary 10 minutes. Positive it’s important to
write public static void important, however how a lot time does that take? Positive you
have to write down:

Map<String,Person> userIdMap = new HashMap<String,Person>();

as a substitute of:

userIdMap = {}

however within the larger scheme of issues,
is that so lengthy? What number of complete minutes out of a day
is that, two? And in Python the code extra realistically
appears to be like like this anyway:

# Map from person ID to Person object.
userIdMap = {}

(If it doesn’t, then you may have larger issues. Undocumented Python packages are
horrendously tough to take care of.) The issue is that programmers understand
senseless work as painful and time-consuming, however the actuality is rarely so unhealthy.
Right here’s a quote from a discussion board about language design:

It actually sucks when it’s important to add kind declarations
for blindingly apparent issues, e.g. Foo x = new Foo().
@pazsxn

No, really, typing Foo one further time doesn’t “actually suck”. It’s three
letters. The burden is massively overstated as a result of the work is senseless, however
it’s actually fairly trivial. Programmers will cringe at writing some sort of
command dispatch listing:

if command = "up":
    up()
elif command = "standing":
    standing()
elif command = "revert":
    revert()
...

in order that they’ll go off and write some introspecting auto-dispatch cleverness, however
that takes longer to write down and can absolutely confuse future readers who’ll surprise
how on earth revert() ever will get referred to as. But the programmer will incorrectly
really feel as if he saved himself time. That is the entice of the dynamic language.
It feels such as you’re being extra productive, however except for the primary 10 minutes
of a brand new program, you’re not. Simply write the silly dispatch manually and get
on with the true work.

The General Problem

(Apart: I’m on the incorrect aspect of a distinct resolution, the one to make use of vim for
code enhancing. I really feel very environment friendly when utilizing vim, as code flies across the
terminal, and I really feel sluggish utilizing Eclipse, and justify my selection with this
effectivity argument. However absolutely all my beneficial properties are misplaced the primary time I’ve to
lookup who calls a specific perform, or when I’ve to lookup the strategies
of an object manually. I acknowledge that I’m incorrect on this one in the identical means
that dynamic language apologists are about their selection.)

So why are dynamic languages ever chosen? When you and I’ve a contest to write down
a easy running a blog system and also you’re utilizing (say) Python, you’ll have one thing
fascinating in half-hour utilizing pickling and whatnot, and it’ll take me two
days to construct one thing with MySQL. Many language decisions are primarily based on trivial
contests like these. However after two weeks of growth, once we each must
add a characteristic, mine will take at most so long as yours, and I received’t be spending
any time determining methods to get my system to deal with so many customers, or monitoring
down why some obscure if clause breaks since you misspelled the title of a
perform, or determining what the heck this request parameter accommodates.

The basic hacker disdain for “bondage and self-discipline languages” is brief
sighted; the wants of huge, long-lived, multi-programmer initiatives are simply
totally different than the fast work you do for your self. –
Supply

And also you don’t suppose you’ll wrestle with scalability earlier than I? Yearly
the NaNoWriMo web site goes down on October thirty first.
It’s unresponsive for days. About 60,000 folks hit it over a interval of a number of
hours, so perhaps 4 requests per second. It’s written in PHP. The OurGroceries
backend is written in Java. It handles (at the moment) about 50 advanced requests
per second and the CPU hardly ever goes above 1% for the Java course of.

Twitter not too long ago tripled their search
pace

by switching their search engine from Ruby to Java.

A yr earlier, Joel Spolsky tweeted:

The reply from @GregB was:

StackOverflow makes use of ASP.NET. So you possibly can complain all day about public static
void important
, however have enjoyable organising 500 servers. The downsides of dynamic
languages are actual, costly, and everlasting.

And what concerning the unit testing argument? If it’s important to unit check your code
anyway, what does static typing purchase you? Nicely for one factor it buys you pace,
and many it. But in addition writing and sustaining unit exams takes time. Most
importantly, the sorts of bugs that individuals introduce most frequently aren’t the type
of bugs that unit exams catch. With few exceptions (akin to parsers), unit
exams are a waste of time. To cite a buddy of mine, “They’re a tedious,
error-prone means of attempting to recapture the misplaced worth of static kind
annotations, however in a bumbling means in a separate place from the code itself.”

So right here’s my new strategy: Do all the pieces in Java. Don’t be tempted to write down
some fast hack in Python as a result of:

  • You may’t copy and paste code from different initiatives in
    your major programming language.

  • It might really feel sooner to develop, however that’s an phantasm.
    The precise time saved is small, although admittedly
    annoying.

  • It’s another language, platform, and set of libraries
    that I and my co-workers must study and grasp.

  • And right here’s the essential one: Likelihood is good that
    this fast hack will develop and grow to be an essential
    device, and I received’t have the bandwidth to rewrite it,
    but I’ll endure the efficiency and upkeep
    penalty each time I take advantage of it.

I agree it’s enjoyable to develop in Python. I adore it. Once I’m writing a Sudoku
solver, I attain for Python. However it’s the incorrect device for something bigger, and
it’s the incorrect device for code of any measurement written for pay, since you’re doing
your employer a disservice.

I’m even taking this to an excessive and utilizing Java for shell scripts. I’ve discovered
that something apart from a easy wrapper shell script ultimately grows to the
level the place I’m trying up the arcane syntax for eradicating some center ingredient
from an array in bash. What a crappy language! Mistaken device for the job! Write
it in Java to start out with. If shelling out to run instructions is clumsy, write a
utility perform to make it simple.

I’ve additionally written a java_launcher
shell script that enables me to write down this on the high of Java packages:

#!/usr/bin/env java_launcher
# vim:ft=java
# lib:/dwelling/lk/lib/teamten.jar

I could make the Java packages executable and drop the .java extension. The
script strips the header, compiles and caches the category file, and runs the
consequence with the required jars. It gives one of many huge benefits of
Python: the dearth of construct scripts for easy one-off packages.

This deal with a single language has had an fascinating impact: It has
inspired me to enhance my private library of utility
features
(teamten.jar above), since my
efforts are now not cut up throughout a number of languages. For instance, I wrote a
library that accommodates picture processing routines. They’re each sooner and
larger high quality than something you will discover in Java and Python. This took a
whereas, however I do know it’s value it as a result of I received’t discover myself writing some Python
script and wishing I may resize a picture properly. I can now confidently make investments
in Java as an essential a part of my skilled and private technical future.

There stays the query of why selecting Java particularly, out of the set of
compiled statically-typed languages. The benefits of C and C++ (slight
efficiency beneficial properties, embeddability, graphics libraries) don’t apply to my work.
C# is sweet however not cross-platform sufficient. Scala is just too advanced. And different
languages like D and Go are too new to guess my work on.

Once I inform people who I now write all the pieces in Java, they give the impression of being horrified.
One buddy had a visual look of disgust. However , Java’s a reasonably good
language, and when my code compiles, which is commonly the primary time, it’ll
normally additionally run accurately. I don’t have that peace of thoughts with another
language. Java simply works like a horse and is beneficial throughout a really broad vary
of purposes.

find the cost of your paper

Is Huge Information Corrupting the U.S. Election Course of?

As the 2020 election cycle ramps up, voters can expect a flurry of targeted advertisements fueled by big data on their doorsteps, inboxes and social media feeds. While microtargeting based on demographic information is not a new trend in campaign strategy, campaigns traditionally relied on analyzing voter behavior within broader categories such as age or gender before big data was easily accessible.

Contributor
Molly Kozlowski

立中式速繪 動態姿勢繪圖技巧 ポーズが描ければ 動きも描ける たてなか流クイックスケッチ


作者: 立中順平  
出版社:楓書坊 |譯者: 游若琪
出版日期:2020/09/30
ISBN:9789863776314
規格:平裝 / 217頁 / 19 x 25.7 x 1.08 cm / 普通級 / 部份全彩 / 初版
定價:420元|優惠價:79折332元
購買請點我【 博客來書店
▲從部落格連接至博客來購買商品▲
部落格會獲得一些回饋金,幫助我挖更多坑。謝謝。
◆注意,如果有瀏覽器有安裝檔廣告的程式 連接AP 有可能失效◆ 

●本書特色
  ◎從心態及觀念養成開始,1-5分鐘,新手也能立馬上手的「立中式速繪教學」。
  ◎58部插圖教學影片免費下載,新手可一步步反覆學習,書末更附有作品集供創作者參考。
  ◎3大章節、逾200張速繪圖,講解觀察人物技巧、速繪重點及提升風格的小撇步。
速繪人物的基礎三堂課:
  ➊ 建立正確的心態
  不要想畫「正確」,而是要「輕鬆地多畫一些」,
  所謂的觀察力,只是「知識」和「經驗」的累積,
  熟悉自然就會,真的畫不出來的時候,只觀察也行。
  因為#魅力十足的圖,和技巧或常識毫無關係。#
  藉由觀察獲得的經驗和記憶,會轉換成「現實感」並活在作品中。
  不斷畫速繪,就能培養出短時間內掌握特徵的能力。
 
  ➋ 練習簡單畫全身的速繪技巧▁▁火柴人練習
  ⑴ 將全身分成15個部位,
  用2D畫全身,
  「頭 部、胸部、骨盤」是橢圓形。
  「上臂、下臂、大腿、小腿、手、腳」是線條。
  用D字形畫胸廓、軀幹和髖部,塑造印象,
  部位和部位之間留下空白,
  就能輕鬆畫出姿勢。
 
  ⑵ 注意基本結構,不要注意輪廓和細節
  看全身:那個人在做什麼?你有什麼感覺?
  看部位:位置和傾斜度?有什麼功用?
  簡單大膽地畫,鎖定在動作和使用身體的方式。
 
  ⑶ 立體化
  畫出火柴人的2D表現方式,稱作Shape,
  接下來要把平面添加立體的資訊,
  讓Shape有厚度(深度),
  只要畫出縱向的中心線,以及表示膨度的橫向曲線,
  就能變成有厚度和方向性的立體物。
 
  ⑷ 創造不對稱平衡
  全身的節奏和動線是一種流線感。
  盡量避免線條左右對稱,
  大原則是:弧線的對面必然是直線。
 
  ➌掌握印象,最後的風格和情緒添加
  這個人正在做¬「什麼」(動作)?他有「什麼樣」的感受(感情)?
  動作和感情,就是本書所說的動態。
  習慣用少量線條畫全身的思考方式後,就加入動線(flow)的觀點吧!
  不同的曲線會流暢地引導視線。
  彎度深的曲線會用慢節奏,彎度淺的曲線會用快節奏來引導視線。
  將線條加上粗細,就會產生強弱,成為更有趣味性的圖。
 
  本書從心態建立到步驟教學,
  不到20秒就能完成一幅速繪,
  附上58張速繪插圖影片,
  從空白至完稿,一筆一畫的繪畫過程全呈現,
  供學習者一遍一遍觀看臨摹,
  零基礎也沒問題。
 
  每次畫的速繪都是僅有一次的體驗,
  是當下你所能畫出的線條所構成的,
  請輕鬆享受速繪的樂趣吧!
 
◆作者簡介    
立中順平    
  日本岡山縣人。
  1993年開始在Disney Animation Japan擔任動畫師。
  後來進入Answer Studio,目前是自由工作者。
 
  曾參與《跳跳虎歷險記》(Disney)、《棒球大聯盟》(電視版)、《鑽石王牌》、《YURI !!!on ICE》、《佐賀偶像是傳奇》等作品。
 
  目前以動作作畫導演的身分參與各個作品的製作,是負責運動動畫動作表現的資深動畫師。
▼黑介紹
由曾經在華特迪士尼動畫工作室與日本動畫公司Answer Studio的日本資深動畫師立中順平撰寫的速繪教學書
教學主張「不要只在意正確,而是要畫出具有魅力的人物。」
在正確的觀念下,不斷的練習速繪,來培養出掌握特徵的能力。
本書分3個章節
第一章節:速繪繪畫 P1-73.
1-1:速繪的觀念介紹
1-2:速繪人物的重點
1-3:掌握印象
第二章節:繪畫技巧P75-145.
2-1:速繪的各種技巧
2-2:身體局部與衣服
2-3:邁向下一步,動態的掌握
第三章節:速繪作品集P151-218.
收錄立中老師3年來的速繪作品。
▼黑書評
多數速寫教學書都很吃繪畫基礎,在沒有人物基礎的前提下會很難入門。
本書教學另闢蹊徑在以沒有基礎的前提下,講解如何學習速繪
內文資訊量雖然大,但搭配簡化好上手的範例
對新手來說比較好入門,實際操作也不會太挫折
推薦給想讓人物動態更有魅力的學習者們~
這本很不錯用~~~

Design College students’ Summer season Break

With summer break fast approaching, graphic design students like me are trying to figure out productive ways to spend their time. Work for money? Work for experience? Summer classes?

I’ve spent the past few months doing everything I can to
find an internship this summer. Finding a company that isn’t an MLM and will
actually pay good money for your design work is tough. Luckily, graphic design
is a field that’s in demand, so there are a lot of good options out there.

The other option for getting design experience during the summer
break is freelance work, but that comes with its own slew of issues. There’s
nothing worse than beginning to work with a client and getting excited for a
project just for them to look at you with a face like the Surprised Pikachu Meme
when you start to discuss cost.

With two weeks left in the semester, here’s hoping we figure
something out soon!