Jackmackg Posted September 24, 2009 Share Posted September 24, 2009 In most programing languages is "any number">0=true and "any number"<1=false when using only whole numbers in a if statement? Link to comment Share on other sites More sharing options...
K^2 Posted September 25, 2009 Share Posted September 25, 2009 Yeah.... You'll have to explain that one a bit better. Prior to filing a bug against any of my code, please consider this response to common concerns. Link to comment Share on other sites More sharing options...
Saggy Posted September 25, 2009 Share Posted September 25, 2009 Yeah.... You'll have to explain that one a bit better. I think what' he's trying to confirm is that any non-zero value equals true, and zero value equals false, and whether that holds true across all programming languages. I don't work with that many different languages, but I've never seen one where this wasn't the case. QUOTE (K^2) ...not only is it legal for you to go around with a concealed penis, it requires absolutely no registration! Link to comment Share on other sites More sharing options...
Jackmackg Posted September 26, 2009 Author Share Posted September 26, 2009 Yeah.... You'll have to explain that one a bit better. I think what' he's trying to confirm is that any non-zero value equals true, and zero value equals false, and whether that holds true across all programming languages. I don't work with that many different languages, but I've never seen one where this wasn't the case. yes you got it. sorry for my bad wording. Also what about negative numbers? how are those mostly held? and to sneak one more question in can i use a multiplication symbol ("*") like a "and" in an if statement in most languages? Link to comment Share on other sites More sharing options...
Saggy Posted September 26, 2009 Share Posted September 26, 2009 (edited) Yeah.... You'll have to explain that one a bit better. I think what' he's trying to confirm is that any non-zero value equals true, and zero value equals false, and whether that holds true across all programming languages. I don't work with that many different languages, but I've never seen one where this wasn't the case. yes you got it. sorry for my bad wording. Also what about negative numbers? how are those mostly held? and to sneak one more question in can i use a multiplication symbol ("*") like a "and" in an if statement in most languages? Well, it varies pretty greatly from language to language as far as how negative numbers are stored. In C they're generally referred to as signed integers, and as in all things C they just boil down to binary data in memory and how your computer processes it. I'm not too sharp on that stuff, but signed integers basically take a binary range like 0-255, and instead of one binary value equaling one whole number, it's split so that -128-128 are mapped over the 255 binary values. The computer does the work choosing which binary value to use as your number. "If" statements generally evaluate expressions and variables within those expressions. So I think it is generally valid in any language, to evaluate something like if(1+1) to test for 2. For example, if you want to test for a Celsius temperature, but you don't want to convert the variable which already holds a Farenheit value, you could do... if((var-32)*5/9 == 50 In C this would take a Farenheit value "var" and test it against a Celsius value of 50 without having to convert the actual variable. Instead, it simply evaluates the expression as written, substituting the value of "var" where needed. I believe this is pretty much universal to "if" statements in any language. Edited September 26, 2009 by SagaciousKJB QUOTE (K^2) ...not only is it legal for you to go around with a concealed penis, it requires absolutely no registration! Link to comment Share on other sites More sharing options...
xtal256 Posted September 26, 2009 Share Posted September 26, 2009 Only in low-level languages like C/C++. Most higher level languages (Java, Smalltalk) will not treat 0 as false and anything else (i.e 1) as true. They may do if you specifically convert the variable from integer type to boolean type but if you say "if (1)" the compiler will probably complain that 1 is not a boolean. Link to comment Share on other sites More sharing options...
K^2 Posted September 26, 2009 Share Posted September 26, 2009 Technically, even in C, the if() statement takes a boolean value. However, C/C++ will automatically typecast when it is unambiguous. Since the if() statement takes boolean only, typecast is never ambiguous, and you can use any type in the if() statement as long as there is an available typecast to boolean. Note that any non-zero value is typecast as true, and only the zero value is typecast as false, regardless of type and sign. So if(-1.5) still evaluates same way as if(true). This is very convenient, because it allows for quick checks against division by zero, parsing of NULL characters in strings, and making sure you don't follow a NULL pointer. For this very reason any type of zero or NULL is represented with all bits set to zero. In C++, if you wish to use a custom class with an if() statement, you should create a typecast operator. For example, lets say you have a complex number class that you want to evaluate to false only if both imaginary and real parts are zero. You'd write something like this. class complex{ public: operator (bool)(void) { return (im||re); } private: float re; float im;}; With a definition like this, you can declare some variable of complex type, and then have if(complex_variable) in your program without any kinds of errors being thrown. You might get a warning, though. To avoid that, simply typecast explicitly. e.g. if((bool)complex_variable). Prior to filing a bug against any of my code, please consider this response to common concerns. Link to comment Share on other sites More sharing options...
dice Posted October 5, 2009 Share Posted October 5, 2009 In C, how are then negative values handled in if()'s ? Link to comment Share on other sites More sharing options...
Svip Posted October 5, 2009 Share Posted October 5, 2009 In C, how are then negative values handled in if()'s ? As true. Only 0 is false. But C is a terribly ugly and type-insensitive language. Sure, it may complain about types a lot, but how can a language seriously treat int as its lack of boolean values? A real type sensitive language like SML or Haskell are languages worthy of consideration for production of algorithms. Hell, Twelf allows you to specify the result of an equation rather than the function. Then again, Twelf doesn't have types, you must create them all initially. And it is really more about logical programming. Anyway, long live functional programming, curse imperative programming! Link to comment Share on other sites More sharing options...
K^2 Posted October 8, 2009 Share Posted October 8, 2009 (edited) You really don't understand how C and C++ typecasts work, do you? Yeah, there is no runtime type checking, and that's the beauty of C/C++. The code you write is the code that's going to execute. Not a bunch of trash collection, type checking, stack watching, leak monitoring junk code that was written by Pascal knows who, checked by the Shakespeare-project-reject monkeys, and shoved all together into a single runtime by people who think that CPU is a magic box that performs all instructions instantaneously and never-ever runs out of stack. Or worse. Microsoft. If you need functional programming, write your own imperative shell for your functional object-level code, so that you know what's going on. If you are so talentless that you can't write your own garbage collector, dictionary, or logic interpreter, you shouldn't be touching a keyboard for anything other than e-mail. And even that, preferably, under close supervision. P.S. If you think that Twelf avoids function calls, you don't understand how it works. Edited October 8, 2009 by K^2 Prior to filing a bug against any of my code, please consider this response to common concerns. Link to comment Share on other sites More sharing options...
ghost of delete key Posted October 9, 2009 Share Posted October 9, 2009 (edited) there is no runtime type checking, and that's the beauty of C/C++. This is also the horror of C, that and all the extensive memory allocation one must indulge in. Flexible, yes. Messy too, as it gives you more than enough rope to hang yourself with ambiguity. (you're not a fan of Pascal, are you... Remember, you don't have to be able to calculate the curves of a camshft in order to drive the car well. ) This is why I prefer Pascal as a strongly-typed language. I'd rather spend my time focusing on the task rather than all the housekeeping necessary to attempt the task. I'm not very patient that way. The drawback is that Pascal doesn't have true polymorphism; there is only single-inheritance, but since you have the gift of IInterface, you can indulge in polymorphism, and the code is far more elegant and essentially just as powerful. Besides, Pascal's typecasting model allows just about the same flexibility as C. And why all the hate on Pascal's CPU habits? In Pascal, all objects live on the stack, whereas in C they live on the stack, in the registers, in your damned refrigerator if your not careful, etc. Why would one want to be bothered with being a chemist when all you're trying to do is cook dinner? I do agree though, you should always be keenly aware of what's going on beneath the application layer, I just don't feel the need to be mired in it. But I digress. Anyway, by its very nature, an IF-THEN or IF() statement evaluates to a boolean expression. In Pascal, True and False are native Cardinal types relating to 1 & 0 respectively. Of course, these can be used interchangeably. Soo00... What was the question? In any event, whatever your test expression is, it must ultimately evaluate to boolean, as IF() is a test for truth. If you want to test for enumerations other than boolean, use a case statement. Edited October 11, 2009 by ghost of delete key "I can just imagine him driving off the edge of a cliff like Thelma & Louise, playing his Q:13 mix at full volume, crying into a bottle." - Craig Link to comment Share on other sites More sharing options...
xtal256 Posted October 9, 2009 Share Posted October 9, 2009 (edited) If you are so talentless that you can't write your own garbage collector, dictionary, or logic interpreter, you shouldn't be touching a keyboard for anything other than e-mail. And even that, preferably, under close supervision. Wow, K^2, i admire your programming abilities but what you just said offended even me. If everyone in the programming world thought like that then all computers today would still run some command-line OS with no more than a meg or RAM. Do you seriously expect every single programmer to write their own garbage collector, interpreter and god-knows-what else just so you "know" it works. And what if it doesn't work. Then you spend your whole life trying to get up to the point where you can start working on something useful, and by that time it's too late. You can't stand in the way of progress just because you liked the old way better. And if you thought that way about every technology then we would still be living in the dark ages. Anyway, aren't you only a few years older than me (i'm 23)? I thought only >50 year old comp.sci. professors had that view. Edited October 9, 2009 by Haro Link to comment Share on other sites More sharing options...
K^2 Posted October 9, 2009 Share Posted October 9, 2009 Haro, I stand by what I said. If you are planning to write anything serious, you have to learn the basics first. Otherwise, you'll be writing the same garbage as most of the programmers today, and I'd rather see you do something other than programming then. If you are just learning to program for fun, or want to make Flash animations, you can do whatever the heck you want. It doesn't affect anyone. It takes me a few hours to write a garbage collector or a dictionary from scratch, test it, and make sure I never have to touch it again while I'm developing whatever it is that I'm developing. And that's when I have to do it. Most of the time, I recycle one of the ones I already have in my library. Is that a lot of effort to put into a project you expect to last a few days or weeks? Really? And when I have everything set up, I can have it run as strictly imperative as Assembly, or as functionally abstract as Prologue. Whichever I need it to be. And if I want AI and rendering engine to run on different levels of abstraction, which is typically true, I can actually achieve that. My only other option would be to Python the core code, and Assemble the modules dealing with graphics. In C, I don't have to jump from one language to another to complete a serious project. And I like the fact that my classes can live in the fridge if I want them to. It means, for example, that I can define a class to have virtual methods, form these methods right in the data segment from data I download or generate, and have my classes change behavior on the fly. You'd rip your hair out trying to get something like this working in Pascal or any of the nu age languages like C#. In C++, it's all part of the design. Prior to filing a bug against any of my code, please consider this response to common concerns. Link to comment Share on other sites More sharing options...
xtal256 Posted October 10, 2009 Share Posted October 10, 2009 Haro, I stand by what I said. If you are planning to write anything serious, you have to learn the basics first. Otherwise, you'll be writing the same garbage as most of the programmers today, and I'd rather see you do something other than programming then. So you think that every software made today is rubbish then? Because none of it could be done without 3rd party libraries or "other people's code". And if you think i should be doing something other than programming, then what would you have me do? Scoop up dog crap for a living? Because if what i or any other programmer today does isn't good enough for you then nothing is. And you will have to drop that attitude if you ever want to get a job in programming (if that is your career choice) because no one will want to work with you if you are not willing to work with other people's code. Besides, if you don't trust anyone else's code then why are you using Windows? Or a web browser? Spend your whole spare time writing some piece of sh*t OS that does exactly what you want it to do and nothing else. Hey, at least you know it will never get a virus It takes me a few hours to write a garbage collector or a dictionary from scratch Well then it mustn't be a very good one. Sure, it might get the job done, your job, but you will have to keep adding to it and modifying it if you need it to do more. I don't know all the inner workings of a garbage collector so i shouldn't really comment, but i trust that the people who write them for languages such as Java know full well what they are doing and have a lot more experience than you. Is that a lot of effort to put into a project you expect to last a few days or weeks? Maybe not for you, but if every single software company wrote all their own libraries, imaging how many man-hours would be wasted on that. Now i will admit that a lot more time is wasted on bad code that keeps breaking later because it was not properly written the first time but the same thing can happen with your libraries. The problem is not that people are using other people's code without knowing how it works, the problem is that people cut corners because of cost or time constraints. Don't mistake that for bad programming. It's pointless to argue to much about who is right, so lets just agree to disagree and leave it at that. If you can convince people to fully understand every little bit about computers before they even touch a keyboard then good for you. A lot of software would be better off because of that but a lot of people would lose their jobs, and even if you think they deserve to i don't think companies would make the decision to lay off people and pour more money into their product just to make it better, the world just doesn't work that way. Link to comment Share on other sites More sharing options...
ghost of delete key Posted October 11, 2009 Share Posted October 11, 2009 So you think that every software made today is rubbish then? That's not what he's saying (at least I hope not!) It takes me a few hours to write a garbage collector or a dictionary from scratch Well then it mustn't be a very good one. Sure, it might get the job done, your job, but you will have to keep adding to it and modifying it if you need it to do more. I don't know all the inner workings of a garbage collector so i shouldn't really comment, but i trust that the people who write them for languages such as Java know full well what they are doing and have a lot more experience than you. I don't know that that's exactly fair. I think you have a little pronoun trouble, though. Change you to me and then you have a very valid argument. That would explain why you prefer to rely on the engineering efforts of those who created the layer of abstraction you work with, as do I, and as K^2 doesn't. It's not necessarily a bad thing to re-invent the wheel if you feel the need, or at least install your own hubcaps. It's simply a matter of what you expect to accomplish by doing it. Personally, I have not found a need to tunnel beneath the workings of Pascal that way to achieve something other than what it's designed to do. And that is because I haven't found anything that Pascal can't do that C can do in context of conceptual models. Of course they have capabilities and constraints in an absolute sense, but then again, these are functions of their design ethics. Ultimately, though, they are simply different ways of achieving the same hardware functions of a CPU. It's just like human language... you cannot say in English what you can say in Japanese and vice-versa, but you can always achieve the same conceptual transfer, as both languages wrap a "platform" of teeth, tongue, larynx, and brain. Of course the haiku artist will call an English attempt artless, and the limerick artist will decry the scansion afforded by nihongo. But that only speaks to Human Nature. Haro, I stand by what I said. If you are planning to write anything serious, you have to learn the basics first. Otherwise, you'll be writing the same garbage as most of the programmers today, and I'd rather see you do something other than programming then. If you are just learning to program for fun, or want to make Flash animations, you can do whatever the heck you want. It doesn't affect anyone. Ouch. I completely agree about understanding the underlying concepts behind what one fiddles with, but... Ouch. It takes me a few hours to write a garbage collector or a dictionary from scratch, test it, and make sure I never have to touch it again while I'm developing whatever it is that I'm developing. And that's when I have to do it. Most of the time, I recycle one of the ones I already have in my library. And all I do is fire up my Delphi or CBuilder or Lazarus or DevCPP and rely on the capabilities already built in, and if I find I need something not already offered, I extend the library. That is what programming is, after all... everything builds on something else. The more that is built, the more robust your development, as long as it is done competently. Is that a lot of effort to put into a project you expect to last a few days or weeks? Really? For many folks, yes it is. By no means does that necessarily mean that one who relies on ready-made structural integrity has no clue what's it is or what it's for, it simply means that the underlying structure is concealed for uniformity and clarity, and for easier development cycles. Application developers are not concerned with writing components, and component developers are not concerned with the application developer's end-usage, but both must be aware of the functionality of the other's scope for any of it to be meaningful, or at least worth a fig... and that goes back to what you've been saying. And when I have everything set up, I can have it run as strictly imperative as Assembly, or as functionally abstract as Prologue. Whichever I need it to be. And if I want AI and rendering engine to run on different levels of abstraction, which is typically true, I can actually achieve that. My only other option would be to Python the core code, and Assemble the modules dealing with graphics. In C, I don't have to jump from one language to another to complete a serious project. I'd say don't let your love of that freedom blind you from the equivalence of other methodology... For example, my beloved Delphi does indeed allow this same range of facility. You can run inline assembly anywhere in Pascal code for extra-light execution if you want to cruise that low, and you have all the esoteric ease of simply calling straight out of runtime libraries without giving memory management and type issues a second thought. I wouldn't say I'd need a second language to extend Delphi's functionality. Running Python or Lua scripts would be what you'd do to hook into your executable's code in order to extend your application's functionality, not the functionality of the language the app is written in; i.e. you write a rendering app and then script what it renders. Just like GTA or any number of other game apps. And I like the fact that my classes can live in the fridge if I want them to. Honestly? I kinda like my classes in bed with me, but that's another issue. But seriously... It means, for example, that I can define a class to have virtual methods, form these methods right in the data segment from data I download or generate, and have my classes change behavior on the fly. You'd rip your hair out trying to get something like this working in Pascal or any of the nu age languages like C#. In C++, it's all part of the design. In Pascal?! I don't know about pure ANSI Pascal, but in Delphi, ab-so-lutely NOT! Virtual and abstract methods are easy as pie, and I still have all my luscious flowing locks. AND I don't have to worry about explicitly constructing anything anywhere in any dataseg. The VMT is managed beneath the layer and is mutable with simple abstract, virtual, override, and overload keywords in class declarations. That gives you the ability to define types and classes that behave how you want whenever/wherever implemented. It relieves the programmer from otherwise quite rigid class implementations as Pascal IS a strongly-typed language. *** It's pointless to argue to much about who is right, so lets just agree to disagree and leave it at that. If you can convince people to fully understand every little bit about computers before they even touch a keyboard then good for you. Well, I happen to think that a healthy discussion of the differences could be beneficial to all involved, especially an infojunkie like myself... I do think though that the hot peppers are best left in the kitchen where they belong. Odd how this thread strayed so far off topic, and I dislike that on its face, but I do think that this is a great train of discussion. Maybe we should port it to a fresh topic of its own? I'd like that. Maybe "C vs. Pascal"? "I can just imagine him driving off the edge of a cliff like Thelma & Louise, playing his Q:13 mix at full volume, crying into a bottle." - Craig Link to comment Share on other sites More sharing options...
xtal256 Posted October 11, 2009 Share Posted October 11, 2009 (edited) Change you to me and then you have a very valid argument. Well according to K^2's bio, he was born in 1985, which makes him only a year older than me. The people i am talking about, the ones that have a lot more experience, are people that have been in the game for over 30 years. I'm sure they would have picked up a think or two in that time that gives their code a bit more credibility than K^2's (although i'm not necessarily saying that his code sucks). EDIT: by the way, i completely agree with K^2 about understanding the underlying concepts of a system before one uses an abstraction layer above it. I hate the way Flash programmers can be so inefficient that a simple 2D game will struggle to run on my fairly recent (less than 5 years old) laptop just because they assume everyone has a dual core these days and won't notice that it's using 100% of one CPU. What i do not agree with is K^2's attitude that everyone must be a genius smart enough to write everything themselves. No-one is perfect and the only way a large project can be accomplished is if many people with skills in different areas all work together. So someone with in-depth knowledge of a computer's memory allocation system can write the garbage collector, while someone with experience in high-level, object oriented concepts can work on the object system. The two people must be aware of what the other is doing and understand it enough to work together, but it's almost impossible for both people to be equally skilled in both areas. If that was the case then only one of them would be needed to write the entire system, however it would take them a lifetime. Edited October 11, 2009 by Haro Link to comment Share on other sites More sharing options...
K^2 Posted October 12, 2009 Share Posted October 12, 2009 I wrote my first 3D engine (of ray caster type) when I was 12. I might not be much older than you, but I've been coding a lot longer, and I started out on the same hardware as most of the programmers in their late 30's. There are three situations when you can use someone else's code, and under one very specific condition. 1) You are working with the authors in a team. You have to rely on other people's competence in that case. But a good team should be double-checking each other's code, nonetheless. 2) You know the library you are using very well, and are certain that it will behave the way you want it to. 3) You are using a library for a non-critical operation, and can be certain that it will remain confined within some predictable scope in both memory and CPU usage. For example, I use OpenGL. It's a library. I know it pretty well, I've been using it for years, and replicating its operation would require an enormous amount of work and resources. I also use ZLib, occasionally, because while I can come up with my own compression scheme, this one works pretty well. And I tend to use it when I need to open existing formats that have been encoded with ZLib, e.g. PDF. But I don't know it too well, so I don't rely on it if I need performance. And now the condition. You should never, ever use a library if you don't understand how it works in good detail. If you don't understand it, you should write your own. Granted, you will not get something that performs in optimal way, but you will learn how it works. That will allow you to select a library that does what you need in manner that you need. If you simply grab a library that's a black box to you, how are you meant to evaluate its performance? You should write your own garbage collector, even if you aren't going to use it. You should write your own rendering engine, even if CPU-driven renderers are a thing of the past. You should sit down and write a program in a hex editor, simply to understand how everything works on the inside. It is absolutely not a waste of time. When you learn how to do these things, you will be able to look at your code and see the things you really need a library for, and things you should write yourself. By your own admission, you don't know how to write a good garbage collector. Then who are you to tell me that writing your own is not a better option? Write one. Then you can tell me what you think of self-made garbage collectors versus ones written by programmers from Sun for Java. And I can tell you right away that Java's garbage collector is not that great. Granted, the problem is not with the programmers who wrote it. Problem is with particular needs of Java environment. But you have to understand these needs. You have to understand why the garbage collector is written a particular way. C/C++ has malloc. It's a bit different from version to version, but they work very similarly. Malloc request a data segment from OS if it needs one, and allocate it for objects in first-come first-served manner, leaving some house keeping data in between. GNU's malloc will allocate data in 8-byte blocks, which is also something you ought to know if you use it. When you delete an object, that portion of the segment is marked as unused, and can be allocated again. Difference in object sizes along with that will cause segmentation. Is segmentation going to be a problem for performance of your program? Is the search within segment that malloc performs to find an empty spot an issue? That depends on your application. If you need to manage a very large number of dynamic objects very fast, malloc is not for you. But if you don't mind an overhead in memory usage, a list-manager is a snap to write. It will not deallocate objects completely, but rather move them to a list of unused objects. Depending on how flexible you need it to be, you can write one in 15 minutes to a few hours, and it will solve all your problems. When you rely on your compiler to make these decisions for you, you will never write good code. One more note. While it is impossible to be an expert in every area of computing, you should first of all, have a good enough grasp to at least understand the concerns that are faced in each area, and second of all, have at least one area in which you are, if not among top experts, can at least talk to people on the same level. Prior to filing a bug against any of my code, please consider this response to common concerns. Link to comment Share on other sites More sharing options...
xtal256 Posted October 12, 2009 Share Posted October 12, 2009 (edited) I wrote my first 3D engine (of ray caster type) when I was 12 Wow, your even smarter than i thought. I worship you!! . Still, you pretty much told me that i am not fit to be a programmer, and that's not very nice . I do like to know the intricate workings of a computer, but i believe it is not a prerequisite to programming and a lot of people would probably agree with me. It definitely helps (especially if you want/need to write a ray caster), but most of the time you can live without that knowledge. By your own admission, you don't know how to write a good garbage collector. Then who are you to tell me that writing your own is not a better option? Write one. Then you can tell me what you think of self-made garbage collectors versus ones written by programmers from Sun for Java. Sun's gc code is (probably) proprietary, so how am i to compare the inner workings of it to one i write myself? I am quite certain that mine would not be as good as yours, but there are probably garbage collectors out their that work better than yours. Sure, yours might do the job well and never miss a beat, but it won't do everything that Sun's will do because theirs would have gone through many iterations over the years getting bugs ironed out and features added. Do you, or have you, had a job as a programmer? I got my job not because i know assembly but because i know object-oriented programming. If i walked in their and told them i could write my own garbage collector from scratch in C that would mean nothing to them. I might still get the job, but in-depth knowledge of low-level systems was not what they were looking for, and not what they needed. Edited October 12, 2009 by Haro Link to comment Share on other sites More sharing options...
K^2 Posted October 12, 2009 Share Posted October 12, 2009 that's not very nice I'm not a very nice person. But I try to be fair. you pretty much told me that i am not fit to be a programmer Don't know about that. I told you my criteria for who is not fit to be a programmer. If you don't know how things you use work and aren't trying to find out, you shouldn't be a programmer. Sun's gc code is (probably) proprietary, so how am i to compare the inner workings of it to one i write myself? Benchmarks? Reverse engineering? You don't need to dig very far to see which code is faster, more efficient, and more stable. It tends to be very obvious. there are probably garbage collectors out their that work better than yours Granted, how does that help me? I need a collector for a specific purpose. I know what constraints I have on it, and how I need it to be optimized. Now, I can spend a lot of time going through different collectors people wrote, figuring out if they are really as good as they claim to be, check for stability, see if there is too much stuff I don't need, etc. Or I can write my own in fraction of the time, and while it may not be the best collector out there, it will be optimized for my particular purpose, and will probably perform at least as well as a collector with generic optimizations would. All of that in fraction of the time. But even if I decide to use a 3rd party collector, it is still a very big step up from simply using the default runtime collector that came with the language. It is most likely inefficient, and certainly isn't designed for whatever it is that I'm doing. Do you, or have you, had a job as a programmer? I'm allergic to work. I've been employed here and there as a programmer in between my studies. I can't say that I really "worked", but I wrote software for them, and they payed me money. Currently, I'm 'working' towards my Ph.D., so that's a bit different. All of the code I write that actually goes into complexities I mention I write mostly for kicks. Maybe I'll be able to sell some of it, but since user-friendliness is not my forte, I doubt it. I'd probably need to find a UI coder to work with to put together something marketable. Prior to filing a bug against any of my code, please consider this response to common concerns. Link to comment Share on other sites More sharing options...
xtal256 Posted October 12, 2009 Share Posted October 12, 2009 If you don't know how things you use work and aren't trying to find out, you shouldn't be a programmer. Ah, see i am willing to find things out. That's what makes me better than a lot of idiot Flash programmers. But i don't let my limited knowledge about, say, memory allocation stop me from creating objects on the heap and trying to manage them. I use Smalltalk at work so memory allocation is not a problem for me there, i.e. i can't stuff something up that will crash our program. If i ever wish to get a job as a C++ programmer (which i am still undecided on, i prefer Java) i will have to learn more about memory allocation, but i am learning in the mean time (working on my Ballistic game). btw, another part of our application at work uses C++ to inject code into other application's processes!! And that team has to deal with 10 times as many bugs as my Smalltalk team. I think that's 1 - 0 to high-level languages Link to comment Share on other sites More sharing options...
Saggy Posted October 12, 2009 Share Posted October 12, 2009 "I doubt it. I'd probably need to find a UI coder to work with to put together something marketable." Right, the world needs both types of programmers. If people all spent the entire day writing very complex, very specific code, then practically nothing would get done because there would be nothing for anyone else to use as a template or standard and just work with. I mean, if one is to machine a part, would they want to use working, precision tools to measure its dimensions, or build their own for the job? Both are done in the world of mechanical engineering because one is more appropriate than the other for given circumstances but we know that if we had stuck to either method exclusively, we probably never would have reached the levels of mechanical crafstmanship as we posses today. I mean, I have to admit, I spent so much time working on a lathe thinking, "How does this lathe work, how did they figure out how to make it," that I came to the conclusion that had someone not made it for me, I would be incompetent as a machinist. I had to go for a machining analogy, because frankly I'm a very novice programmer and don't understand most of what you guys are discussing or have a very intimate knowledge of it; I just write code, and I like C because it's fast and I studied it when I was younger. However, that goes to my next point: I think you're taking K^2 far too literally, Haro, because I'm exactly the sort he would suggest "not" be a programmer, yet he still helps me progress and understand when I have problems so clearly he doesn't really think that way. Otherwise he would not help me to program, right? I can see why you'd take offense, Haro. I was slightly offended at first, but then I considered all of the times that K^2 has helped me out and been more than fair with something extremely trivial, and frankly I've always been one to pay more attention to what a person does rather than what they say. With that in mind, perhaps we should just wrap it up and agree that we all have our own preconceptions and ideas about who should use programming and for what, and as far as who should be employed as a programmer... Well obviously the military won't be hiring game developers for mission critical apps, and game companies won't want to pay Computer Science majors for software written in OpenGL or DirectX. QUOTE (K^2) ...not only is it legal for you to go around with a concealed penis, it requires absolutely no registration! Link to comment Share on other sites More sharing options...
K^2 Posted October 12, 2009 Share Posted October 12, 2009 The very fact that C++ CAN inject code is a game, set, and match for low level in my books. But to each his own. I'm not a fan of Java. I respect it for achieving a goal it set out to achieve, which is a universal cross-platform bytecode, but I find that goal to be a pointless one. There is only one way to make sure that your code can run equally well on a high end PC and a microwave oven, and that's not going to be in favor of the high end PC. Ok, I exaggerate a little, but you get the point. In many ways, Flash is a better platform. It sacrifices a lot of cross-compatibility in favor of performance. Not in general purpose computing, of course, but in graphics and animation specifically, which is what it is built for. As a result, Flash games dominate PC embedded gaming market, while Java gaming survives purely on cell phones, where targeting any one specific platform is not profitable. And it's not just the ease of scripting. Before Flash, people used Java on PC a lot more. I do know what you mean about Flash script kids, though. They annoy me too. What I'd be somewhat interested in is developing a Flash/Java hybrid system that runs Java-like VM, but provides it with an extensive library for 3D graphics, UI systems, physics simulations, etc. The core graphics code should be OpenGL and the whole thing should run as stand alone or browser plugin. The language on which you actually write your code would be up to the user, since the VM only interprets low-level bytecode. This would allow indie developers to create easy to run games with relatively modern graphics without overtaxing the system. And since the core would be trivial to re-build for Windows, Linux, and OSX, cross platform compatibility is a given from the start. Why not just add libraries to Java? Because the purpose of this core would be very different. It isn't meant to run on every piece of hardware out there. It's only meant to run on a narrow spectrum of CPUs with narrow spectrum of GPUs, allowing for some optimizations that contradict the very purpose of Java. As a result, the final code could run almost as good as something compiled on C# with XNA, while running cross platform at the same time. If you'd like to try and build a proof-of-concept of a system like this just for fun, let me know. Prior to filing a bug against any of my code, please consider this response to common concerns. Link to comment Share on other sites More sharing options...
xtal256 Posted October 12, 2009 Share Posted October 12, 2009 I think you're taking K^2 far too literally, Haro, because I'm exactly the sort he would suggest "not" be a programmer, yet he still helps me progress and understand when I have problems so clearly he doesn't really think that way. Otherwise he would not help me to program, right? I do think that K^2 was exaggerating a bit, perhaps to prove his argument, so i was hoping he didn't mean it too literally. My view differs only slightly to his in that i think it is less necessary to know low-level stuff before working with high-level code. I still think it is important, just not as important as K^2 thinks. I am sure he is always glad to help you, and me, because we are willing to learn. Link to comment Share on other sites More sharing options...
ghost of delete key Posted October 12, 2009 Share Posted October 12, 2009 ...My view differs only slightly to his in that i think it is less necessary to know low-level stuff before working with high-level code. I still think it is important, just not as important as K^2 thinks. Ahhh, the ol' "fly first, crawl later" ethos. I relate to that, I've been a reverse-engineer (or just plain bass-ackwards) since I could work a screwdriver. Everything I know is from taking the finished product and working backwards to find out just what and where the atoms are. I've always learned to crawl by jumping off the roof. Unfortunately, it leaves a lot of opportunity for gaping holes in the experience. I wouldn't recommend such a way of life unless you have a photographic memory or are severely OCD. I guess I'm 2 for 2 there, but whatever. I am sure he is always glad to help you, and me, because we are willing to learn. He's a nicer guy than he claims. And honestly, I'd pay money for a podcast of this. Not that I have any $$$, mind you... In many ways, Flash is a better platform. It sacrifices a lot of cross-compatibility in favor of performance. Not in general purpose computing, of course, but in graphics and animation specifically, which is what it is built for. As a result, Flash games dominate PC embedded gaming market, while Java gaming survives purely on cell phones, where targeting any one specific platform is not profitable. And it's not just the ease of scripting. Before Flash, people used Java on PC a lot more. You know, digital architecture nicely mimics biological architecture... the various languages tend to evolve to fill gaps in the overall environment to a lesser or greater degree. There will always be the ubiquitous, omnivorous mouse-like critters, and there will be highly specialized eating-only-one-berry-on-one-island types. Really, everything has its place in computing, just as it is in nature. I tend to think this is a direct result of the digital being engineered by the biological, "inheriting its properties and methods" as it were. I guess what I'm trying to say is that there's a time and place for everything, and what I grok from K^2 is something like "don't dabble at Intelligent Design unless you have godlike understanding of your Creation". I hope that's not too Zen. "I can just imagine him driving off the edge of a cliff like Thelma & Louise, playing his Q:13 mix at full volume, crying into a bottle." - Craig Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now