6 ms·
C++ is awesome, but I kinda went the other way with my stuff for more flexibility. JavaScript as the main programming language and C++ only for the performance
by ashcairo 13y ago
C++ is awesome, but I kinda went the other way with my stuff for more flexibility. JavaScript as the main programming language and C++ only for the performance and driver access bottlenecks. (More info: http://multiplay.io http://multiplay.io)
- niggler 13y ago"JavaScript as the main programming language" Using node (or the v8 shell directly) javascript is competitive with python or perl for most common scripting tasks
- ashcairo 13y agoThat's really interesting actually. Is JavaScript still considered a scripting language or given it's modern web development application, is it now a fully fledged programming language?
- Joeri 13y agoThe thing i've always found weird is how javascript didn't catch on for windows sysadmin scripts instead of batch files, given that it's been integrated into windows since w2k. People spend a lot of time learning powershell, while the cscript engine exposes the same level of ability in javascript.
- just2n 13y agoI did all of my scripting in Windows in JS. You had full access to COM objects, which means you could do a lot of stuff out of the box. One thing I hated was that it wasn't even fully ES3 conformant (it's jscript), and it seemed not to be maintained. I think they threw out cscript considerations when they built powershell. For me, a simple bash shell or even a jscript REPL would've been preferable. I think my favorite least-known thing about writing simple tools for Windows during my time as a sys admin was HTAs. You had full jscript COM access with a web page presentation that's packaged into something that you can run without opening a browser explicitly. It was awesome building full web applications that could do pretty much any administrative task on Windows.
- TazeTSchnitzel 13y agoHTAs were! I believe the user accounts management screen in Windows XP was actually one.
- roel_v 13y agoIn my experience of the big problems is that it's so hard and inconvenient to call other programs and capture/process or print-to-stdout (as required) its output from WSH (javascript or vbscript). Also, if cscript had been the default WSH handler (rather than wscript), that would've made it much more like batch files. It's in the details - I tried for years to switch to WSH over batch files, but each time it's those little annoying things that make me switch back.
- 16s 13y agoI think many sys admins thought of js as a web technology and back during w2k, systems and the Web were considered totally unrelated and many systems guys were dismissive of the Web. Things are much different today.
- ErikCorry 13y ago"javascript is competitive with python or perl" Well they are all three terribly designed languages, but JS is way faster and probably more secure: It's battle tested in environments where the assumption is that the attacker controls the code being executed, which is normally not the case on the server side. On the other hand, JS does not have anything like perl's tainted strings, which are a great security feature IMO.
- just2n 13y agoOne of my first languages was C++. I cut my teeth on Bjarne's book. These days, I'd much prefer seeing C fill such a perf-specific role. I can't stand C++, and I've read through some massive, and what most people would call "well written" code bases in C++. Every one is its own world of WTFs with abuse of templates and operator overloading and weird RAII and scoping strategies. I can never read code in C++ and really understand what's going on until I've made a cursory pass, identified everything that semantically changes the meaning of the code and internalized that. That's incredibly frustrating considering readability is paramount in really any project, but especially when the code base is tens of thousands of lines. And given that I've never seen a real world example where these features have actually provided any benefit other than terseness, I can't understand why anyone would ever use them. Outside of the IOCCC, I haven't had trouble reading C except things that abuse the preprocessor, and that's frowned upon. So why not C?
- tsahyt 13y agoI never really understood why C gets such a bad rep for readability. It's a very compact language, just having a couple of keywords and a few very fundamental concepts. There's no "guessing" what a line does, no "obfuscation by design", etc.
- PommeDeTerre 13y agoI've mostly seen the anti-C-syntax attitude come from two communities. The first is made up of those who prefer Pascal and Pascal-derived languages. The second is the Ruby crowd. The Pascal community was most vocal in the 1980s and 1990s, but has since dwindled in size. Today, it's often the Ruby community that's most vocal, and they are often very loud, indeed. Curiously, we don't really see this attitude from the Python community nearly as much as one would expect. I'm not completely sure why this is, but it may be due to many Python developers having extensive knowledge of C and the various languages influenced syntactically by C (C++, Java, C#, Objective-C, and so forth). Due to their breadth of knowledge, different syntaxes just aren't an issue worth getting upset about.
- 13y ago