7 ms·
Pascal (or more precisely Borland's version of it) was my first programming language that I learned in school. I also used it when I was participating in the CS
by bad_user 14y ago
Pascal (or more precisely Borland's version of it) was my first programming language that I learned in school. I also used it when I was participating in the CS Olympiads.
Going from Pascal to C was like a breath of fresh air. Pascal is like a combination of everything I hate in all programming languages that I know and I'm glad that the world moved on. C is small, elegant and portable. It's a systems programming language that does what it's supposed to do.
> Javascript is an objectively terrible language
Our tastes are different and all proof to the contrary, as Javascript proved that it's an objectively good programming language, that has been burdened with legacy, incompatibilities due to the browser wars and more recently slow evolution due to its huge popularity and the stagnation of IExplorer. It has quirks and it isn't what it should have been, but considering the context it's the best outcome we could have had.
Name one other programming language that's (1) a true standard governed by a standards body with multiple platform-independent implementations and (2) has less problems than Javascript.
With Javascript your argument falls flat on its head too, because all of the competing technologies failed because of really good technical and political reasons ... lets not forget VBScript, Java Applets, Flash and Silverlight. Yes, technologically speaking Javascript was and is better than all of them.
- pjmlp 14y ago> Going from Pascal to C was like a breath of fresh air. Pascal is like a combination of everything I hate in all programming languages that I know and I'm glad that the world moved on. C is small, elegant and portable. It's a systems programming language that does what it's supposed to do. I hate C with its lack of proper arrays handling and brain dead string manipulations that open the door to so many security exploits. Additionally the lack of modules/namespaces is a joke. Mac/Turbo Pascal, Ada, Modula-2, Modula-3, Oberon(-2) are all examples of system programming languages done right.
- PommeDeTerre 14y agoC's array and string handling is extremely compact and powerful in many ways. It does, however, require at least some understanding of pointers. But once you understand how it all works, you can do significant string manipulation with relatively little effort, while still retaining exceptional runtime performance and minimal memory usage. That said, if you're the kind of person who doesn't understand pointers, there are numerous libraries out there that'll provide a variety of functions for working with arrays and strings more easily. C itself doesn't prevent you from using these alternate approach, but rather it enables them.
- sixbrx 14y agoThe problem with C, for most application domains, is not that it requires pointer knowledge, but that it requires constant attention to this knowledge. Combined with the fact that there's no warning when you've stepped outside the bounds of an array, I think makes it an extremely dangerous language to use for large scale programming. Years back, a friend was maintaining a system collecting and processing scientific data, in C. Several papers have been published on this data over the course of many years. I remember the sinking feeling we both got - mixed with real fear - when he told me he had discovered an error where an array's bounds had been miscalculated. I don't even want to think about the possible ramifications of that... For some application domains low level control is necessary of course, or for others the performance gain may make the tradeoff worth the cost.
- bad_user 14y agoThe problem of people building on top of C is that C is not a language meant for applications. A system collecting and processing scientific data is too high-level for a language like C. In fact no application should be written on top of a language that doesn't do garbage-collection by default, unless you've got the resources of big companies. Any language that doesn't do garbage-collection by default is dangerous for large scale programming. On array bounds checking, you can't do such bounds checking at compile time, so you have to rely on runtime checks and metadata. As my highschool professor kept telling us, C is a medium-level programming language. It's optimized for moving bits around in memory, while the code remains reasonably platform-independent. Adding array-bounds checking by default doesn't make sense for a language like C, because it stays in the way of moving bits in memory.
- pjmlp 14y ago> Adding array-bounds checking by default doesn't make sense for a language like C, because it stays in the way of moving bits in memory. Any proper language for systems programming allows to turn off bounds checking if required- This is the way it should be done, disabling the bounds checks on the few spots that require them being disabled, after profiling if they being on really affects the performance of the application.
- deleted 14y ago[deleted]
- lucian1900 14y agoWhile they are both flawed, JavaScript is nowhere near as terrible as PHP.
- PommeDeTerre 14y agoThere are a lot of problems (not merely "quirks", but outright problems) with JavaScript that have absolutely nothing to do with past or present browser-based implementations. They're problems that are inherent to the language itself. I'm talking about things like its extremely broken equality operators, its extremely broken array handling (especially the behavior of the length property), semicolon insertion, its broken scoping, its lack of support for proper class-based OO, its lack of support for proper namespacing and modularity, its lack of proper typing, and so forth. These are far worse, and in many cases much stupider, than any problems we see with C, C++, Java, C#, Python, Ruby, Erlang, Perl, Haskell, Scheme and whatever other mainstream or semi-mainstream language you want to choose. PHP is perhaps the only widely-used language that exhibits the same kind of idiocy when it comes to many core features. But at least it has been moving in the right direction, with its much more sensible support for OO and namespaces, for instance. We keep hearing about how ECMAScript 6 will finally bring at least some sensibility, but this is still very much up in the air. It's incorrect to say that JavaScript is an "objectively good programming language". It's objectively terrible, and all of the evidence proves this very conclusively.
- AnIrishDuck 14y agoMost of your peeves are addressed by correctness checkers like JSLint, or have been alleviated by community projects. There's a lot of hate here, so I'm going to address your points one by one: > I'm talking about things like its extremely broken equality operators, Don't use language features that are broken. Use === and !== instead. JSLint complains about this. > its extremely broken array handling (especially the behavior of the length property), You're going to have to elaborate here, I have no idea what you're talking about. > semicolon insertion, Put semicolons at the end of each line manually. Or don't use crazy multiline expressions. JSLint will flag this down for you. Other languages like C force you to do this, why the JavaScript hate? > its broken scoping, Never put things in the global scope. Always use var. Global-by-default is annoying, but very easy for static tools like JSLint to flag and nag about. > its lack of support for proper class-based OO, Javascript's objects are very minimal; they can easily emulate semantics of other OO languages. In my code I usually emulate the Python copy-superclass-on-class-creation semantics of subclassing. > its lack of support for proper namespacing and modularity, RequireJS has effectively solved this problem for me. As per above, you should never put things in global scope anyway. > its lack of proper typing, If you're looking for built-in static typing, you came to the wrong place. I think it's important to remember that JavaScript the language was designed to be very minimal (IIRC the entire initial language was created in a week); in that regard, it at the very least is not a good fit for static typing. I personally wish that it had stronger types, and can agree with you here that ideally this would be different. > and so forth. I guess I don't see your concerns here. I prefer writing JavaScript over C and Java; it allows me far more leeway for creating abstractions through closures and anonymous functions. Think of JavaScript's problem statement: create a simple minimal universal browser-based language. It's hard to imagine a better language in JavaScript's place (Scheme is the only realistic alternative I can think of). Here's a nightmare scenario for you: we could have ended up with Visual Basic instead. JavaScript isn't perfect, but what language is?