• RSS
  • Twitter
  • FaceBook

Security Forums

Log in

FAQ | Search | Usergroups | Profile | Register | RSS | Posting Guidelines | Recent Posts

Minimalism versus pragmatism versus idealism

Users browsing this topic:0 Security Fans, 0 Stealth Security Fans
Registered Security Fans: None
Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Programming and More

View previous topic :: View next topic  

Minimalism versus pragmatism versus idealism
Minimalism
60%
 60%  [ 6 ]
Pragmatism
40%
 40%  [ 4 ]
Idealism
0%
 0%  [ 0 ]
Total Votes : 10

Author Message
UziMonkey
SF Reviewer
SF Reviewer


Joined: 19 Dec 2003
Posts: 5


Offline

PostPosted: Tue Feb 24, 2004 3:26 am    Post subject: Minimalism versus pragmatism versus idealism Reply with quote

I'm currently trying to expand past my "C-like languages are best" myopia and I'm finding many more overriding principals governing programming languages than I had once seen. What I used to think was blind fanaticism I can now see are some very distinct philosophies. I'm not saying any one is better than the other, but I'm trying to get a handle on other people's thoughts.

First, you have the minimalists, who are more or less extentions of their machines. C, assembler and some C++ coders fall into this category. These are the "If you don't understand your machine, you can't make good programs" people. I still have one foot in this camp (and one foot dangling). Is making your programs run just slightly faster worth the extra developement time and possibility for further bugs?

Next, the pragmatists. These are the people who just want to get things done. Languages like Perl (nothing better really for processing text, unseating the previous champion, awk), PHP (king of the quick and dirty CGI) and to some extent Java (extensive API, ultimate zero-effort portability). These languages tend to grow as a result of how they are being used. Things can get messy, but there's no doubt that you can get things done with them.

Finally, the idealists. Scourge of IRC channels and newsgroups everywhere. Able to conquer entire arguments with a simple witty phrase. Can easily stand on a soapbox for weeks at a time. Many of these people come off sounding like crazy eyed fanatics, but most of them are quite sane. Idealistic languages tend to cram a single principal down your throat. For instance, it's impossible to make a Lisp program without thinking 100% in lists. The same goes for heavily OO languages, it's impossible to program Smalltalk without thinking in objects. For people who can easily switch modes, these languages are heaven, whereas many people can't grasp them past the basics. Is adhering yourself to a strict philosophy really worth it?

I'd like to hear your thoughts, even if you think they're irrelevant..
Back to top
View user's profile Send private message Visit poster's website
capi
SF Senior Mod
SF Senior Mod


Joined: 21 Sep 2003
Posts: 16777097
Location: Portugal

Offline

PostPosted: Tue Feb 24, 2004 5:18 am    Post subject: Re: Minimalism versus pragmatism versus idealism Reply with quote

UziMonkey wrote:
First, you have the minimalists, who are more or less extentions of their machines. C, assembler and some C++ coders fall into this category. These are the "If you don't understand your machine, you can't make good programs" people.

You can count me in on that group Smile Although I'd hardly classify C++ (spit spit) in the same category Razz hehe no just kidding, C++ is alright but I much prefer C or ASM.

Now, I don't think there is one ring to rule them all, one magic solution for everything - after all, it woulnd't be very practic to go around writing huge projects in ASM, for example. I think everything has its place, depending on what your goals/restrictions are.

That said, I must say I am heavily biased towards "lower level" languages - highest level I'd ever tolerate for something of mine would be C++ and even then I'd much rather do it in C. Yes, they aren't very portable - but then again, as you probably seen me say before, one could define portability as taking the lowest common denominator and not be too far off from the truth. Portability, shmortability. The cold fact is the majority of software out there doesn't take full advantage of the machine's capabilities or anywhere near it. Lower level languages, if used properly, will let you optimize your software to a much higher extent. Nowadays it seems saving 3 microops in a loop doesn't matter much to most, sadly. Programmers are spoiled. As for languages like Java... bah they ought to be called LFTL (Languages For The Lazy) Razz (/me gets ready for countless flames from Java worshipers)

If more programmers actually tried to do things right, instead of using the old "running slow? buy a faster cpu" axiom, who knows where we could be today? Hardware has evolved at an incredible pace, but it's caused software developers to become lazy. We're not getting much more out of the machines we have now than we did before - it's just that we have to buy better and better machines to run worst and worst programs at the same speed.

Just as an example of putting resources to a good use for a change, have a look at www.theproduct.de and check out the demos they have there. 64kb files... (granted, they uncompress in memory but still)

Now, while I believe that C, ASM and similar languages are the best for most tasks, I do admit that there's a place for other languages as well. For example Java does come in handy for things such as Web applets - not very practical having to have a bunch of different binary versions of the same applet for people to download and execute from whatever computer they decided to do their online banking with. Or for quick tasks like just parsing some log looking for something, not very realistic having to go and write your own parser yourself in ASM or whatever, when you can just use one of the better suited languages for that purpose. However, for most purposes, I still contend that lower level languages are the only way to go - well used, they provide the best possible performance and resource usage.

Just my opinion, of course, I'm sure there will be others who won't agree... Smile
Back to top
View user's profile Send private message
Code
Just Arrived
Just Arrived


Joined: 17 Dec 2003
Posts: 0
Location: Hell

Offline

PostPosted: Wed Feb 25, 2004 2:47 am    Post subject: How about a mix? Reply with quote

I truly don't see how anyone can ignore the higher level languages and the abstract tools that these languages bring to a project. It is true that system performance is usually sacrificed while using these abstract tools, but it comes with the added benefit of a very maintainable code base. And quite frankly, if shaving a few seconds off execution time is the reward for having a very unmaintainable rigid project, then what exactly have you achieved? Obviously in time critical systems, having the best worst case performance is an important design restraint, but for most systems, the fractional amount of system performance gained from using entirely low level languages, is not worth the possibly huge investment of time in maintaining such a system...

At the same time though, I also don't see how anyone can be so blind to rely on higher level constructs. There is obviously times where these constructs are overkill and can actually over complicate the design of the system. For example designs that lend themselves easily to low level implementations is the fundamental data structure algorithms that nearly every project uses. A generic Quick Sort written in a low level language lends its self to this easily as it is unlikely that the code base will need to be changed, and it is also a piece of code that may be utilized in a system extensively whereby the small performance gains over a higher level language can quickly add up...

Obviously this leads to a very generic approach to project design that has been around for awhile and has been used extensively by traditional engineers. Languages are just tools, and it's the underlying concepts that every programmer should know better than their own keyboard. While we have the luxury of dealing with cheap (compare to engineering projects with inherently expensive materials and fabrication) software, we should not be sucked into complacency of one style or one family of languages. While the C family of languages are THE languages of choice now, and a large code base is already written in these languages, it is nearly guaranteed that they may be phased out in the next decade or less. With all of that said, it's also apparent that low level programming techniques will always be important on any possible future computing system, but at the same time the more abstract and maintainable languages should always be used in the high level design of a project to streamline overall project coherency.

That's generally my take on that... that answer the question, or did I go off rambling again?
Back to top
View user's profile Send private message
bsdjunkie
Trusted SF Member
Trusted SF Member


Joined: 13 Jun 2003
Posts: 2


Offline

PostPosted: Wed Feb 25, 2004 3:09 am    Post subject: Reply with quote

Quote:
That said, I must say I am heavily biased towards "lower level" languages - highest level I'd ever tolerate for something of mine would be C++ and even then I'd much rather do it in C. Yes, they aren't very portable - but then again, as you probably seen me say before, one could define portability as taking the lowest common denominator and not be too far off from the truth.


C was created to be *portable*. So one wold not have to learn asm on all the diff architectures.
Back to top
View user's profile Send private message
capi
SF Senior Mod
SF Senior Mod


Joined: 21 Sep 2003
Posts: 16777097
Location: Portugal

Offline

PostPosted: Wed Feb 25, 2004 3:16 am    Post subject: Reply with quote

bsdjunkie wrote:
C was created to be *portable*. So one wold not have to learn asm on all the diff architectures.

I'm obviously talking about portability without having to recompile in the case of C. Also, even when recompiling source code, it's not always very easy to port across different OS platforms - assuming the program actually does something useful. There are just too many different implementations of different functions - quick example: sockets support on *NIX and Win32... Compare the differences.

That was my point about C and it not being a specifically geared towards portability language - not remotely as portable as say Lisp or Java. Then again, as I said, you gain close to nothing from that kind of portability... Wow you can create something that runs equally slow on 10 different platforms, good job! Laughing
Back to top
View user's profile Send private message
UziMonkey
SF Reviewer
SF Reviewer


Joined: 19 Dec 2003
Posts: 5


Offline

PostPosted: Wed Feb 25, 2004 7:21 am    Post subject: Re: Minimalism versus pragmatism versus idealism Reply with quote

capi wrote:

You can count me in on that group Smile Although I'd hardly classify C++ (spit spit) in the same category Razz hehe no just kidding, C++ is alright but I much prefer C or ASM.


The reason I put C++ (partially) into this category is the fact that it generates pretty lightweight code, and doesn't hide any more than C does. Though, if people used it as an object-oriented C, instead of how they would use a higher-level language, then they might not get into so much trouble. Just because it's an OO language doesn't mean you have a free pass to ignore all low-level details. Though, C++ is a huge, overly-complex mess of a language. I pitty C++ coders.. Sadly, the only real way to learn it was so bad was to read "The C++ Programming Language".

Since I've sort of shifted to ranting about C++, I might as well shift again to evangelize about D! Smile D is like C++, only without the complexity. Backwards compatability is gone in favor of simplicity and practicality. Some features that only seem to make things more complex are gone. This includes the preprocessor, but 99% of the preprocessor uses are covered by extra features (conditional compilation, module imports, inlining). It also has a lot of features for the sake of practicality, such as class invariants, a routine which runs before main (and after static initialization) which, if it fails, stops program execution. Also "real" assertions, which can be turned off with a compiler switch, design contracts (routines to check sanity before and after a function), and "real" arrays, both static and dynamic, which hold the length of the array as well as it's starting address. It's also garbage collected, which is always a plus...

It really falls into all three categories though, as it doesn't hide much more than C does (but provides facilities so you don't have to do things like pointer manipulation). It's completely designed for practicality, so it fits into the second category. And it's philosophy is that of practicality, everything has a real use, or it doesn't exist.

*steps down from his soap box*
Back to top
View user's profile Send private message Visit poster's website
capi
SF Senior Mod
SF Senior Mod


Joined: 21 Sep 2003
Posts: 16777097
Location: Portugal

Offline

PostPosted: Wed Feb 25, 2004 7:04 pm    Post subject: Re: Minimalism versus pragmatism versus idealism Reply with quote

UziMonkey wrote:
It's also garbage collected, which is always a plus...
(...)
It really falls into all three categories though, as it doesn't hide much more than C does (but provides facilities so you don't have to do things like pointer manipulation).

Aaaaargh!!!!

Garbage collector!? No pointers!? Vade retro! Laughing
Back to top
View user's profile Send private message
UziMonkey
SF Reviewer
SF Reviewer


Joined: 19 Dec 2003
Posts: 5


Offline

PostPosted: Wed Feb 25, 2004 7:27 pm    Post subject: Re: Minimalism versus pragmatism versus idealism Reply with quote

capi wrote:

Garbage collector!? No pointers!? Vade retro! Laughing


I never said no pointers, I suggested that you don't need pointers. Objects are themselves references, thus passed as references. Also, you can have "out" parameters to functions, which means they're passed as references (for base types). Pointers are available, but there's no reason to use them on a regular basis, there are more "safe" ways to get things done.

Also, I forgot to spam the D homepage in my last posting! Oh well, here it is: http://www.digitalmars.com/d/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   

Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Programming and More All times are GMT + 2 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Community Area

Log in | Register