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
. 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

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().

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":
elif command = "standing":
elif command = "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. –

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

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

  • 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
(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.

Molly Kozlowski

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

作者: 立中順平  
出版社:楓書坊 |譯者: 游若琪
規格:平裝 / 217頁 / 19 x 25.7 x 1.08 cm / 普通級 / 部份全彩 / 初版
購買請點我【 博客來書店
◆注意,如果有瀏覽器有安裝檔廣告的程式 連接AP 有可能失效◆ 

  ➊ 建立正確的心態
  ➋ 練習簡單畫全身的速繪技巧▁▁火柴人練習
  ⑴ 將全身分成15個部位,
  「頭 部、胸部、骨盤」是橢圓形。
  ⑵ 注意基本結構,不要注意輪廓和細節
  ⑶ 立體化
  ⑷ 創造不對稱平衡
  1993年開始在Disney Animation Japan擔任動畫師。
  後來進入Answer Studio,目前是自由工作者。
  曾參與《跳跳虎歷險記》(Disney)、《棒球大聯盟》(電視版)、《鑽石王牌》、《YURI !!!on ICE》、《佐賀偶像是傳奇》等作品。
由曾經在華特迪士尼動畫工作室與日本動畫公司Answer Studio的日本資深動畫師立中順平撰寫的速繪教學書
第一章節:速繪繪畫 P1-73.

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!