r/javascript • • Jul 28 '15

I'm all in.

Post image
746 Upvotes

120 comments sorted by

51

u/lostPixels Jul 28 '15

In my experience, Flash and Silverlight developers tend to make much better Javascript developers than people who have only done Javascript since the early 2000's.

49

u/voidvector Jul 28 '15

I found most polyglot programmers are able to form better abstractions because they experienced different environments with different features and limitations.

8

u/[deleted] Jul 28 '15

Yeah. Python and JavaScript have made me a far better programmer than ActionScript did alone.

I want to find time to poke at C++ or Java a lot more to get more depth into lower level stuff (while still resembling what I know).

7

u/moh_kohn Jul 29 '15

Learn C. It's much simpler than either and will open your eyes to memory management.

7

u/Auxx Jul 29 '15

Assembler for x86 is easier and will open eyes on everything inside a PC.

15

u/mariox19 Jul 29 '15

Until you've coded a to-do list app using nothing but an abacus, you don't know anything.

7

u/greyfade Jul 29 '15

I made my to-do list app with a slide rule and a compass.

7

u/[deleted] Jul 29 '15

Noobs, my to-do list app consists of pen and paper.

1

u/frenris Oct 02 '15

Actually though, C is both simpler to learn than C++/Java and gives you a better awareness of what the machine is doing. This really isn't a "real programmers use butteflies moment."

1

u/greyfade Jul 29 '15

x86 is an Eldritch Horror (as anyone who has tried to write a memory manager can tell you). Only Itanium has a remote chance of scarring your mind more.

MIPS, SPARC, 6502/6510, 65816, 68k, and even ARM are saner, easier to understand CPUs.

1

u/Auxx Jul 29 '15

Yet writing small tools is easy and fun.

7

u/DarkMarmot Jul 29 '15

01010101010111101010101011010101010110101101011010101011101011010101011011110110

1

u/[deleted] Jul 29 '15

Hm. I was thinking the OO part would make it easier as I could make exercises out of reimplementing things I've done in other languages.

But hmmm. Maybe that would break it up more, keeping it a bit more approachable.

3

u/moh_kohn Jul 29 '15

The trouble is that C++ is a big mess, and Java is a sort of mid-level language - it has garbage collection and all that, the main thing that makes it feel lower level than Javascript or Python is that it uses strict types.

C on the other hand is a genuinely low level language. You still have modules and structs, which give you some OOish abilities.

7

u/SockPants Jul 29 '15

I don't know if learning C++ has really helped me with anything other than using C++. I quite like C# though, it seems like a better version of Java.

3

u/philbgarner Jul 29 '15

I quite like C# though, it seems like a better version of Java.

Yeah I got dragged kicking and screaming into learning C#, and actually enjoy it. :P

1

u/vicarofyanks Jul 29 '15

This is me, I was a Java dude, but got some good opportunities working on .net stack, low and behold I love it

3

u/philbgarner Jul 29 '15

.NET doesn't get enough love, it really is great.

That said, I still prefer a LAMP stack for web stuff. :)

→ More replies (0)

-1

u/Drainedsoul Jul 29 '15

C++ is a big mess

Citation needed.

1

u/frenris Oct 02 '15

C would have less parallels. The fact it's missing all sorts of OO parts though is what keeps the language simple. It's much easier to develop an understanding of all the C keywords than in Java. Or god forbid, C++.

2

u/aaulia Jul 29 '15

And by ActionScript I think you meant AS2 ? Cause AS3 is pretty dope.

2

u/[deleted] Jul 29 '15

AS3. It was nice.

7

u/[deleted] Jul 28 '15

I just started a JS job after 7 years as an AS3 dev. The transition has been pretty painless.

I love Flash and AIR. But the well is dry. I'll still tinker at home with them for fun though.

1

u/[deleted] Jul 29 '15

Same... still there are plenty of things I miss about Flex like creating quick UI's of any type without having to strangle CSS for hours.

1

u/umilmi81 Jul 29 '15

I got a job as an ASP web developer after being a Unix and Windows application developer for 15 years. I hadn't used JavaScript since it was called LiveScript.

I was shocked at the conventions used. Anonymous functions and single letter variables like "a", "g", and "s" are not only commonplace they are encouraged.

I learned to write self documenting code. Descriptive variables and function names. I tried to buck tradition and declare functions but jquery and knockout are built specifically to use anonymous functions so I have to jump through extra hoops to use them.

I really see the power of JavaScript, but I'm just having a hard time making the transition from a traditional language.

5

u/vexii Jul 29 '15

you only see single letter variables in minified code (i hope)

1

u/umilmi81 Jul 29 '15

Google Analytics and Adobe Omniture both use single letter variables in their example code. I could rename them but again it seems common practice in the industry so I keep the same names.

8

u/vexii Jul 29 '15

i dont know the adobe thing, but GA is just the snippet to paste for analytics.
it common to see single letter variables in most code that gets delivered as "don't read it, just paste it" snippets.

no one writes code like that, we use tools to transform/minify the code after (and use source maps if we need to reverse it)

2

u/[deleted] Jul 29 '15

jquery and knockout are built specifically to use anonymous functions

BS, just because a lot examples (and sadly also a lot of real code) don't name their functions, that doesn't mean it's "build specifically" to use it that way.

No lib I know off encourages, or even enforces, the usage of anonymous functions.

And if you'd ask me, or anyone who'd ever needed to debug js code that's a bit more complex, you should name all your functions.

14

u/[deleted] Jul 28 '15

That's because the only way to do anything interesting on the Web in the early 2000s was flash. JS was pretty much just used for form validation and whatnot back then.

7

u/boompleetz Jul 29 '15

Exactly, if you wanted to make a RIA, Flash/Flex or Java was the way to do it. I was really resistant to moving over to JS, since AS3 had all the goodies I like with a class-based OO language. JS was a toy language for gluing AJAX calls to UI at best.

But then all these engineers flooded the JS world and now we have mature frameworks, automated testing, ES6, transcompilers for strict typing, polymer, build tools, and I love it. Even though I'll complain every time there is something new, I do get a kick out of the variety.

5

u/warfangle Jul 29 '15 edited Jul 29 '15

Funny, as a JS Dev I thought the same about flash - it was just a toy language for animating stick figures killing themselves. It was the worst parts of JS combined with the worst parts of Java all smushed together in the worst goddamn build environment I've ever used.

Ever try to automate unit testing of an AS3 project that wouldnt build right without Flash.app?

I'm not bitter about AS3 stealing two years from my career... Not at all.

3

u/boompleetz Jul 29 '15

My worst memory was the CS version upgrades. Adobe continually strove for feature bloat, while breaking more basic features that worked. So if you opened an old project with the new version, it was like russian roulette whether previous apps would go to shit.

One example was between CS3 and CS4, some undocumented bug with font formatting. Opened up an existing project after upgrading and half the text fields no longer rendered. This was before Stack Overflow had been created or became big, so it was much more painful crawling through "evangelist" blogs and Adobe forums for a reason. We wasted hours debugging only to find on their forum somewhere that it was a bug in CS4 itself.

4

u/bradgillap Jul 28 '15

All we had back then were applets that could simulate a water reflection from a photo dammit.

1

u/menno Jul 29 '15

That's not exactly true. Functionally, browsers could do almost everything that they can today it just took a lot more effort. In 2002 I worked at a company that was already building a social bookmark manager with real-time sharing, chat, drag&drop and a responsive design. It was buggy and hard to maintain but it mostly worked.

2

u/dada_ Jul 29 '15

With the possible exception of people who never moved to AS3 once that rolled around. AS2 permitted absolutely hideous code and silently failed everything that didn't work.

1

u/lostPixels Jul 29 '15

This is true, AS2 reminds me of JS before the more recent ECMAScript versions.

1

u/thebuccaneersden Jul 29 '15

There are people who have only done JavaScript since the early 2000's?????

I don't believe you.

2

u/menno Jul 29 '15

I'm one. Started doing webdev professionally in February 2000 doing front-end work almost exclusively. Dabbled in PHP for a few personal projects. Never moved on, because I love making beautiful UIs.

0

u/[deleted] Jul 29 '15

[deleted]

1

u/menno Jul 29 '15

What's this "more advanced" stuff you speak of?

0

u/[deleted] Jul 29 '15

[deleted]

6

u/menno Jul 29 '15

Just because Phil Collins started singing when Peter Gabriel quit Genesis doesn't mean all drummers eventually become lead singers.

1

u/[deleted] Jul 29 '15

[removed] — view removed comment

1

u/menno Jul 29 '15

You have no idea. Witnessing the popularity rise of front end development has been incredible. People called me crazy for years when I said I just did front end. It wasn't even a profession, let alone a career.

Well, considering I'm still doing the same thing more than a decade later they were kinda right about the second. No ragrets.

-2

u/xXxdethl0rdxXx Jul 29 '15

Top comment ITT mentions that their agency now uses AngularJS so I'm not too sure about that.

34

u/sunburned_goose > 0; Jul 28 '15

I went all in with Silverlight for several years, before HTML5 was a reality. It was a bridge that served its purpose well until we moved to AngularJS two years ago.

39

u/evertrooftop Jul 28 '15

By the time silverlight came around, it was already easy to create very rich javascript-based web applications.

If were talking about flash and 5 years earlier, you had a point... but I don't think there was ever a reason to do silverlight, unless you wanted to use their video components or heavy animation.

8

u/sunburned_goose > 0; Jul 28 '15

In Chrome, sure, maybe even Firefox but not in IE. SL filled that gap until we had enough features in all browsers, or polyfills to make IE8+ a feasible solution.

7

u/evertrooftop Jul 28 '15

fwiw we made pretty rich js-heavy applications, supporting IE6 (later making IE7 the minimum).

What kind of polyfills and features did you have to wait for?

4

u/sunburned_goose > 0; Jul 28 '15

I don't recall. I remember bi-directional communication being an important feature and websockets were not available. We could hack it in WCF with SL4 I think... It was also helpful for us to be able to write once and have it look great on Mac and Windows, regardless of browsers. A lot of developers were able to transfer their C# and NET skill sets into the SL platform. We were able to interop with products through COM interop when running out of browser (was hoping that would make it to MAC's scripting environment).

These are just some of the reasons why we went this path. I have no doubt you could make JS rich applications with IE6 & 7, but there was also a lot of effort being put into making those platforms work well with Chrome & FF. There was a lot of appeal in getting the same experience regardless of browser. We get that now (looking at you safari) with pretty good implementations across modern browsers.

1

u/evertrooftop Jul 29 '15

Long polling was an option for a long time, but I can totally see that being able to use existing skills can make for a good reason to pick silverlight at that time.

-2

u/dhdfdh Jul 28 '15

IE always needed gap filling. Still does.

1

u/karneisada Jul 29 '15

The current IE is actually pretty good.

1

u/dhdfdh Jul 29 '15

1

u/karneisada Jul 30 '15

I'm talking about Edge which is ahead of Safari and catching up at an astonishing rate. Hell Edge has as much ES6 implemented as Chrome last I checked. I'm an outright Microsoft hating Unix fanboy but IE has come a long way.

2

u/dhdfdh Jul 30 '15

You said IE, not Edge. Edge is virtually even with the current version of Safari. When you consider Edge can only manage to pull even with Safari, and still be miles behind Chrome and Firefox, that's not much of an accomplishment. And the next version of Safari is about to be released soon, too. Where will that leave Edge? The same place IE always was, bringing up our rear ends.

but IE has come a long way.

I've been listening to that crap from every disappointed IE supporter since IE7.

0

u/Paupir Jul 29 '15

The payoff here is that IE is quite fast and smooth and tends not to wolf down your ram like Chrome and Firefox. The dev tools are a lot better than they used to be too.

I'd like them to support Service Workers and Web (Install) Manifests, maybe even with some (proprietary?) API to make use of Live Tiles. That would be so cool.

Anyway, it's worth watching that space (as I've done with Firefox since I left it for Chrome), just to see.

(PS. Interested to see where Mozilla takes future Firefox with the announcement of potentially moving away from XUL and into open web technologies.)

0

u/dhdfdh Jul 29 '15

The payoff here is that IE is quite fast and smooth and tends not to wolf down your ram like Chrome and Firefox.

And it can't do anything those others can either.

The dev tools are a lot better than they used to be too.

Being better than shitty is nothing to brag about.

I'd like them to support Service Workers and Web (Install) Manifests, maybe ...

You're proving my point about how crappy IE is.

0

u/Paupir Jul 29 '15

And it can't do anything those others can either.

That vast hyperbole. It can do a lot of what the others can do (particularly concerning Edge which is as good as out now). If you're developing for current IE, chances are you're including polyfills for certain things anyway, because it will have only been recently that the other browsers received them.

Stop hating it because you think it's cool to hate.

Being better than shitty is nothing to brag about.

Yes it's nothing spectacular if that's what you're trying to say. It's software. It works. Has much of what you'd expect to find in dev tools even when you're used to Chrome. It's even pretty.

You're proving my point about how crappy IE is.

Haha. Service Workers are still brand new and the cache API that compliments it still needs polyfills in Chrome, actually. That part was just me hinting at Edge working like the WebViews you get on mobile, but where the internet is your marketplace.

I'm sorry if you think you're too hip to think IE/Edge can ever be a good browser. In the meantime, I'll happily concede that they've made great amounts of improvements and am looking forward to more.

0

u/dhdfdh Jul 30 '15

chances are you're including polyfills for certain things anyway

If you're using polyfills, chances are it's to get things to work in IE. Quit blowing smoke. Almost every hack and polyfill is created to fix IE. Been that way for a decade.

Stop hating it because you think it's cool to hate.

I started questioning the capabilities of IE when I was first introduced to Firefox version 0.8. Obviously you didn't look at or understand my earlier link. IE can't hold up to any other browser. Known. Proven. Verifiable.

Yes it's nothing spectacular if that's what you're trying to say. It's software. It works. Has much of what you'd expect to find in dev tools even when you're used to Chrome. It's even pretty.

That's the first time, EVER, that I've ever heard anyone say that about IE dev tools. Which tells me everything I need to know about who I'm communicating with.

Service Workers are still brand new

Yes, and yet, ServiceWorkers works in Chrome and Opera but will NOT work in IE or Edge where Microsoft is only "considering" it. And that's the horse you're trying to ride?

I'm sorry if you think you're too hip to think IE/Edge can ever be a good browser.

I've been hearing that crap about "the next version will blow [insert browser here] out of the water!!" ever since the announcement for how great IE7 was going to be. And then I've had to listen to people like you who can't read facts to find out how wrong they've been up to and including Edge.

→ More replies (0)

20

u/I-fuck-horses Jul 28 '15 edited Jul 29 '15

This is silly. Even a "few" years ago any sane person was able to deduce that proprietary technology had no chance - given that neither Adobe nor Microsoft managed to get any big partners, so they stood all alone. On the other hand, even a decade ago the mounting Javascript avalanche was pretty much clearly visible.

I for example had the exact same decision to make - and for me it wasn't just between the "web languages". I have a strong background in backends, large databases, clusters etc. - and I gave that money pit up going for the web platform. Deliberately - and I looked at nothing but Javascript and it was clear to me that on the server too that language would come to much more power, long before node.js was even out. It was obvious where the future lies. And it wasn't a monetary decision - I just find the web as platform much more interesting. And since Javascript on the browser was unbeatable, period, it was equally clear it would come to the server - the big guns in the business would not have a platform where you need a wild range of very different languages in the same system.

Note that "but web programming sucked" (I refuse to even talk to people who still have no idea how incredible a functional prototypical language is and claim "it still does"; the entire platform though had and has enough issues) is not an excuse. The contenders were not better.

It is NOT all random. Especially not in this case.

5

u/[deleted] Jul 29 '15

So is there anything else on the horizon that seems to be the next big thing?

4

u/mariox19 Jul 29 '15

Plastics.

0

u/[deleted] Jul 29 '15

[deleted]

9

u/Klathmon Jul 29 '15

Map(), Set()

Also if your application is limited by the performance of the data structures then don't write it in JS. (Unless you are just assuming it won't be fast enough, in which case actually test it first!)

Use the tool that's best.

0

u/[deleted] Jul 29 '15

[deleted]

2

u/spinlock Jul 29 '15

It's too bad you can't extend js in c or something. When I want a really tight loop in ruby, I'll write write the function in c and compile it into ruby. That way you can optimize the code that needs it and still have the rest of the app written at a higher level.

1

u/Klathmon Jul 29 '15

You can on the server side, browser side is getting there.

With ES6 features like set, map, and typed arrays (basically near-raw memory blocks) you can get pretty insane speed from the browser too.

1

u/spinlock Jul 29 '15

I'm just upgrading my ember app to ES6 but its transpiled down to ES5. Won't that kill any performance?

Also, I've never had an easy time maintaining custom functions when I control the server. I can't imagine how had it would be on someone else's browser. But, hey, who doesn't like a challenge :)

2

u/Klathmon Jul 29 '15 edited Jul 29 '15

Yes and no.

Most JS engines will already use the same "backend" for stuff like Map and Set of you ONLY stick to some of those features, so by letting the features enforce it, the transpiler can generate code that helps "hint" the VM about what you are doing so it can choose the best underlying tech and get the best performance.

On the other hand many new ES6 features are very slow right now because they are "not optimized". Scroll down to the list of unsupported syntax here to get an idea of what will cause slower JS code, then review your transpiler output every now and then to see if any of those are creeping into your code.

2

u/spinlock Jul 29 '15

Thanks. I'll keep that in mind.

1

u/Klathmon Jul 29 '15 edited Jul 29 '15

Well its much better today.

Also add in typed arrays and buffers in the browser as well. They are stupid fast when used correctly.

Also don't just assume that the data structures in JS can't keep up. It might take a bit more knowledge of how the underlying VMs work, but with some tuning its possible to get pretty damn fast speeds from normal JSON objects or arrays.

The VMs will do their best to use underlying performant structures when possible.

2

u/inspired2apathy Jul 29 '15

Wow, good to see things have gotten so much better. I still don't particularly care for the various JS inconguities/gotchas, but it's much more feature-complete than it used to be.

1

u/Ehdelveiss Jul 29 '15

I thought this was the purpose of JSON? Or am I misunderstanding?

5

u/jkoudys Jul 29 '15

You are, a little. There's two basic datastructures that nearly every js app is going to use: the Array, and the Object. An array is a little closer to its classic definition than, say, PHP's array is, but it's far from what an "array" is in C, and meant in general to represent any mutable dataset ordered by index. An object, conversely, has no predefined order, and it's just a hashmap (this is what JSON -- technically a separately defined format -- loads as). Even if you have an object {a: 'foo', b: 'bar', c: 'baz'}, it technically has no order, and without logic around it to enforce the behaviour, you can't rely on property "a" coming before property "b".

If you're in a language like C or Java, much of the syntax and libs are dedicated to defining data structures based on their low-level behaviour. The syntax in JavaScript is focused more on high-level behaviour: the logic that your datastructure should follow as observed by those calling it. So as a JavaScript developer, you can look at a fairly complex dataset defined in JSON, but it's not necessarily optimized to run very quickly for what you're doing.

I am noticing that this is changing quite a bit. In addition to the upcoming harmony datastructures /u/Klathmon mentions (Map and Set), there have also been TypedArrays out for a while. These look more like traditional arrays, which simply define an extent (over an arraybuffer), and then the Unit8Array or Float64Array, etc. you define simply defines how to iterate it and compute offsets within the buffer. I'd recently started using it to do some low-level work in rewriting a gameboy emulator as modern es6 JavaScript with ReactJS, and these TypedArrays were perfect for modelling a memory space with 8-bit registers: https://github.com/jkoudys/ReactGB/blob/master/js/utils/emulator/z80.js#L43

All that said, the v8 engine and its JIT can be downright magical, in both the best and worst possible ways. Sometimes it figures out exactly what you mean when you setup a more complex datastructure, and other times a tiny change takes efficient processing down to garbage. Probably the worst thing for it to figure out is in pruning trees and removing nodes -- downright trivial on a good C implementation, with simple pointers, but taking a large array (or even object) and deleting nodes can confuse the hell out of v8.

1

u/Ehdelveiss Jul 29 '15

Thank you for your detailed reply! That helps me understand much better :)

0

u/thebuccaneersden Jul 29 '15

asm.js

1

u/inspired2apathy Jul 29 '15

But now it looks like it'll be WebAssembly instead.

4

u/[deleted] Jul 29 '15

And now we get to bet on frameworks. Plain Javascript, Angular, React (+ 100,000 more)

3

u/[deleted] Jul 29 '15

I had doubts on silver light the day it was released. It had great video streaming but thats it.

3

u/smokinJoeCalculus Jul 29 '15

Today I learned that SilverLight wasn't just some sort of proprietary video playing library.

1

u/[deleted] Jul 29 '15

Yea it was supposed to be a flash substitute, but it came so late to the game no one wanted to re-learn everything. It had an amazing video streaming system though, with auto quality degradation which made it very handy.

1

u/invalid_dictorian Jul 29 '15

I enjoyed watching NBC's 2008 Olympic web casts. I believe it was Silverlight based. That was pretty amazing for 7 years ago.

10

u/Spifferiferfied Jul 28 '15

Said no one ever.

0

u/[deleted] Jul 28 '15

[deleted]

4

u/c4a Jul 29 '15

It was pretty much the only option for them at the time.

3

u/ryosen Jul 29 '15

Netflix used Silverlight because it had tighter DRM controls, which was a requirement placed on them by the movie companies. It also streamed video better and at higher quality than Flash. It wasn't their first choice, especially as it limited the platforms that they could reach.

0

u/Spifferiferfied Jul 28 '15

But in the scenario of this comic, how is JS going to help them?

-5

u/[deleted] Jul 29 '15

Netflix is running Node now :D

10

u/Disgruntled__Goat Jul 29 '15

Huh? Those are two completely different things. Node doesn't do video and Silverlight doesn't do server-side programming.

4

u/Nategeier Jul 29 '15

@solarparade was just a commenting about how they are now using JavaScript on the back, not comparing Node to Silverlight.

1

u/Disgruntled__Goat Jul 29 '15

Their comment, in the context of replying to the comments above and in this thread, was saying Netflix have replaced Silverlight with Node.

2

u/lostPixels Jul 29 '15

NodeJS is a server-side language.

0

u/[deleted] Jul 29 '15

[deleted]

1

u/lachlanhunt Jul 29 '15

A lot of video streaming services use silverlight for the DRM. I currently work for a company that does. It sucks, but they still haven't prioritised switching to HTML5 video despite being forced to drop support for Chrome on Windows a few months ago, and Chrome on Mac last year.

2

u/Nategeier Jul 29 '15

Almost lost it relating to this. I was a Flash dev in its boom days. Bought the first iPad and knew it would never work out the first few weeks of having it. I then threw all in transitioning full flash and PHP enterprise learning management system apps to Node 0.6. Now that was a gamble.

2

u/WatchDogx Jul 29 '15

I never even installed the plugin in all this time, let alone decided to write something with it.
Seemed like a pretty obvious bad idea at the time.

1

u/morphotomy Jul 29 '15

Yea I remember there was like one video site back in the day that required silverlight. Never used it, and never installed the plugin.

1

u/sunburned_goose > 0; Jul 29 '15

This makes me wish I kept all that JavaScript I wrote in 2002 for Netscape Enterprise Servers and their SSJP's. There was some fine 'class-like' work done then for a content management product.

-2

u/Paupir Jul 28 '15

I don't understand why this comparison is made. It's not JavaScript specifically that won, it's the web platform. It just so happens that the standard language for the web is JavaScript.

Flash, Silverlight, Open Web. These 3 are comparable.

ActionScript, A .NET language, JavaScript. These 3 are comparable.

7

u/alamandrax Jul 28 '15

I think this is more of a mean-spirited joke (read circle jerk) rather than an accurate representation of the language/tool.

It helps me pat myself on the back for pushing my company into going all in on JavaScript as opposed to the other company that I got an offer from that wanted to go all in on Flex.

1

u/Paupir Jul 28 '15

Yet you hear people making this comparison as fact- particularly when HTML5 was a bigger buzz word. Then the more simple minded consumers start repeating it and people get confused, thinking JavaScript === application framework. All "Dude, JavaScript is so slow! It lags my browser so much!" because they're thrashing the DOM or something.

Someone has to point out the difference, especially when many inexperienced/young developers come to this subreddit. It's like when an employer is interviewing a potential employee, they ask what languages they know and the reply is "I know jQuery!".

1

u/alamandrax Jul 29 '15

It's a frustrating experience for sure; but I think of it as being similar to telling my parents what I do and why I get paid as much as I do. They are impressed by the numbers involved but clueless as to how there is any complexity in what I do.

1

u/ryanhollister Jul 29 '15

have you ever visited /r/jquery ? "I need a plugin ..."

0

u/[deleted] Jul 28 '15

[deleted]

5

u/sgoody Jul 28 '15 edited Jul 28 '15

How did that work out for you? Was it Symphony?

I'm quite a fan of XSLT, even though that's an unfashionable opinion now.

EDIT: Symphony rather than Symfony.

4

u/lechatsportif Jul 28 '15

Agreed. It's power was never really appreciated.

2

u/NoddysShardblade Jul 28 '15

It was powerful, just undebuggable.

Yet I still see XSLT on job ads and resumes these days...

2

u/lechatsportif Jul 29 '15

This is fair. "You have to be able to debug at the level of abstraction". This was something a lot of xml technologies never got quite right.

3

u/jkoudys Jul 29 '15

Academically speaking, XSLT is absolutely fantastic. The entire concept suffered purely because of poor implementation, and a lack of casual users. I'd tried a couple years ago to rewrite big parts of my CMS's templating into XSLT. It sounded like a simple idea in theory: it was an MVC CMS, and it already had controller logic that was setting a bunch of variables in the controller, and rendering them all in simple views. I'd just build a DOMDocument instead of setting those variables, then apply XSLT to it.

I still think it should have been that easy, and nothing about the basic concept of XML/XSLT should have prevented that, but in practice it was ridiculous. Every damn element, namespace, and parser had some absurdly strict requirement against it, and if you didn't have the exact-right character encoding on the exact-right element, with a perfectly-defined, 300 character root element, use a bunch of undocumented arguments on your parser, and covert back and forth in the same block from a DOM to a string just to concatenate some XML string elements into it (because your lib doesn't support html5 -- wtf?), you'd be met with an incomprehensible pile of very alarming, completely not-helpful errors.

I spent 3 weeks working 14 hour days, and at the end had nothing to show for it, but I still don't think it was a waste of time. The basic concepts are excellent and I really learned a lot about templating, even if it was completely a theoretical exercise as the actual implementations were all terrible. It really helped me see why good templates ought to be compositional -- the big push in XSLT land is away from filling templates with branching control-logic, and instead define templates as composed of templates composed of other templates.

This is the same approach taken in my favourite templating lib, ReactJS, except that instead of having an XML tree which renders via a bunch of XSLT templates, you have a state (usually a JS object) that rendersvia a bunch of ReactJS components. If you use JSX, then React is even XML-ish, too. They basically took out everything that made XML/XSLT suck, and built an awesome system that is everything XML/XSLT aspired to be.

3

u/[deleted] Jul 29 '15

Yep, it was Symphony. The big-picture architecture of Symphony is great, but using XML and XSLT is just not really necessary in this day and age. There are (or could easily be) simpler declarative templating layers. But the concept of clearly defining the semantic data layer from a declarative presentation layer is brilliant, and I wish there were similar systems using simpler DSLs.

It worked out well until I decided to leave the company, at which point they promptly switched to Wordpress, since they had no chance of finding a decent XSLT developer.

3

u/aequasi08 Jul 28 '15 edited Jul 28 '15

Symfony isnt a CMS

edit: downvoted for correcting someone? Stay classy.

7

u/sgoody Jul 28 '15

Had a feeling I'd get the spelling wrong I meant Symphony

2

u/Randolpho Software Architect Jul 29 '15

Oh, god the flashbacks. Why??!? Why be that cruel?