paint-brush
Professional prideby@Flocke
1,030 reads
1,030 reads

Professional pride

by Jens GrochtdreisMarch 28th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

End of March I was part of the <a href="http://html5-days.de" target="_blank">HTML5-Days</a> in Munich (Germany), a three day conference with half-day long workshops. At the same time the JavaScript-Days, the AngularJS-Days and the React-Days ran. The participants had three full days to gather new ideas and new knowledge from many areas of front-end development. The ever-increasing numbers of participants are proof of the success of the concept.

Company Mentioned

Mention Thumbnail
featured image - Professional pride
Jens Grochtdreis HackerNoon profile picture

End of March I was part of the HTML5-Days in Munich (Germany), a three day conference with half-day long workshops. At the same time the JavaScript-Days, the AngularJS-Days and the React-Days ran. The participants had three full days to gather new ideas and new knowledge from many areas of front-end development. The ever-increasing numbers of participants are proof of the success of the concept.

This year, unfortunately, I had only the opportunity to participate in a single session of a colleague. In addition to my three sessions, I took part in the speaker’s panel. As many speakers as possible sit on a stage and talk about interesting aspects of frontend development. The speaker’s panel as well as the session made me think this year.

In my professional praxis I don’t specialize in JavaScript. I don’t do serious programming. I know my limits and communicate them openly. Smaller DOM manipulations with jQuery, however, are not the problem. If I use JavaScript in my trainings, it is usually a question of smaller jQuery scripts. They are seldom the focus of my remarks. Nevertheless I give myself trouble to write no scrap. It helps that writing total bullshit is not possible with JavaScript, because a faulty program would not be executed.

This is different in HTML. And this seems to have a calming influence on my colleagues, who deal exclusively with JavaScript. In the session I was visiting, definitely not the example app was in focus, but the transformation into a mobile and a desktop application. The remarks were very interesting, I could follow well and now think about which Electron app I absolutely have to make.

At the beginning of the session, the presenter showed us sample code — in this case a short HTML snippet — and asked if we could see any mistakes. Well, the following code is a serious error for me:

<div type=”button” (click)=”takePhoto()”><i class=”fa fa-camera fa-2x”></i></div>

Instead of a button only a `DIV` was abused. Thanks to a lot of JavaScript-magic from Angular, this meaningless `DIV` works like a button. At another point of the app, he uses a button, so he knows this element.

This extreme negligence with regard to HTML is the case with many — if not most — JavaScript tutorials. It makes it hard for me to take the articles, tutorials, yes their authors and speakers seriously. And it annoys me every time. Obviously, the professional pride of the colleagues only focuses on JavaScript, not the entire problem solution. I find that fatal.

The focus of the session and any introductions to React, Angular, and anything else is JavaScript. HTML and CSS should always be marginal notes, which do not have to be explained too extensively. But that is why codestandards are unconsciously preoccupied. I get the feeling that none of the authors (or speakers) would like to spend a second with HTML, so everything is simply wrapped with a `DIV` or a `SPAN`. I’ve also seen `DIV`-containers inside `SPAN`-containers. In such a case the author definitely had not the burden of HTML-knowledge.

I wish my colleagues would care. HTML and CSS are just as important languages ​​as JavaScript. Just because they lack knowledge and understanding for them, they should not treat them as meaningless disposables. Their tutorials and workshops are never about HTML and CSS. But the little bit that they use should then be at least thought-out and be good. If you know different JavaScript frameworks, perhaps also two backend languages, and various programming concepts, you should also know the simple rules of semantics.

JavaScript developers seem to have a problem with CSS, too. On the speakers panel, the claim was made that the problem of CSS was its global nature. In my opinion, this is not just the strength of CSS but simply one of the basic characteristics of the language. Anyone who sees this as a problem should finally learn CSS or leave the work to those who have understood it. The strong applause of the audience for my reply makes me hope that the attitude of the colleague among the developers is not very popular.

Unfortunately this attitude against CSS is popular among many coaches and authors. Again and again I stumble upon articles that see the global impact of CSS as a problem. My point is clear: Learn CSS and deal with architectural concepts like BEM or SMACSS! Then it is clear how to create large pages and also Single Page Applications.

CSS is no programming language and it shares no concepts with them. CSS was created for designing a page. And because it is crucial for a design to have global rules, CSS has a global nature. You cannot think in CSS in same way as you do in JavaScript. It is another world. The same vice versa. So please, JavaScript developers, get the right tool and mindset to work with CSS or get out of my way. I would do the job for you, if you don’t mind.

It irritated me, too, why the colleague is so eager to mix HTML, CSS and JavaScript as possible in a file. For far more than a decade we’ve been told that it is very bad idea to mix PHP with HTML in many `echo`-statements. PHP and HTML should be separated. I absolutely agree. But why should this separation now no longer be good enough for JavaScript? The interesting thing is that more and more backend developers are discovering their love for JavaScript. Why do they simply leave their best practices behind? When separating the three layers, it is also easier to give HTML and CSS to a developer who is and wants to be familiar with it.

I wish that trainers and authors in the area of ​​JavaScript have at least good basic knowledge in HTML and CSS. The HTML should not just be spit on the page. The author or trainer teaches with what he writes and says. He should be aware of his responsibility and not promote bad code. We learn from the style of the teachers. And if too often in JavaScipt tutorials, everything is implemented with `DIV` and `SPAN`, this bad style is propagated. Even if HTML is not the focus of the Angular articles and lectures, I expect a minimum of care. The more so since HTML is an uncomplex thing.

Dear colleagues: get hold of yourself and write better code! Show professional pride!

Hacker Noon is how hackers start their afternoons. We’re a part of the @AMIfamily. We are now accepting submissions and happy to discuss advertising & sponsorship opportunities.

To learn more, read our about page, like/message us on Facebook, or simply, tweet/DM @HackerNoon.

If you enjoyed this story, we recommend reading our latest tech stories and trending tech stories. Until next time, don’t take the realities of the world for granted!