Author Topic: General Programming Megathread v2  (Read 4865 times)

pretty much for all the reasons the linux kernel is not.
You really want to argue with me on this one? :cookieMonster:

This is such an old debate and it basically boils down to the fact that Linus just plain doesn't like C++. You can use features of C++ that suit you and can not use others to make it easier on yourself. It's not impossible and actually it could be pretty favorable. At the same time you have to define the scope of the word "kernel", many kernel objects are written in C++ in Linux as well though the main base isn't.

Edit: Personally I think that the main reason that the *nix and Windows (at least the base parts of it) arent written in C++ is that the compilers just weren't as good as those of C a decade or two ago. Plain and simple. There are a few speculations but that's my own sentiment.
« Last Edit: May 14, 2013, 02:09:25 AM by dotdot: revolutions »

You really want to argue with me on this one? :cookieMonster:
not particularly. i'm super sleepy and programming arguments make my head hurt and are usually trivial. :(

personally if i were to write a kernel (i wouldn't) it would be in C because i'm a compatibility freak and overloading can be nasty, like the SO post i linked explained.

This topic got buried quick.


Some ruby code I did on http://ideone.com during lesson. I'm trying to build a comparison system for objects that return a string or something using duck typing for a project of mine. I might add a stack depth limit so it doesn't explode.
Code: [Select]
#node comparison system
 
class Node
    attr_reader :response
    def initialize(response = nil)
        #should fix this bit
        @response = response
        @child_node = nil
        @contents = nil
    end
   
    def learn(words,name = nil)
        if(name)
            @content_name = name
        end
        @contents = words.shift
        if(words.size > 0)
            @child_node = Node.new
            @child_node.learn(words)
        end
    end
   
    def compare(words)
        @contents_compare = words.shift
        if(@contents == @contents_compare)
            if(@child_node)
                return @child_node.compare(words)
            else
                return false if(words.size > 0)
                return true
            end
        else
            false
        end
    end
end
 
main_node = Node.new("Matched")
main_node.learn("HELLO".split(/\W+/),"test_nodes")
if(main_node.compare("HELLO".split(/\W+/)))
    puts main_node.response
else
    puts "No match."
end

Brian Smith needs to make a portfolio, and so far he doesn't have many good examples.
So far I have:

bldm-server  -  Basically a Simple TCP protocol for sqlite3, meant for Blockland.
chatticus - Me loving around with websockets, again.
Los Diablos - A game me and ottosparks have been programming
secretshare - me loving around with aes, recreating a stuffty version of onetimesecret
BriNET - A SocialNetworking Database Library I am proud of :) - uses sqlite3 and flask
SwagNotation - Converts text into integers into binary into SwagNotation (swag = 0, yolo = 1) - Creates some... weird stuff. And if you think im kidding: swagyolo
Voxy - a voxel engine I made
websocks - another websocket chat program I made. lol.

obviously this is not enough, so what else can I program? I can't think of much more guys. After I create a member searching function for BriNET everything in that list will be 100% complete.

i wanted to make a small game with someone but nobody i know wants to or can. :x

either that or i don't like them enough to work with them for extended periods of time.

Why is C the god of languages? How are C# and C++ different? Why are they so amazing? Why would anyone use anything else but C?
Why C/C++ are widely used:
They're old and they're close to the metal, and provide some features that can most other languages don't provide, such as manual memory management (which can be useful in some contexts).

Why people use stuff that isn't C/C++:
They're close to the metal and force you to do stuff that's often just a massive pain (such as manual memory management). There are also many programming styles that they don't adequately accomodate (such as functional programming, and in the case of C, object-oriented programming).

The thing is: Languages like C, C++ and C# all compile to Assembly. Essentially, they're just as fast. Unless you're using a terrible compiler.
C# doesn't. C# compiles to CIL (Common Intermediate Language), which is then assembled to a .NET assembly (which is then interpreted by the CLR (Common Language Runtime) which is a part of .NET or Mono), which is something entirely else than assembly code or machine code which C/C++ compiles to.

I know very little of Python, looks actually pretty easy to learn!
« Last Edit: May 17, 2013, 02:34:34 AM by Executive »

Why C/C++ are widely used:
They're old and they're close to the metal, and provide some features that can most other languages don't provide, such as manual memory management (which can be useful in some contexts).

Why people use stuff that isn't C/C++:
They're close to the metal and force you to do stuff that's often just a massive pain (such as manual memory management). There are also many programming styles that they don't adequately accomodate (such as functional programming, and in the case of C, object-oriented programming).
C# doesn't. C# compiles to CIL (Common Intermediate Language), which is then assembled to a .NET assembly (which is then interpreted by the CLR (Common Language Runtime) which is a part of .NET or Mono), which is something entirely else than assembly code or machine code which C/C++ compiles to.
also C++11 is pretty great. auto / smart pointers / strongly typed enums are the niftiest stuff ever.

also C++11 is pretty great. auto / smart pointers / strongly typed enums are the niftiest stuff ever.
You mean stuff that practically any other language has had for ages?

Auto (type inference): Not an issue in dynamically typed languages, already been in most other statically typed languages (notably not Java)
Smart pointers: Not really an issue in languages with GC
Strongly typed enums: Well, that's the point of enums, isn't it?

She ended up turning the comp org class into something a lot closer to a computer engineering class.
Uh isn't that what it is?

Learning C for my job. Is there anything like unix (or unix) that I can use that's just a coding environment/debug terminal that I can use a printf function in? Syntax highlighting would be nice but I don't need it

Learning C for my job. Is there anything like unix (or unix) that I can use that's just a coding environment/debug terminal that I can use a printf function in? Syntax highlighting would be nice but I don't need it
If you wanna get "fancy" you can always run GDB through the terminal. There's lots of graphical wrappers for GDB but I don't have any experience setting them up since I'm stupid hardcore.

And for small projects printf seems like a good and easy idea but it's a nasty habit to break yourself from. If you work on any large project you'll find that sprinkled printfs can cause severe headaches. Not only do they increase execution time, and you don't want that in time sensitive applications, constantly checking and recompiling and checking and recompiling adds a lot of time and burden to your development cycle.

I just need a text based output, or at the very least an environment where I can see the values of variables

printf is the greatest debugging tool of all. (that and malloc counting macros)

How dare you not include lua as a language, you disgrace the gaming community.