News for hackers. Stuff that matters.
Re:Front-End Developer Handbook by poof131 on Saturday April 14, 2018 @08:58AM (#16837121)
"A whole lot of developers adopt static type checking for mostly subjective reasons or band wagon emotions. Some sell out completely to Typescript and the Microsoft way of doing things while others take on a slower approach with Flow. One thing is for sure, most developers don't need types, they are simply complicating already complex problems and solutions. Like most things, most of this trend is subjective dogma not objective value."

Wow, biased much. I love JavaScript and ES6. But anything that I work with a team on or expect to live beyond a month or so, I love types for. Making a large refactor without types is the wild west. Types help provide structure/understanding about the data flowing through your system. And if you need to eject you can with Any. I used to prefer pure JS (or Python), certainly quicker to prototype, but also more difficult to grow and maintain. Tradeoffs in both directions. Such an amateur statement makes me question the rest of the document.

Re:Front-End Developer Handbook by Blackstone4 on Saturday April 14, 2018 @09:34AM (#16837262)
> "Some sell out completely to Typescript and the Microsoft way of doing things"

> "this trend is subjective dogma not objective value"

Ironically, the author own phrasing is not objective and somewhat hypocritical. S/He described the use of Typescript as "selling out and the Microsoft way of doing things". S/He's trying to leverage anti-Microsoft sentiment to boost her/his argument. Feels more like a smear campaign then an objective opinion.

Re:Front-End Developer Handbook by swebs on Saturday April 14, 2018 @11:46AM (#16837794)
To be fair, the anti-Microsoft sentiment didn't just pop up out of nowhere. I've been burned by Microsoft's bullshit so many times that I will go out of my way to deny them any semblance of power, lest they try to leverage it for some new anti-consumer vendor lock-in scheme.

How's that old saying go? Fool me once, shame on you. Fool me 47 times, shame on me.

Re:Front-End Developer Handbook by brandall10 on Saturday April 14, 2018 @01:43PM (#16838402)
Anti-MS sentiment is related to its business practices and perhaps dev community itself, not tooling.

I've never seen a person who actually is familiar with Typescript say anything negative about it, and it has huge uptake in the open source community.

Re:Front-End Developer Handbook by olavgg on Saturday April 14, 2018 @08:08PM (#16840318)
Oh Microsoft has also been involved with tooling, you know how they sold that SOAP crap. They made it complex by purpose, so you had to buy tools to work with SOAP.

Ref Book: The New Kingmakers

"It’s hard to feel too sorry for SOAP’s creators, however — particularly if what one Microsoft developer told Tim O’Reilly is true: “It was actually a Microsoft objective to make [SOAP] sufficiently complex that only the tools would read and write this stuff,” he explained, “and not humans.”"

Re:Front-End Developer Handbook by brandall10 on Tuesday April 17, 2018 @11:31AM (#16859242)
Ha... there are def many things they've been involved in that were questionable from that perspective, but I'd still put that under the domain of business practices.

I guess my take is overall they earned high marks from the dev community despite whatever misses they may have had over the years.

Re:Front-End Developer Handbook by smoyer on Saturday April 14, 2018 @03:05PM (#16838871)
I'm not a Microsoft hater but I also haven't needed their software for my job in quite some time. I am however a Microsoft Project hater (don't ever try the auto-level resources function). But someone was demonstrating (Terraform I think) using Visual Studio Code and I fell in love with the editor. It's now my primary IDE, it's Microsoft and it's completely OSS.
Re:Front-End Developer Handbook by Blackstone4 on Saturday April 14, 2018 @02:11PM (#16838597)
To be fair?!

I was addressing the phrasing and lack of objectivity of the Typescript statement. At no point did I discuss the merits of anti MS sentiment.

Yes I agree with you that MS has burnt people in the past. At the same time it's not binary so 100% of MS != evil.

Re:Front-End Developer Handbook by renw0rp on Saturday April 14, 2018 @01:16PM (#16838262)
apple is the new Microsoft, and people keep throwing money at them...

also, even though the MS anti-sentiment didn't pop up out of nowhere, it's not relevant in the static-vs-dynamic typing discussion...

Re:Front-End Developer Handbook by dhimes on Saturday April 14, 2018 @12:03PM (#16837887)
won't get fooled again :)
Re:Front-End Developer Handbook by smoyer on Saturday April 14, 2018 @03:03PM (#16838858)
Completely OT:

Unfortunately I can't hear that song anymore without picturing the opening scenes of CSI Miami.

Re:Front-End Developer Handbook by GioM on Saturday April 14, 2018 @05:05PM (#16839498)
He/Him. The author has a clear preference[1], please use it.

[1] http://codylindley.com/

Re:Front-End Developer Handbook by baron816 on Saturday April 14, 2018 @10:55AM (#16837553)
> Making a large refactor without types is the wild west. Types help provide structure/understanding about the data flowing through your system.

If you’re working on a large, unstructured project that you’re trying to refactor, you’re problem probably isn’t with the types. It’s that the people working on it used types as a crutch so that they thought it was okay to write classes that were thousands of lines long with giant methods that are impossible to make sense of.

The interview question I’ve been asking lately is about object design. I tell them not to put things into one big method—that it needs to be readable for junior devs. They always ignore me. The ones who struggle the most are the ones who try to do it in a staticly types language (which I’m sure you agree is crazy to use in an interview for a tiny problem). Their mental model forces them to think about types first, and they then can’t think about anything other than that and just making the thing work.

If you aim to keep your objects and you methods small enough that anyone can read them and make sense of them, then you don’t need static types and refactoring becomes easy. There are plenty of developers of mediocre talent who never use types and are able to build huge features and projects quickly and with high maintainability and flexibility because they write code that sticks to good object oriented design principles.

A class I work on regularly has become so big that everyone, especially the more senior, more talented engineers at my company are too afraid to touch, let alone try to refactor. It’s stayically typed.

Re:Front-End Developer Handbook by gary__ on Saturday April 14, 2018 @01:42PM (#16838396)
I can't relate to this line of thinking at all.

Your one big method interview example - so you think had they not been able to reply on static typing for refactoring in their previous work they would have gravitated toward cleaner code? That just seems wildly speculative as a counter to me. A fair amount of projects don't get the refactoring they need in the first place, so developers working on those don't get the experience to begin with. Developers who write large functions often have reasons like "if you use multiple functions you have to jump around to see whats going on." If i'm attacking a straw man, its unintentional.

Anyway having unit tests in a projects would encourage smaller units more, you can have tests easily in static languages - so you get the best of both worlds - smaller units and the ease static typing brings to refactoring.

The go-to sources on writing good code in c#/java land are proponents of keeping methods and classes small as well - that's where i learnt from. (Not to start any wars on over use of design patterns)

Your comment assuming we'd all agree choosing a static language is a bad choice for a small example is also very strange to me. When i'm under pressure id go with what i'm most familiar with, likely C#. Though, with JS and PHP being my dynamic alternatives, i may just be sounding like a very bad programmer to you ;)

I've seen plenty of very long functions in javascript (and c#), and dont think it has anything to do with static typing.

Re:Front-End Developer Handbook by nxc18 on Saturday April 14, 2018 @11:16AM (#16837653)
Sounds like you're permanently stuck living in amateur hour... I have never seen anyone past high school level CS try to pull the shit you describe. Those aren't problems of static typing, they're problems of poor dev talent.
Re:Front-End Developer Handbook by swirepe on Saturday April 14, 2018 @11:31AM (#16837719)
I don't know why you're conflating using a type system with writing large classes.
Re:Front-End Developer Handbook by baron816 on Saturday April 14, 2018 @12:01PM (#16837876)
At question is whether the benefits of static typing outweigh their costs. From my experience (purely anecdotal) static typing provides a false sense of security that encourages bad practices, thus turning the benefits of types into costs themselves.
Re:Front-End Developer Handbook by Can_Not on Sunday April 15, 2018 @12:12AM (#16841165)
To me, that sense of security is not false (even 90% reliable is better than 0%). And to suggest that type systems are a contributory factor to developers writing functions/classes that are too large is completely unsubstantiated.
Re:Front-End Developer Handbook by FLUX-YOU on Saturday April 14, 2018 @09:12AM (#16837185)
Looking back and forth between code and docs just to remember the shape of returned objects is annoying and probably the worst for productivity.

I imagine most people using vanilla JS have significant amounts of objects memorized.

Re:Front-End Developer Handbook by zdragnar on Saturday April 14, 2018 @10:00AM (#16837334)
IDEs like webstorm can ostensibly be quite helpful if you use jsdoc style annotations.

However, in my experience, once a code base is big enough, you can open almost any file and find documentation that's out of date, incorrectly copy-pasted, or some other major issue. TS, on the other hand, at least forces you to stay correct, which is ultimately what convinced me to switch.

Re:Front-End Developer Handbook by nothrabannosir on Saturday April 14, 2018 @10:14AM (#16837382)
> jsdoc style annotations

Which are a form of type annotations. Case in point: the typescript compiler can actually parse those, in .js files, and yield appropriate warnings on errors. See the //@ts-check annotation.

Re:Front-End Developer Handbook by zdragnar on Saturday April 14, 2018 @11:00AM (#16837581)
It'd be a lot less effort to just use TS imho.
Re:Front-End Developer Handbook by zdragnar on Saturday April 14, 2018 @12:32PM (#16838042)
Edit: I meant jsdoc-style, not "style annotations".
Re:Front-End Developer Handbook by speg on Saturday April 14, 2018 @09:36AM (#16837269)
IF there any docs!
Re:Front-End Developer Handbook by fulafel on Saturday April 14, 2018 @09:04AM (#16837146)
Types are not the only game in town, schema style solutions (like Clojure(Script)'s spec) have many things over static type systems.
Re:Front-End Developer Handbook by zdragnar on Saturday April 14, 2018 @09:56AM (#16837324)
You can use both, ala tcomb or io-ts
Re:Front-End Developer Handbook by nxc18 on Saturday April 14, 2018 @11:20AM (#16837673)
There were so many overtly biased and misleading statements in just the first page that the whole work lost credibility.
Re:Front-End Developer Handbook by hn0 on Saturday April 14, 2018 @10:16AM (#16837388)
Hmm, complicated? I think JS’ type rules are much more weird and complex than the average static type checking solution.
Re:Front-End Developer Handbook by pault on Saturday April 14, 2018 @02:32PM (#16838726)
I had an epiphany recently when I realized that I had spent about 40-50% of my time on a recent project writing type checking conditionals and unit tests that would have been obviated by using a type system. I am considering typescript for my next project.
Re:Front-End Developer Handbook by jpd- on Saturday April 14, 2018 @10:12AM (#16837378)
Context means everything. Is the author working on a startup with weekly sprints and a small dev team, or an enterprise app with 400 devs and a legacy codebase in a waterfall environment?

The author strikes me as someone who has a very narrow breadth of experience.

Re:Front-End Developer Handbook by PaulStatezny on Saturday April 14, 2018 @03:01PM (#16838854)
Agreed.

There are trade-offs between choosing typed and non-typed languages. It’s not wrong to prefer one or the other. But to accuse the other side of selling out or not having objective reasons for the choice is naïve.

Don’t assume that everyone who disagrees with you is stupid. It only demonstrates that you lack an important skill of critical thinking: the ability to consider others’ perspectives and understand them.