|
Doc Hawkins posted:I dunno about that. After all, here we are, reacting to it. I guess I'm just wondering if anyone who knows poo poo about development/CS/etc would ever want to hire someone this loving stupid. I don't even think anyone takes Joel Spolsky seriously anymore, other than that he helped found StackOverflow or whatever. e: Well anyone important anyway.
|
# ? Jan 24, 2012 05:12 |
|
|
# ? May 15, 2024 04:13 |
|
There's another whole side of metaprogramming: C even has a side of this, since it has no OOP by default. You can still get a lot of work done right out of the box, though. You don't have objects in C, but you can implement one. You can even get a little more advanced, and use more structures and function pointers to implement virtual methods. This is a simplified version, but this sort of system is the core of GObject. Of course, it's a little more advanced than this, because all those static sub_object_class things that I create don't exist (we have a system called GType). And of course GObjects have other things that modern OO environments have, like properties (which are somewhat of a mess to write right now, but people are working on it) and signals (the latter involving a whole generic "Variant" type called "GValue", and a marshaller system so that you can call function pointers with the right arguments). There's a lot of cool tricks in GObject, some of them on the line between "awesome" and "horror", and if people are interested, I'll explain this stuff.
|
# ? Jan 24, 2012 05:21 |
|
If I were making this point, I would say that Lisp is not a language because it's really many languages that people have idiosyncratically invented at every place that deploys Lisp, which is furthermore all-too-often synonymous with having a home-rolled Lisp interpreter and runtime. That would be a fair critique of the wildly fragmented Lisp ecosystem, where moving from site to site often might as well involve picking up an entirely new language. What he actually wrote is either badly mangled or open trolling of the Lisp community.
|
# ? Jan 24, 2012 05:24 |
|
Suspicious Dish posted:There's another whole side of metaprogramming: C even has a side of this, since it has no OOP by default. You can still get a lot of work done right out of the box, though. I've browsed through the GObject documentation a bit but still don't entirely comprehend it all. It seems like a lot of it relies on how C requires structs to be laid out in memory though.
|
# ? Jan 24, 2012 05:28 |
|
Look Around You posted:I've browsed through the GObject documentation a bit but still don't entirely comprehend it all. It seems like a lot of it relies on how C requires structs to be laid out in memory though. Very much so. The whole subclass casting thing relies on how things are laid out in memory. Here's a diagram: code:
If we have a SubObject *, it's saying that it's pointing to something that's 8 bytes long, and let's say, in memory, that's at 0x12340000. But since the structs are nested, there's also a valid BaseObject * at that location. Casting to a BaseObject * simply changes the pointer's size - it doesn't change the pointer's location at all. So inheritance is done by nesting structs. As we nest, the structs cannot get any smaller, and because the parent class is always the first item in the struct (at offset 0), as we nest and nest, if you unfold out the structures, the base class is always at offset 0 in memory: code:
|
# ? Jan 24, 2012 05:39 |
|
Suspicious Dish posted:Very much so. The whole subclass casting thing relies on how things are laid out in memory. Doesn't C++ have the same implementation?
|
# ? Jan 24, 2012 05:45 |
|
BonzoESC posted:Doesn't C++ have the same implementation? C++ has multiple inheritance, which automatically means it can't be quite that straightforward. It's a similar sort of design, though.
|
# ? Jan 24, 2012 05:49 |
|
BonzoESC posted:Doesn't C++ have the same implementation? Yeah, multiple inheritance fucks poo poo up. I'm pretty sure GObject uses vtables though which I think most C++ compilers use for virtual functions.
|
# ? Jan 24, 2012 05:55 |
|
Look Around You posted:Yeah, multiple inheritance fucks poo poo up. I'm pretty sure GObject uses vtables though which I think most C++ compilers use for virtual functions. Sort of. It puts vfunc declarations in the class structs, and has subclasses install their own overrides in the class_init.
|
# ? Jan 24, 2012 06:13 |
|
GObject: for when C++ just isn't complicated enough.
|
# ? Jan 24, 2012 06:28 |
|
Look Around You posted:What the gently caress is this poo poo? Like I honestly have no idea how he's saying that a turing complete language that's actually pretty powerful despite having a simple syntax isn't a language. As far as I can understand, his argument is that any language that doesn't have a built in ____ (an object system, say), but instead has enough flexibility that users can roll their own ____, will result in everyone implementing their ____ a different way and this results in it not really being a language because . More generally he seems to be arguing that a programming language designed (or used) primarily for implementing DSLs is not actually a programming language, which is (a) crazy and (b) irrelevant because JavaScript isn't such a language anyways. Plorkyeran posted:Lua has syntax and features explicitly intended for prototype-based OOP. Works pretty well for class-based OOP too, although that needs a bit more underlying code.
|
# ? Jan 24, 2012 06:36 |
|
I may never forget the day our lead developer said "Why bother learning Javascript when you can just use JQuery?"
|
# ? Jan 24, 2012 06:41 |
|
re: that loving blog It's amazing how many words you can get out of No True Scotsman.
|
# ? Jan 24, 2012 11:12 |
|
Doc Hawkins posted:I may never forget the day our lead developer said "Why bother learning Javascript when you can just use JQuery?"
|
# ? Jan 24, 2012 12:51 |
|
Doc Hawkins posted:I may never forget the day our lead developer said "Why bother learning Javascript when you can just use JQuery?" Sounds like a good policy.
|
# ? Jan 24, 2012 13:15 |
|
tef posted:re: that loving blog How is trainspottingland these days btw?
|
# ? Jan 24, 2012 15:36 |
|
musclecoder posted:Could probably also use call_user_func_array() for slightly cleaner code. That's what I ended up doing in the end. I'd forgotten about it until I needed to change another piece of code that called arbitrary functions with variable numbers of parameters (which I'd also set originally to use some 'exec' horror, only which an even more horrible function which flattened arrays into a string that looked like parameters to pass to a function. Ugh. I hate 4 years younger me) Anyway, when I was looking up the half remembered "there's a way to do this 'properly'" I remembered that there was also a better way to call arbitrary functions. All in all, the code is actually reasonably understandable now. bobthecheese fucked around with this message at 15:33 on Jan 25, 2012 |
# ? Jan 24, 2012 16:19 |
|
rjmccall posted:If I were making this point, I would say that Lisp is not a language because it's really many languages that people have idiosyncratically invented at every place that deploys Lisp To get pedantic, Lisp is not a language because it's not a language, it's a family of languages.
|
# ? Jan 25, 2012 08:23 |
|
dancavallaro posted:To get pedantic, Lisp is not a language because it's not a language, it's a family of languages. Lisp isn't a language, it's a way of life, maaaan.
|
# ? Jan 25, 2012 12:17 |
|
Getting started writing ReSTful Web Services with the ZWVP* platform. *z/OS, WebSphere AS, VSAM+CICS, PHP
|
# ? Jan 26, 2012 01:51 |
|
1337JiveTurkey posted:Getting started writing ReSTful Web Services with the ZWVP* platform. At that point I'd just hang myself with my own underwear.
|
# ? Jan 26, 2012 04:29 |
|
Using Java to integrate between PHP and COBOL, fricking awesome.
|
# ? Jan 26, 2012 04:53 |
|
Two horrors I've encountered, both php based. I'm still getting my feet wet with php so I don't know how horrorful they really are. First: code:
Second: Not really code snippetable. This ecommerce setup has a review system, with random reviews being displayed on every page. The url generated if someone clicks on the random review is: review.php?refer=currentpage.php&review_id=y . The problem? The random reviews are also shown on the review page itself, and there's no sanity checking. So you end up with url's like: review.php?refer=review.php&review_id=5&review_id=10&review_id=30 and so on and so on in an infinitely recursive loop. The page itself renders fine regardless so it never 404s. However, from an SEO perspective this situation is hot death. Several hundred thousand supposedly unique URLs indexed, that have the same content, description, and title? Sign me up Google! The best part is, review.php was hosed up anyway, and would just show all reviews regardless of what was in the query string. Because the review_id variable was never set (see First problem).
|
# ? Jan 26, 2012 22:50 |
|
Scaramouche posted:Two horrors I've encountered, both php based. I'm still getting my feet wet with php so I don't know how horrorful they really are. Turn up error reporting (error_reporting(E_ALL)) and it'll give you an Undefined variable notice.
|
# ? Jan 26, 2012 23:04 |
phpFreeChat. It's an AJAX-based webchat thing, obviously with a PHP backend. I don't know much about its internals, I just know that the version I'm exposed to doesn't work on IE9 unless you enable some compatibility modes. They like dynamically generating stuff, so they make sure to dynamically generate stuff to dynamically generate more stuff. In particular, the IE9 problem is caused by some (more or less) dynamically generated CSS not being inserted properly on the page. (It does work in IE8 or IE7 compatibility modes.) How the CSS is supposed to be generated: Some running JS dynamically fetches some PHP page. Said PHP page dynamically generates some JS, which is eval()d by the fetching thing. (This is not JSON, it's straight JS.) This dynamically generated JS contains a bunch of code that builds a hashmap of CSS selectors to CSS rules. (Nothing is dynamically built here, it's just plain strings.) This hashmap is then iterated over and every key/value pair is fed into a class that uses DOM to insert singular text nodes in a dynamically inserted Style element in the head. I wonder what's wrong with <link rel="stylesheet" type="text/css" href="whatever.php">. It also makes extensive use of UA detection rather than feature detection.
|
|
# ? Jan 27, 2012 00:44 |
|
nielsm posted:phpFreeChat.
|
# ? Jan 27, 2012 01:15 |
|
edit: gently caress
Beef fucked around with this message at 18:59 on Jan 27, 2012 |
# ? Jan 27, 2012 11:37 |
|
Probably, since:Poop Delicatessen, four days ago posted:Here's a lightning talk about why JavaScript sucks (and a few things about Ruby, too) that sheds more light on why JavaScript is an awful, awful language.
|
# ? Jan 27, 2012 17:43 |
|
code:
|
# ? Jan 27, 2012 22:12 |
|
Working with a certain ASP based shopping cart has become a daily horror for me and my coworker. First bug of today, customers can only change their email when it is forbidden: code:
Hibame fucked around with this message at 08:52 on Jan 28, 2012 |
# ? Jan 27, 2012 23:29 |
|
PraxxisParadoX posted:Turn up error reporting (error_reporting(E_ALL)) and it'll give you an Undefined variable notice. This is something you can argue either way; plain $variables should be initialized, but at the same time it basically means you have to wrap every single reference to a GPC variable with isset(). If there was a way to turn off undef notices for $_GET and friends I would constantly leave that error level on, since you're not meant to initialize those yourself.
|
# ? Jan 28, 2012 06:55 |
|
edit: I'm a big huge retard who doesn't think before he posts when he's tired and poo poo Mozilla is developing a new language called rust. It seems to aim to be sort of C-ish but with new features kind of like Go I guess but unlike Go it's incredibly incohesive. Interesting facts from their tutorial
It looks like it has some potential but it seems to have an identity crisis. It's trying to be a bit of everything but it doesn't seem to fit heavily in anything. Unsafe pointers, but a heavy functional emphasis. It's hard to tell exactly what they're getting at and in the end it just looks like a mash of line noise like perl. I guess my biggest issue is that in trying to make it look like C/C++ it really betrays it's highly functional nature. I just really don't know where they're going with it. example from their standard library: code:
edit: Well after sleeping a few hours I realize that I guess () can be an empty tuple, which the language does have. I still stand by it being a bit of an abuse of notation though. Look Around You fucked around with this message at 14:24 on Jan 28, 2012 |
# ? Jan 28, 2012 07:46 |
|
What's that quote again about informally-specified, bug-ridden LISPs?
|
# ? Jan 28, 2012 11:14 |
|
"Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp"?
|
# ? Jan 28, 2012 11:56 |
|
Look Around You posted::post full of human horrors: Advanced programming languages are advanced. All these features are reasonable.
This lets you write blocks that return nil without having to write an extra nil expression. Also this helps catch type errors, for example if one block was written to return nil while another does not. If you didn't have this feature then every if/then/else block would need extra nil statements, or a special case in the language. Do you notice how this feature does no harm to the user? And how you're bitching about it?
You think global constants shouldn't have their types explicitly declared? No. Rust is for writing correct programs, not wrong programs.
You're seriously bitching because they chose a different syntax instead of the keyword you might choose. Don't they have tuple types? They would have tuple types. This is probably consistent with that, the way they are in most functional languages. If you think this looks like a lisp-ish construction you need to learn Lisp and you also need to learn some other languages, because it is an obvious non-lisp construction.
fmt can't be a plain function obviously because then it couldn't be statically typed, it would be a variadic function which is bad. Also you get the usual crap with the need for va_list versions of all your functions.
You're saying that as if silently falling through would be a good thing. Which it is not. Crashing the program there is basically the only thing to do. In our C++ code every switch statement has a default case that calls a function unreachable() which prints a backtrace and crashes.
This is a good thing. It's called an advanced type system.
Yes it does. quote:It looks like It looks like you don't do systems programming and don't know what you're talking about.
|
# ? Jan 28, 2012 12:00 |
|
I thought they would have gone with Vala if anything. Good to know alternative languages are always being investigated though.
|
# ? Jan 28, 2012 12:28 |
|
shrughes posted:Also you get the usual crap with the need for va_list versions of all your functions. This isn't a flaw in the concept of variadic functions, it's more a problem with how C handles them. It's quite fixable even without the foo/vfoo stuff if you're aware of the issue when you're actually designing the language.
|
# ? Jan 28, 2012 13:09 |
|
Look Around You posted:Mozilla is developing a new language called rust. I like rust. The design seems to come from years of dealing with c++ programmers who think they know better. quote:unlike Go it's incredibly in cohesive. Oh You! Does this mean go is cohesive? quote:I just really don't know where they're going with it. memory & type safe systems programming. that thing you can't do in c++, c or most functional languages.
|
# ? Jan 28, 2012 14:15 |
|
shrughes posted:stuff making me look dumb Especially the blowing up thing, I definitely didn't think that through at all. Basically posting tired is stupid and makes you look stupid. e: tef posted:
Yeah I'm basically retarded and thought things through like not at all and ended up making an rear end out of myself posting like an idiot at 2 am. Look Around You fucked around with this message at 14:21 on Jan 28, 2012 |
# ? Jan 28, 2012 14:19 |
|
|
# ? May 15, 2024 04:13 |
|
Look Around You posted:Macros/macro functions are specifically set off by a #. Example: std::io::println(#fmt("%s is %d", "the answer", 42));. This has potential but still strikes me as a bit awkward and unnecessarily leaking implementation details into code (why can't fmt just look like a plain function?). Somebody's never included <Windows.h> and had to deal with nonsense error messages while trying to compile calls to std::max and std::min, or while trying to declare enum Distance { NEAR, FAR }; only to find they have been boned by all the windows #defines.
|
# ? Jan 28, 2012 14:22 |