Programming language popularity trends

C is used on every consumer desktop (not just Windows, but Mac OSX, Linux and BSD variants included), and is used on likely on every server that serves a website.

So now that we are proclaiming things. C is used more places than Javascript. Some Javascript interpreters are probably even written in C.

A very valid claim. I agree. C is a bit old school though, don't you tihnk?
 
How does that work safely?

There are some nosql database solutions that use javascript exclusively. CouchDB is one of them. You set your values as json and it also returns json.

Everything is done through http requests. It's no less secure than a typical mysql setup once it's setup properly.
 
A very valid claim. I agree. C is a bit old school though, don't you tihnk?

There are still a lot of positions today that require C knowledge, especially when dealing with embedded systems. C is also the basis of lots of system level software, and it makes things like JVMs and web browsers possible.
 
How does that work safely?

There are some nosql database solutions that use javascript exclusively. CouchDB is one of them. You set your values as json and it also returns json.

Everything is done through http requests. It's no less secure than a typical mysql setup once it's setup properly.

Good question. Certainly not the safest sounding. I never implemented them myself, but yeah, you set things to white list the stored procs. It's just one less layer of protection than normal web pages.

Actually, it's probably more secure than 50% (my guess) of web sites out there, because at least you know you have to nail it down tightly. No false assurances. There are way too many out there that think their database is safe by virtue of sitting behind some server side programming.

There are still a lot of positions today that require C knowledge, especially when dealing with embedded systems. C is also the basis of lots of system level software, and it makes things like JVMs and web browsers possible.

pheww, I write my code in Binary. Assembly for relaxation time. :p

Seriously though, has C replaced almost all need for assembly?
 
Good question. Certainly not the safest sounding. I never implemented them myself, but yeah, you set things to white list the stored procs. It's just one less layer of protection than normal web pages.

Actually, it's probably more secure than 50% (my guess) of web sites out there, because at least you know you have to nail it down tightly. No false assurances. There are way too many out there that think their database is safe by virtue of sitting behind some server side programming.

While you can have client-side JS talk to the DB directly (I wouldn't) - it's worth nothing that with CouchDB and MongoDB, JS is, in fact, the actual query language.
 
Good question. Certainly not the safest sounding. I never implemented them myself, but yeah, you set things to white list the stored procs. It's just one less layer of protection than normal web pages.

Just because you're making an http request doesn't mean you have to be doing it through the browser. The client has no knowledge of where you're hosting the database (it could be on localhost, another computer on your network, or on a cloud somewhere) and it doesn't know how your db is setup. This information is simply never exposed to the client.

Even if they somehow figured out where your db is hosted and the database name along with all sorts of other "uh oh" information you can still stop them from doing anything with the db.
 
Just because you're making an http request doesn't mean you have to be doing it through the browser. The client has no knowledge of where you're hosting the database (it could be on localhost, another computer on your network, or on a cloud somewhere) and it doesn't know how your db is setup. This information is simply never exposed to the client.

Even if they somehow figured out where your db is hosted and the database name along with all sorts of other "uh oh" information you can still stop them from doing anything with the db.

Well, I'm thinking about SQL injection. It doesn't matter where it's hosted. Location is irrelevant. But yeah, it's one less layer and more surface area. Heh, I'm speaking from experience... in my newbie days I got SQL injected. :eek: Definitely affects how you approach things going forward. ;)

I never actually implemented javascript querying nor have any plans (at least in the short term) to do so, but it doesn't sound horrible, especially if the database is read only anyways without any sensitive info. Obviously, user login info should probably go to a separate database in such a case.
 
Well, I'm thinking about SQL injection. It doesn't matter where it's hosted. Location is irrelevant. But yeah, it's one less layer and more surface area. Heh, I'm speaking from experience... in my newbie days I got SQL injected. :eek: Definitely affects how you approach things going forward. ;)

I never actually implemented javascript querying nor have any plans (at least in the short term) to do so, but it doesn't sound horrible, especially if the database is read only anyways without any sensitive info. Obviously, user login info should probably go to a separate database in such a case.

I think we're on the wrong page still.

I think you're thinking along the lines of:
"Wtf javascript queries, he can just download my site and then remove mysql_real_escape_string() and then inject anything he wants, omg that's retarded!11!".

You're not querying with javascript in a mysql query sense. The way you query stuff in couch is by setting up views in the database that use map/reduce (written in javascript) which are stored in the database itself. The database is also not read only (well it can be if you want but if your goal is to store data it has to be able to write).

It's perfectly safe to store sensitive information. Like I said before nothing is exposed to the client (the user of your web site). The only one issuing requests to your couchdb server is your web server, in which case you have complete control over what gets sent to the client (in most cases this is the data that couchdb returned).

When I said it exclusively used javascript I meant:

1. When you receive data back from it, it's formatted as json.
2. When you send data to it, the body of the request must be formatted as json.
 
Seriously though, has C replaced almost all need for assembly?

It depends on the context. For extremely limited embedded environments, there's no adequate replacement for ASM (though embedded systems are become more and more powerful & HLLs are increasingly used). For low-level hardware operations (think OS cores, boot-loaders and device drivers) ASM is used for efficiency & the lack of dependencies on runtime libraries. For some performance-sensitive things (like video encoding), there is hand-tuned ASM to handle using CPU-specific parallelization stuff (SSE optimizations and so on). For most people, the first & last time they see ASM is in a college course on it. Advanced developers might look at the ASM output of their compilers for complex optimization/debugging issues. Anyone who regularly deals with ASM is more likely to primarily consider themselves an electrical/computer engineer than a programmer.

But, yes. C was originally developed with the idea of developing an OS in it - a "portable assembler" for Unix development. The goal was to have something as flexible & expressive as a high-level language that still had the capability of doing the low-level operations needed to develop (most of) an OS in. Unix's dominance of the business environment in the 80s helped establish C's dominance. Similarly, the low-overhead nature of the language made it an obvious choice of development in the comparatively low-powered environment of early PCs.

While C is still very popular for Unix development and other OS/Systems projects, C++ has come into favor for new large-scale application/systems development. In recent years, there's been a move toward application development in even higher-level VM languages (Java and .NET (which, with their garbage-collected VMs & vast standard libraries are much closer to the original ideals of OOP than C++) and, particularly on the web front, scripting languages (Python, Perl, Ruby, PHP). Still, these high-level environments are themselves built on top of C, C++ and/or assembly.
 
Back
Top