HNHacker News
TopNewBestAskShowJobs

Tx3

266 karma · joined October 12, 2013

Independent web developer focusing on architecture design, performance & maintainability. Over 10 years of experience on cutting-edge web development. Blogging about tech and freelancing.
submissionscomments
Tx3··on I Was Wrong About TypeScript
Hey, I just tried to be polite.. but yes, you're absolutely right, understatement of the century!
Tx3··on I Was Wrong About TypeScript
Interesting solution, thank you for the link!
Tx3··on I Was Wrong About TypeScript
In the blog post, I have one example of the React use case with screen capture.

I find it very helpful to have properties defined, so when I use the component, I immediately know what are the props I can provide.

There are some 3rd party React components that won't have type definitions yet, but the popular ones are well covered. I have written most of the components I have used, so I haven't had many problems.

Tx3··on I Was Wrong About TypeScript
Rob is exactly right that you should use --outDir

You should aim for deployment process where outDir would be in .gitignore and building of the JS files would happen on a build server.

Tx3··on I Was Wrong About TypeScript
Good point! I used similar categorising as Anders Hejlberg used in the JavaScript Jabber podcast (https://devchat.tv/js-jabber/209-jsj-typescript-with-anders-...). For those who don't like audio, he basically referred TypeScript being superset of JavaScript, unlike some other languages.
Tx3··on I Was Wrong About TypeScript
It also depends on how deep do you want to go with language features.

Let's say you have existing ES2015 source code. You could start experimenting on a local machine and use a script to rename js files to ts. Run the TypeScript compiler and annotate some of the most used functions.

You can then check what is the experience of using those functions that have type annotations, what is the speed of the development, etc.

Sit down with colleagues, show what you have done and ask what do they think. You can then decide to proceed and stick with type annotations until you're sure. Use boy scouts rule: "Always leave the campground cleaner than you found it." aka add typings to the function declaration.

Tx3··on I Was Wrong About TypeScript
About pre-existing libraries that don't have type definitions.

The way I dealt (until proper type definitions are written) was:

declare module "react-loader" { var noTypeInfoYet: any; export = noTypeInfoYet; }

Tx3··on I Was Wrong About TypeScript
I wonder is it some black humour to choose padLeft as an example source code. :)

Thanks for the links, future looks promising indeed.

Tx3··on I Was Wrong About TypeScript
About the text editor: I think all editors use the same TypeScript compiler APIs. That would mean that you would get pretty much same suggestions, error lists, etc. Correct me if I am wrong. VS Code could have some other API calls or project file support.

JS Jabber episode was great! Full of great insights.

Tx3··on I Was Wrong About TypeScript
It would be interesting to hear more about your experiences. I have been quite hesitant to use more advanced TypeScript features and stayed on a type system related annotations.
Tx3··on I Was Wrong About TypeScript
3rd party libraries / frameworks written with non-JavaScript languages is worth another blog post and discussion. I agree completely with you that libraries / -most- frameworks should be written in plain old JS.

The reason is simple, contributing and reading the project source code should not start by learning a programming language. It is a different scenario when a team in a company has decided to learn and write their project with TypeScript/CoffeeScript/etc. language.

About tooling, I think writing modern JavaScript (ES2015, ES2016) is beneficial and therefore, you need a tool like Babel. When you go to that path, why not use TypeScript instead and get ES2015/ES2016 + type system + great compiler?

Tx3··on I Was Wrong About TypeScript
I am pleased to hear! One of the goals of the blog post was to convince people to give a second thought for the great tool.
Tx3··on I Was Wrong About TypeScript
You're absolutely right. Flow seems to be a very good alternative.

One thing I would like to add regarding the .js files, TypeScript 1.8 added a flag --allowJs which makes some sanity checks to the plain old .js files.

Tx3··on Four-day work week – Lessons learned
Nice one, thanks!
Tx3··on Four-day work week – Lessons learned
There is no need to wake up early, I think it's simple as that.

On a working day you might have to wake up earlier than you would naturally do.

Tx3··on Four-day work week – Lessons learned
The mandatory paperwork in case of freelancer is quite minimal effort. I have an accountant to whom I need to provide material. Currently in the paper form, but soon switching to electronic. Gathering the material takes about 2 hrs/ month.

Billing takes 5 minutes (I use web application called Zervant) and checking that the payment is received takes few minutes.

Then there are "random" stuff like updating insurance, meeting people (few times per month) etc.

Not that much stuff really.

Tx3··on Four-day work week – Lessons learned
It's just me who to blame. I like to leave early to work, so that when I commute it's quiet and I can do work in the train. But the problem is than I like evenings. You just have to have one Game of Thrones episode and sleep rhythm is ruined. ;)

My normal sleep routine would be 23:15 to bed and 06:45 up, so about 7,5 hours. Everything under that I consider sleep deficit.

Tx3··on Four-day work week – Lessons learned
Heh, I see your point. See dan_blanchards comment and my answer to it.

I'm not native English speaker and by mistake made it sound bit more dramatic than I originally thought.

Tx3··on Four-day work week – Lessons learned
Haha, Touché! I actually gave this text to my wife for proof-reading and didn't receive any negative comments on that sentence!
Tx3··on Four-day work week – Lessons learned
I think you're right. It could mean exactly what you said that all work is done in 4-days and then three days off.

But it's equally right to do less work and spend the time on anything you like or things you have to do.

I do agree that freelancer status gives you more control, but it should not hurt anyone to ask what is your company's point of view. Assuming that employee is interested of downshifting, studying, working on a side-project (that is not competing with employers product) etc.

Tx3··on Four-day work week – Lessons learned
Good point! About 30 hours per week.

I'll update the blog post also.

Tx3··on Four-day work week – Lessons learned
It's a bit fuzzy what is work and what isn't.

For example: writing a blog post might be work for someone, side-projects can be done for business purposes or for just hobby etc.

What I try to do is things that interest me and get joy out of it.

Tx3··on Four-day work week – Lessons learned
Is there a possibility to go and do your stuff in other place than home? Library, cafe, co-working space perhaps?
Tx3··on Four-day work week – Lessons learned
For me it would be little bit more difficult than 4-day work week. I do agree that 7-8 hours of programming per day isn't optimal for concentration, but having a possibility to have extended weekend is a big plus for me.

I am sure you would find people that adapt to it.

One thing I am wondering is that should everyone work on the same schedule? I am not talking about night shift type of things, but there should be more than enough overlap between working schedules if one works 9-5 Mon - Fri?

Tx3··on Four-day work week – Lessons learned
I'm sorry if I was misleading, my intention was not say that 4-day work week doesn't work.

I just didn't have to use the day for meetings like I originally planned and instead I was able to write that blog post that you just observed.

Tx3··on Four-day work week – Lessons learned
I know only one company that publicly has 4-day work week for all employees and that's Treehouse https://teamtreehouse.com/ and the founder Ryan Carson has good blog posts about the topic such as http://ryancarson.com/post/21708810513/4-day-week
Tx3··on Four-day work week – Lessons learned
Interesting! I tried to switch for 4-day work week earlier when I worked in consulting firm and the excuse was that it's harder to allocate me to a project.

I asked that isn't four days easier to allocate than five days as it means less allocation? Would it be easier if I would work 6-days week? Never got answer.

Most of the excuses are bullshit. The truth in consulting business is that they don't get as much money from you (even if you cut 1/5 from your salary).

Tx3··on Four-day work week – Lessons learned
Good question!

I'm lucky in a sense that demand is high at the moment. I haven't been able to yet convert that to high hourly price, but it's high enough to actually have a 4-day work week.

I have considered hiring help and came to conclusion that I have two options:

A) hire an employee B) get another freelancer to help

As the demand is high it also means that hiring is also difficult for me. Front-end developers have plenty of options to choose from and that basically means that I should provide good culture, benefits, salary etc. which require lot of effort from my side to do properly. Also, hiring people in Finland is quite expensive due to the "overhead": insurances, pensions etc.

Providing work to another freelancer and taking a cut might be profitable when you've >3 freelancers working on a project you've successfully written contract for.

I am bit more towards karma thinking: if I recommend someone for free, the positive action will be returned to me when the demand is lower.

Tx3··on Four-day work week – Lessons learned
Thank you for sharing your experience!

Taking the day totally off especially when you have a special time period going on sounds like wise move.

I think in the future all this will be more popular as there will more and more people and less work due to the automation. One solutions is to decrease amount of work single person is doing and giving the rest for someone else.

Now I'm going to read the feedback section of your question.

Tx3··on Podcasts for Web developers, designers and curious minds
That might be good for the category: "For curious minds". Thanks for the tip!
Page 1 of 2Next →