Language:
switch to room list switch to menu My folders
Go to page: First ... 108 109 110 111 [112] 113 114 115 116 ... Last
[#] Sun Mar 15 2015 08:47:20 EDT from dothebart @ Uncensored

Subject: Re: Does this guy have a point?

[Reply] [ReplyQuoted] [Headers] [Print]

 

Sat Mar 14 2015 15:45:29 EDT from TaMeR @ Uncensored Subject: Re: Does this guy have a point?
On 03/14/2015 04:32 PM, dothebart wrote:

Try c with templating engines - we have that in webcit, its nice!
Which templating engines do you use?
Webcit nice?

I think webcit enables you to easily write clean, maintainable and slink
code.
Are you talking about citadel webcit?

Yes, citadel webcit.

It lives inside subst.c, simple client code can be found i.e. in who.c + static/t/who.html plus static/t/who/*



[#] Sun Mar 15 2015 20:36:06 EDT from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


I find C++ to be a rather fun language with which to program... but I'm probably a sick puppy. Well, also, I've been using it long enough, I suppose, that it feels more natural to me than it does for some folks. I do things with it that sorta make it look easy to use, perhaps.

I sorta feel like C leaves you exposed to a lot of security problems unless you're extremely meticulous with it. I get that some folks want to have a good idea what the underlying assembly will look like, so they might prefer c to c++, but that's never seemed so important to me, for the sort of work I've done.

Using an abstract data type with C probably helps... where you sort of work with C as it it had classes. I think the gtk+ toolkit shows a decent example of that.

JavaScript looks rather fun, what I've done with it in browsers. It has that feel like a fast-and-loose C/C++ that you can get away with some crazy stuff. I suppose that's one of the advantages of a scripting language.

Python felt kind of natural to me, although I don't think I ever quite wrapped my mind around some oddnesses related to how it imports libraries you may have made with it (and interdependencies with other libraries). I recall having some problems with that, although now that I'm more experienced, it might not be as much trouble for me.

But then, I guess I like to think about software in terms of manipulating objects rather than writing functions.

[#] Mon Mar 16 2015 05:49:49 EDT from TaMeR @ Uncensored to room_Programming@uncensored.citadel.org

Subject: Re: (no subject)

[Reply] [ReplyQuoted] [Headers] [Print]

On 03/16/2015 02:36 AM, fleeb wrote:

But then, I guess I like to think about software in terms of manipulating
objects rather than writing functions.



Well how do you manipulate objects? With functions right?
Even if you call them methods or what ever, they are still functions.

Why not think of the DOM as your objects?

Although most people program Javascript functional. Javascript isn't
really function based, everything even functions are objects.

Javascript is probably the post flexible programming language.
If you stop looking at the main stream, you can adapt a style that fits you.
At first glance my code doesn't even look like Javascript.

Example, following code imports script and css files.

'use strict'
if(typeof $ != 'object') var $ = {};

$.src = {};
$.src.css = function (name, path){
$.src._path = (path) ? path : '/css/';
$.src._ext = 'css';
$.src.array(name);
}
$.src.js = function (name, path){
$.src._path = (path) ? path : '/js/';
$.src._ext = 'js';
$.src.array(name);
}
$.src.async = function (){
$.src._boolean = 'async';
}
$.src.defer = function (){
$.src._boolean = 'defer';
}
$.src.array = function(name){
if(Object.prototype.toString.call(name) == '[object Array]'){
for (var i = 0, l = name.length; i < l; i++) {
$.src.file(name[i]);
}
}else{
$.src.file(name);
}
$.src._path = undefined;
$.src._ext = undefined;
$.src._boolean = undefined;
}
$.src.domain = function (list){
if($.src._d) return $.src._d;
for (var i = 0, l = list.length; i < l; i++) {
if(window.location.hostname.indexOf(list[i]) > -1) {
$.src._d = list[i];
return $.src._d;
}
}
}
$.src.file = function (name){
var s;
var link = 'http://static.' + $.src.domain() +
$.src._path + name + '.' + $.src._ext;
if($.src._ext == 'js'){
s = document.createElement('script');
s.setAttribute('src', link);
s.setAttribute('type', 'text/javascript');
if($.src._boolean){
s.setAttribute($.src._boolean, $.src._boolean);
}
}else if($.src._ext == 'css'){
s = document.createElement('link');
s.setAttribute('href', link);
s.setAttribute('rel', 'stylesheet');
s.setAttribute('type', 'text/css');
}else{
console.log('import failed');
return;
}
if($.src._boolean == 'defer'){
document.onreadystatechange = function () {
if (document.readyState == "complete") {
document.body.appendChild(s);
}
};
}else{
document.head.appendChild(s);
}
}

[#] Mon Mar 16 2015 15:34:46 EDT from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


Yeah, of course you have to call functions to do anything. But it's more about how you approach solving a given problem.

Do you look a problem and say something like, "I can call this function, then this one, then this," as a sort of series of instructions towards achieving a goal?

Or do you instead look at the problem and try to figure out the components of the problem... I'm using a network to communicat with an HTTP server that will poot out an XML file that holds information about a person, and I want that person's eye color to be given to this object so it'll know the response to give to this other thing over here. That's usually how I look at a system, at least one of any appreciable size, and I normally model my software along those lines.

There's nothing wrong with either approach. It's ridiculous to think about objects and modeling systems and shit when you just need some down-n-dirty thing done rather quickly and you already know the steps it takes to do it. But if you know you're working with a system that's going to grow to something of appreciable size, maintaining that quick little Python script you tossed together when the boss was breathing down your neck is gonna drive you insane.

[#] Tue Mar 17 2015 13:05:17 EDT from IGnatius T Foobar @ Uncensored

Subject: Re: Does this guy have a point?

[Reply] [ReplyQuoted] [Headers] [Print]


I think webcit enables you to easily write clean, maintainable and slink
code.
Are you talking about citadel webcit?

Yes, citadel webcit.

It lives inside subst.c, simple client code can be found i.e. in who.c + static/t/who.html plus static/t/who/*



I don't know about that ... it seemed like a good idea at the time but the more it evolves, the more hackish it seems.  It works for us but it really does stretch out the time it takes to complete any given task.  If I were starting over today I wouldn't do it that way.



[#] Mon Apr 06 2015 13:32:17 EDT from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


Just had an interesting philosophical argument related to C/C++ that I thought I'd share.

Is this a simple data type, or complex:

int a[13];

I want to say that an array of primitives is simple, but... I could argue that it isn't simple as well. What do you think?

[#] Mon Apr 06 2015 15:17:33 EDT from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


It's a *composite* data type. An array of primitives is not a primitive any more!

[#] Mon Apr 06 2015 15:19:04 EDT from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


Any more?

[#] Mon Apr 06 2015 15:20:43 EDT from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


"Anymore". That's a composite *word*...

[#] Mon Apr 06 2015 15:23:18 EDT from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


Heh... composite word...

[#] Mon Apr 06 2015 15:23:00 EDT from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


I mean... you'd think a composite is composed of different data types, like a struct or class with int/long in it or the like.

But then, if you have a struct with int/int in it, from the machine code's perspective, it's an array of 2 ints, while from a language perspective it's a struct with two ints.

Just making it an array of any type is a composite, regardless of how you don't mix the types.. or even if you use a primative? Can it only be 'simple' if it is strictly a primative?

[#] Mon Apr 06 2015 17:05:23 EDT from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


"Just making it an array of any type is a composite" yes, because a primitive is the lowest-level construct. If you have more than one of 'em, it ain't that anymore.

[#] Mon Apr 06 2015 17:07:42 EDT from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

[#] Tue Apr 07 2015 08:30:58 EDT from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


I suppose.

Although I feel I could go the other way on this, in that it feels there's something particularly 'simple' in an array of ints vs. an array of objects, or an array of pointers to objects.

Functionally, though, I expect 'simple' and 'primitive' probably ought to have the same meaning.

[#] Sat Apr 11 2015 13:44:45 EDT from IGnatius T Foobar @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Heh. Unless you're now ready to have the "what does it compile down to" discussion, it's just games with words.

[#] Sun Apr 12 2015 07:19:54 EDT from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


Yeah, pretty much.

[#] Mon Apr 20 2015 12:37:49 EDT from dothebart @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

[#] Mon Apr 20 2015 16:24:05 EDT from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


Ford touched on some of this elsewhere, although he focused on some othe rlanguage, I think.

The committee has been trying to make C++ easier to use for a while now, and these last few iterations of the language have primarily been geared to making the language friendlier to use.

I have to admit, though, I didn't know about some of these changes. Interesting.

[#] Tue Apr 21 2015 16:03:03 EDT from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

The committee has been trying to make C++ easier to use for a while

AHAHAHAHAHAHAHAHAAAAAAAA HAAAA HAAAA

[#] Tue Apr 21 2015 16:21:20 EDT from wizard of aahz @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Isn't the committee going to be first up against the wall after the revolution?

Go to page: First ... 108 109 110 111 [112] 113 114 115 116 ... Last