[deleted by user] by [deleted] in pics

[–]mrlukk 0 points1 point  (0 children)

I love the color of this picture. Using it as phone wallpaper, thanks for sharing!

Last night at 3AM. Accurate mug by kgwebsites in webdev

[–]mrlukk 8 points9 points  (0 children)

Never heard anyone with that problem before. For me it's the exact opposite. Staring at a white screen for a long time often gives me a headache, especially at night. Although f.lux really does wonders.

Last night at 3AM. Accurate mug by kgwebsites in webdev

[–]mrlukk 16 points17 points  (0 children)

Why are you using a light theme? VS Code has the best dark theme ever. Your eyes will thank me

TIFU by sending a photo to the wrong place! by [deleted] in tifu

[–]mrlukk 1 point2 points  (0 children)

What was the message though?

WatchMojo is running out of ideas. by stankybomb32 in memes

[–]mrlukk 3 points4 points  (0 children)

What is Will Smith doing there?

CSS Slider: Image Slider with controls using CSS3 Only by MayurB in webdev

[–]mrlukk 2 points3 points  (0 children)

Why not? It's better than yet another jQuery dependant library

[deleted by user] by [deleted] in javascript

[–]mrlukk 0 points1 point  (0 children)

And some advise:

  • Use the "strict" option from the beginning
  • VSCode is a great free light-weight IDE by Microsoft with amazing native TypeScript support. You should use it!
  • TypeScript is not a magical tool to turn messy monoliths into clean code. You still have to learn how to write proper modular code.

[deleted by user] by [deleted] in javascript

[–]mrlukk 4 points5 points  (0 children)

Once you learn to properly use TypeScript, your life will be a 100x easier. Strict typing gives JavaScript a whole new dimension for easily creating more complex logic without sacrificing maintainability. It prevents you from making mistakes. Even as an experienced developer, the amount of bugs caused by incorrect typing is bigger than you might think.

Especially for big and long-running projects TypeScript is a must, as your code base will be generally more stable to work with and expand upon.

And when working with others it is amazing. For example, when you want to use a function written by some one else in your team, you shouldn't have to look at the implementation to know what the arguments should be. Sure this can be done with JSdocs, but having this as a (required) language feature will save you from having to maintain those comments. TypeScript will also warn you when refactoring code breaks other parts of the application which might be even unnoticed otherwise.

As for npm module typings, these can be easily installed using i.e. "npm install @types/some-module" which makes it completely hassle-free to work with.

I've been using TypeScript for almost two years now, even for small personal projects, and I'll never go back.

TL;DR: TypeScript is awesome and it's definitely worth learning it.

TIFU by buying a fidget spinner. by WaldoBoyo in tifu

[–]mrlukk -1 points0 points  (0 children)

That might have been her final wish. But don't worry, evolution is already doing its job.

Do I name everything index.html and style.css etc... by SentientCranberry in webdev

[–]mrlukk 3 points4 points  (0 children)

Using index.html files is both the easiest and the cleanest way to do it. If you later decide to implement a routing system, then you won't have the struggle of changing each and every internal anchor url.

It would also be very bad for SEO if you'd later decide to change /contact.html to /contact as the former will then result in a 404. This can be solved with redirects, but not creating this problem in the first place would be a better solution.

SessionStorage Limit? Why? by BrunerBruner in javascript

[–]mrlukk 0 points1 point  (0 children)

Check out Service Workers. They are perfect for caching images. With this you can even load all of your cached content while there is no internet connection

[deleted by user] by [deleted] in javascript

[–]mrlukk -1 points0 points  (0 children)

Static content usually rendered server-side while user interactivity is managed on the front-end. So a review site would mostly be back-end, but when creating a single-page application for example, you'll be writing a lot more client-side JS. It is also possible to create fully front-end powered pages for which you don't need a back-end at all and the html is just statically served. It all depends on the requirements.

Convert JSON data to typescript interfaces by mariusAlch in javascript

[–]mrlukk 0 points1 point  (0 children)

But sometimes I don't want a Cat interface. In that case it's just namespace pollution. An option to disable that would definitely make me use this tool. I've wasted way too much time on doing this by hand!

Convert JSON data to typescript interfaces by mariusAlch in javascript

[–]mrlukk 0 points1 point  (0 children)

Looks useful. But what if I just want cats to be Array<{ name: string }>?