Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×

Comment Re:This is not a mindshare battle...at all (Score 1) 319

> Javascript, despite it's popularity, is a terrible language. It's popularity is due to one thing, it is embedded in the browser.

A devil's advocate may answer that if JS were that terrible, it and the browser and the web (or Web 2) wouldn't have taken off. But this also offers no proof or reason.
Admittedly there's lots of dislikeable parts of JS, but we probably agree that for whatever reason it happens to be one of the most popular languages ever.

> There's a 4th reason that gets tossed around that I've never seen actually validated with the idea of "reusing code on the backend and the front-end" but I've never seen a case where that was actually a good idea since it involves exposing so much logic.

I don't understand 'so much logic'. You need to validate user input in the browser (with 'logic') to avoid server round trips for common errors; but you also must validate data on the server side, because you can't trust the incoming POST/PUTdata (it may come from a malicious agent). Why would you program the validation twice? The same goes for aggregations, filtering, sorting, utilities etc. - not to mention prerendering the page on the server side for faster initial load or some other purpose (SEO optimization).

> On the frontend, yes, Javascript everything...because you have no other option. That's like saying black was beating green for mind share with the Model T Ford.

> On the backend, you have Java, Go, .NET, Ruby, Python, PHP, Clojure, Groovy, Erlang, Perl, Scala...all of these languages exist with different benefits and different trade offs.

So instead of a zillion competing options with various tradeoffs, just pick the language you already use anyway (JS), which also has various tradeoffs, with the big plus that you don't introduce a language chasm along arbitrary technical boundaries such as some length of wire between a data center and the user.

Comment Re:That's where Vaadin enters the picture (Score 1) 319

One can find an interesting niche project for anything... but probably the analogous meteor.js (as in Javascript) has a larger community. It may be to do with social reasons; the JS world could remain nimble while the Java world has matured, consolidated, slowed down and lost its coolness as well as edge. By now, those Java folks who were more ambitious, are testing Clojure, Scala or RxJava.

Comment Re:Can someone explain node's supposed speed (Score 1) 319

> Node is slower than a modern typed VM like the Java on the JVM or C# on .NET. Let's get that out of the way right now - Java is faster than Javascript. The reason is that Javascript source lacks a lot of info needed to efficiently map it to machine code, so V8 and other fast JSVM's all have to rely heavily on speculation. That's a fancy way of saying they guess what the code might do, compile that, and then recompile it again if it turns out they were wrong (or if the code actually changes itself at runtime which is not uncommon for dynamic languages).

I don't think it follows. Both Java and JS use JVM and both need to compromise some performance in the name of safety. Code fragments that are used once won't be optimized and it won't matter. CPU heavy lifting occurs if you operate on larger memory blocks (typically loops or nested loops). One common example is matrix multiplication. If you worked at Google, you may be familiar with how a Javascript array can hold unboxed integers or floats, if the programmer followed common sense and didn't destroy this optimisation by also storing strings in the array (of course you can use typed arrays too in JS...). If the JIT knows the bounds of the array and the element type, why would a Java MMULT be inherently faster than a JS MMULT?

By the way, even if the JIT cannot guarantee e.g. the type of something: the overhead does not occur because the JIT has to deoptimize something. With well written code, the programmer avoids the circumstances that would lead to such deoptimization. Instead, the overhead occurs because the JIT cannot guarantee it in all circumstances, and by extension, when it is unsure, it is obliged to check first. These instructions are typically low level bit tests and the like, and they add instructions, but they don't typically involve extra memory lookups or some other complex thing that would slow down a modern multiscalar CPU. But again, most performance-critical time would be spent in tigth loops running on typed arrays, where memory alignment, cache hits etc. play a more important role than the language, and neither JS nor Java has the type of control over memory allocation or memory arithmetic that C has.

Comment Re:Node.js is server side (Score 0) 319

> assuming Java generally has better run-time performance than Javascript

Java has no speed benefit of any impact over Javascript (e.g. V8). What you propose (node.java) actually exists (e.g. Ratpack); node.js elements such as non-blocking I/O were basically taken, and implemented in Java. Even with this there's no compelling argument for Java, and the developer mindshare and most action is in node.js land. These societal factors easily outweigh the few technical positives of Java.

Java is most commonly used as a simple, synchronous web server, so statistically speaking, JS has the lead over Java (because node.js is non-blocking).

Comment Re:Node.js is server side (Score 1) 319

Why PHP or Perl on the backend, if you already need to use JS on the client, AND you can as well use it on the server?

For it is obvious that the modern web experience requires more and more dynamism, with fluid interactions, and this necessitates JS more and more (though with high bandwidth, low latency and high reliability may come dumber terminals which just receive video streams, but that's another 10-15 years).

Comment Re:Node.js is server side (Score 1) 319

Interestingly, one of the most important but forgotten part about node.js hides in plain sight - it is that it's a NODE.

More traditional architectures have a strong separation of client vs. server. But node.js is already showing some of what it means that it's a node:
- you can write your code once and run it anywhere :-) be it client, server, middleware etc.
- your server may not be just one server: maybe it's a network of servers (nodes), e.g. with functional separation, domaln object separation or partitioning separation
- you already use node.js on the client side (the developer toolchain contains dozens of node.js based tools, like grunt)
- some client/server lines are blurred; e.g. the use of phantom.js for testing or server side static page prerendering
- the Internet of things is a buzzword, but it's coming

So this highlights the strength of node.js and JS in general: while people with a traditional mindset say node.js is just a server which just happens to use Javascript, the implications are a lot more profound. Check out something like meteor.js to see how it allows a reimagination of data flows.

Comment Re:Ummmm.... (Score 4, Insightful) 319

The summary is not about node.js vs. the browser, but Java vs. Javascript.

The main problem with Java (other than the other major problems others listed) is that it's not Javascript:

1. you cannot realistically avoid Javascript on the client side
2. the client side is only getting richer in functionality (look up something like dc.js, crossfilter.js, d3.js, Google apps, mapping, all web apps...)
3. there is benefit to using one language instead of two, if the feature set is comparable: no context switch for programmers...
4. ... and you can use common data validation (on the client: reject/highlight bad user input without a server trip; on the server: 'never trust the client' principle, infosec)
5. ... and common aggregation analytics (allow your user to sort, filter, aggregate data, product descriptions, events whatever) between client and server
6. ... common domain-specific logic, common utilities libraries, DRY principle, no duplicated testing of logic, common development toolchain, we could go on

So the 'they both have their place' isn't quite true for a very large fraction of deployments which currently use Java on the server (and naturally, JS on the client).

Javascript is not 'only so performant', and, as someone else below assumed, JS isn't fast 'because of concurrency'. Most JS is run on V8 or similarly advanced engine, and in my experience the resulting code is about as fast (or slow) as Java execution (single threaded) even if we ignore the most often cited benefit of node.js, which is non-blocking IO. As JS itself is evolving, with typed arrays and the possibility of programming it without generating garbage, WebGL, Web workers, and low level numeric and bit logic functions coming up in about a year, so it'll only get faster. It's unlikely Java will ever have a performance lead on JS ever again.

Using the same language end-to-end is a more powerful argument than 'the right tool for the job' argument, especially if Java's current lead in some specific server side areas (e.g. finance/reliability/type safety aspects, or machine learning) aren't inherently a consequence of the language, just a consequence of a head start in those areas.

So in my opinion there is a strengthening incentive for using one language end to end at the expense of Java.

Comment Re:Continental Europe (Score 1) 149

I'm sure there are _lots_ of people in the Middle East who are also not fond of sharia law, yet something like the Islamic State occurred, and Islamic revolutions resulting in 'fundamentalist' religion-states. Interesting that you seem to starkly contrast modern Muslims who migrated to the West with, your word, 'minorities that live in the middle ages'. I'd have thought that there are all kinds of gradients and influencing channels.

Also, walking in the streets of some of the above mentioned cities, not all Muslims living there appeared very modern muslims, what with their youth forming large, loud obnoxious groups of man-gangs where other pedestrians, especially women do best by crossing to the other side of the road.

Comment Re:Continental Europe (Score 1) 149

> Becoming 'Muslim' is not a fault line. Actually no one really cares what religion you have. Even if you are so brain damaged that you need a religion to have a fulfilled life the - in general more or less atheist - population of Europe tolerates you.

Well, your opinion exhibits the tolerant Western mindset. It is this very mindset that is likely taken advantage of as the Muslim influence is growing unabated, through migration, demographics and propaganda. But mostly, through sitting out the couple of decades before there is majority. If a Western democracy has become predominantly muslim through demographics, or at least very large parts of it, what's going to stop electoral wins and eventually Sharia law? Just asking. So it's not _your_ tolerance what matters (in fact it's an enabler more dangerous than terrorism) but what the other side does with it, and IF the other side has a very strong agenda, then this will inevitably bias the whole system.

But, while being eaten alive by other worlds, the First World and Western culture preoccupies itself with internal fighs, such as Russia against Ukraine, UK immigration intolerance toward E-Europe, Russia against Nato and the US etc. When democracy, girls' education and women's rights will evaporate, all these shortsighted frat bullyings will be obvious in retrospect.

Comment Re:Continental Europe (Score 1) 149

Most Hungarians borrowed in CHF. Had Hungary adopted the EUR in time, people would have borrowed in EUR rather than CHF (it had only marginally higher interest rates than CHF, and there is natural bias toward a domestic currency if conditions are not too far). Also, debt repayment would have occurred in the same currency. So the timely adoption of the EUR woulnd't have been detrimental or against the interest of the population; on the contrary, it would have served the country better. Yes the current government did its best to eliminate the CHF exposure and famously hedged all domestic CHF debt weeks before the Swiss central bank let go of the exchange rate. You're right about Orban's success in taking the country out of the high risk debt the Socialists irresponsibly built up.

Comment Re:Continental Europe (Score 3, Interesting) 149

Though to be fair, Russia is doing its best to write itself out of Europe... well probably there are trains to Sweden as well.

What's interesting is how Europe is such a hodge-podge of countries, with almost as many sets of countries as the number of countries:

There is Europe as a continent - but many countries, esp. Russia really behave in un-European ways; some countries have minority land in Europe (Russia, Turkey).

The EU seems to be the biggest ensemble - but curiously, Switzerland, one of the richest countries, is not in the EU and does not appear to bear any of the costs of solidarity and convergence (e.g. helping East Europe catch up); also is absent Norway (also one of the richest countries, and a great oil power); and the UK is on the brink of exiting the EU (and the UK now has a weird anti-Eastern European immigrant stance while it happily accepted immigrants of more radically different cultures and London, like Paris, is becoming a Muslim city). Some countries, like Turkey and probably Ukraine will spend an eternity in the waiting room before being able to join. Iceland just suspended joining talks.

The UK deserves its own section as they are an oddball in many other regards: driving on the left side of the road, using incompatible power plugs, often using imperial units etc. etc. - but more importantly they use terms like "We visited Europe last Summer" as if the UK wasn't even part of Europe. So one of the strongest military powers in Europe is also one of the least integrated (similar in that regard to the Swiss). Germany also deserves special mention due to their strong economy, yet no military power or participation, and the weird stance on nuclear power plants (despite the fact that they are densely surrounded by nuclear power plants). However, Germany is the most important integrating force of Europe, mainly responsible for its Eastern opening.

Then there is NATO; interestingly Norway is in, but Sweden and (more understandably and regrettably) Finland isn't; Switzerland is again, absent (despite having a strong military; again there seems to be a lack of solidarity while they unilaterally benefitted from being a safe haven and from the tax evasion of the rest of the World)

Within the EU, there is the Euro currency; while theoretically mandatory for all countries, this further fragments Europe, along multiple fracture lines:
- Some developed countries (UK, Denmark, Sweden) opted out from the beginning (special treatment)
- Some countries which caught up introduced the Euro (Slovakia, Slovenia, Estonia), but some opted not to (Czech R., Poland)
- Some countries have been unable to meet Euro introduction criteria, e.g. due to irresponsible borrowing of the Socialists in Hungary till 2008

A special place is occupied by Greece - they lied and cheated so they gain admission into the Euro zone. Europe has lavishly rewarded their morals by pouring EUR200Bn into Greece over a year or two. (In comparison, Hungary, which has the same population size but much lower GDP/head and welfare, only got EUR20Bn, i.e. one tenth of that, from EU cohesion funds over around 10 years.) and the Greeks will want more money for their irresponsible behavior. So some of the European fault lines are growing and the Euro zone is about to shrink. But of course Europe doesn't try to offset the loss of Greece by more ambitiously integrating Eastern Europe like Poland, the Chech Republic and Hungary. In fact, Bulgaria, Hungary and Slovakia has been left by the EU to predominantly depend on Russia for energy sources, a BIG mistake with the reversion to Russian imperialism.

Minor redemption is the SEPA (Single Euro Payment Area), which, despite its name, includes a lot of non-Euro, non-EU countries. SEPA's spirit (removing financial friction inside Europe) and existence however doesn't stop a UK bank like Barclays to shamelessly charge a whopping GBP25 fixed fee on each and every transfer (despite electronic, STP) into another SEPA country. Maybe royal remnants like H.M. Beefeaters personally carry the money with custom made black cabs if not horse carriages, for about the same cost Elon Musk will be able to execute an Earth to Mars wire transfer.

There are some other fault lines in Europe, for example, parts of the Balkans (e.g. in Bosnia) and larger and larger portions of the UK, France and Germany becoming Muslim.

Then we haven't touched on Russia which on occasion was a significant contributor to European civilisation, but for them, it's more important to have an illusion of a great power (hey we have nukes like N Korea) and bully neighboring countries, taking from their territory that are at least two orders of magnitude smaller/weaker already, than being part of Europe, prospering with it and seeking what unifies rather than what separates.

No wonder that despite the number and purchasing power of Europeans surpassing US figures, Europe is a wuss when it comes to the international scene. Heck, Europe can't even begin to deal with its own problems, like the Balkans wars, Ukraine and its immediate Middle Eastern neighborhood.

So these are the thoughts when there's talk about Finland's or anyone's connection of Europe; Europe is such a fuzzy and ambiguous term, thanks to ourselves.

Comment Re:O...okay? (Score 1) 134

Openoffice and LibreOffice are a joke. It's hard to describe quality, but simply, they just are significantly worse than what the Evil Empire makes. For some reason, when I start Gimp or Inkscape, they also look amateurish and unpolished - interesting cue, since both are in the realm of visual design.

Slashdot Top Deals

What this country needs is a good five dollar plasma weapon.

Working...