Live data from Hacker News

In web design, everything easy is hard again

frankchimero.com

221–230 of 335 posts

Re: In web design, everything easy is hard again

#221
post #138
post #131

Earlier quoted context omitted.

> turns out JS was implicitly casting my string value to octal How exactly? I'm really curious. AFAIK it's pretty hard for a JS string to be casted into anything (pretty easy the other way around though). I guess maybe parseInt can do that, but that's neither casting not implicit.

Looks like it's been fixed in ES5. From memory I was performing an operation on a html color string and if you clicked a color with a certain prefix it would crash. I could easily reproduce the bug but it took me forever to work out why JS was choking. I think I added in some ridiculous string padding to prevent the auto casting. https://stackoverflow.com/questions/2547836/why-doesnt-an-oc...

> Looks like it's been fixed in ES5

That was published 9 years ago.

Re: In web design, everything easy is hard again

#222

This is my experience of web development, every time I return to it. I’m really not an expert in web dev, but it _feels_ like web dev has been badly engineered. JavaScript is a very badly designed programming language (yes, even in its modern form), which I think has caused a lot of problems. Many JS developers don’t know much about programming language design, so they can’t see how bad it is, and they make matters w…

> Things are not pythonic.

You say that like it's always a good thing. I remember I spent 4 hours trying to import a function from a file that was in a sibling directory before I finally gave up and copy pasted the function.

There's also other things that really rub me the wrong way in Python. Once you get used to writing computations as a map/reduce/filter pipeline with fat-arrow functions in ES7, Python lambdas and list comprehensions feel so crippled and lacking in comparison.

There's a lot of other things that ES7 does really well such as imports, asynchronous code with promises/async-await, array/object destructuring, the spread operator, etc.

Don't get me wrong; I love Python and use it heavily in my day job, but it's not the end all and be all. There are fantastic libraries written for Python that make life really good (think Reportlab), but for applications that are highly asynchronous and I/O heavy, I'd take ES6 running on Node any day over Python.

Re: In web design, everything easy is hard again

#223
post #109

Earlier quoted context omitted.

I disagree. While Python, for instance, certainly has its quirks, it doesn't have multiple ways of declaring a function, each with their own scope and hoisting gotchas. In Python, self isn't ambiguous the way this is in JavaScript. Python's datatypes are straight forward, unlike JavaScript, where 1 + "1" produces a valid result. In Python, 9999999999999999 is precisely 9999999999999999, however in JavaScript this is…

Just because JS' _this_ doesn't behave like in other languages doesn't make it bad, I mean it's behaviour is well defined. JavaScript is more dynamic than most languages and yes this may be hard to grasp for the average developer, especially when they come from languages that are considered "more mature".

> behaviour is well defined.

True, and we could go one step further: it's unambiguously defined, with invariant rules that can be used to prove a conformant implementation.

Re: In web design, everything easy is hard again

#224
post #64
post #54

Earlier quoted context omitted.

Modern JavaScript is not a very badly designed programming language. It's a good, productive programming language. Most of the quirks can be disabled with a linter, and optionally a lot safety can be brought in with typing (using e.g. TypeScript). On the other hand, many developers don't know much about programming and JavaScript, and therefore tend to have unjustified criticism of the language. JavaScript was a perf…

this is all wrong, sorry. modern js is still js. the fact that linters are _required_ to keep code sane is proof enough. typescript is a different language, i'd wager it doesn't count, even though i agree it's a considerable improvement. au contraire, many developers know exactly what programming in js looks like, especially compared to other languages. i used to think that c++ and boost compilation was crazy. now i…

"linting" is subjective, preferential—not required.

Python built linting into the language itself and it's super annoying.

Re: In web design, everything easy is hard again

#225

Earlier quoted context omitted.

> html, css, and jQuery work just about exactly the same as they did a decade ago, nothing stops you from using tools you already understand. A decade ago, the requirements for supporting all/most clients (devices) were radically different. Different requirements mean different solutions and perhaps new tools must be used.

This isn't really true. jQuery's compatibility can stretch all the way back to IE8, up to the newest devices. If you require the web to be more than a document viewer, then you might in fact need some different tools; but HTML/CSS/jQuery didn't solve those if you're going back that far, Flash did. But HTML/CSS/jQuery still work to solve the problems they always did. And they're still used in production today. Accordi…

> According to W3Techs, jQuery is still present in 96.2% of the sites they could determine a JavaScript framework for

But that doesn't mean jquery was used exclusively on these sites. Look at any major website, in addition to some modern framework, they will often include jquery for just a few old hacks (I've seen popular sites include 3-5 different jquery versions on the same page).

Re: In web design, everything easy is hard again

#226
post #97
post #91

Did anybody notice that the 1997's Hello World example https://frankchimero.com/writing/everything-easy-is-hard-aga... still works? Open the most easy built-in text editor on your system (even on Android one should be able to do that, isn't it), save it, open it with your browser locally. In some aspects, the evolution of the web is similar to what the C language ecosystem experienced. It was dead simple in the begin…

20 years ago was 1998. CSS was the modern thing. JS was called DHTML and was used for mouse trailing bouncing balls. XMLHttpRequest debuted natively in IE6, which was released in 2001, before that, it was ActiveX and nobody used it. You did create modern sites with CSS, without JS.

It's pretty interesting that the version of css which contains a box model (2/2.1) took 13 years to settle as a standard ( https://en.wikipedia.org/wiki/Cascading_Style_Sheets#Standar... ).

Also interesting is that it took 8 years for XMLHttpRequest to settle into the version ( 2 ) that supports accessing other origins ( https://en.wikipedia.org/wiki/XMLHttpRequest#History ) and that Internet Explorer didn't support CORS until version 10 ( https://en.wikipedia.org/wiki/XMLHttpRequest#Cross-domain_re... ), which reached general availability in 2012 ( https://en.wikipedia.org/wiki/Internet_Explorer_10#History ).

Re: In web design, everything easy is hard again

#228

This is my experience of web development, every time I return to it. I’m really not an expert in web dev, but it _feels_ like web dev has been badly engineered. JavaScript is a very badly designed programming language (yes, even in its modern form), which I think has caused a lot of problems. Many JS developers don’t know much about programming language design, so they can’t see how bad it is, and they make matters w…

> There appear to be an excessive number of package managers involved. Largely agree with your assessment except for this. Which package managers are you referring to? 99% of the js world uses npm, and the other 1% uses yarn. I’m not aware of a single other package manager in the web ecosystem. In fact this is probably one thing where they got it right.

Bower?

Re: In web design, everything easy is hard again

#229

Earlier quoted context omitted.

This isn't really true. jQuery's compatibility can stretch all the way back to IE8, up to the newest devices. If you require the web to be more than a document viewer, then you might in fact need some different tools; but HTML/CSS/jQuery didn't solve those if you're going back that far, Flash did. But HTML/CSS/jQuery still work to solve the problems they always did. And they're still used in production today. Accordi…

> According to W3Techs, jQuery is still present in 96.2% of the sites they could determine a JavaScript framework for But that doesn't mean jquery was used exclusively on these sites. Look at any major website, in addition to some modern framework, they will often include jquery for just a few old hacks (I've seen popular sites include 3-5 different jquery versions on the same page).

Also, WordPress includes it by default, but rarely are the site admins actually doing anything with jQuery.

Re: In web design, everything easy is hard again

#230

This is my experience of web development, every time I return to it. I’m really not an expert in web dev, but it _feels_ like web dev has been badly engineered. JavaScript is a very badly designed programming language (yes, even in its modern form), which I think has caused a lot of problems. Many JS developers don’t know much about programming language design, so they can’t see how bad it is, and they make matters w…

You'll likely love typescript. You can spin it up with:

npm install -g typescript

then put this in a tsconfig.json file:

{ "compilerOptions": { "emitDecoratorMetadata": true, "module": "commonjs", "target": "ES5", "outDir": "ts-built", "rootDir": "src" } }

then run tsc -w

you can tweak the compiler for prod or debugging output etc. with these flags for the cli or the json config: https://www.typescriptlang.org/docs/handbook/compiler-option...

Then you could add a single css file in which you prefix class names using something like: myprojectuniquename__someelement.

Then if you use async/await instead of callbacks, flexbox in your css, check supported browser features by googling 'caniuse feature', and use fetch for network access, you could have a pretty simple system that works for you in under an hour.

Post reply on HN