« first day (1834 days earlier)      last day (3108 days later) » 
00:00 - 17:0018:00 - 00:00

12:05 AM
@Kevin a bit slow, but still pretty awesome // in response to your sin/cos/tg/ctg stuffs
 
12:41 AM
Any djangopeeps in here?
when serving up a django project on apache, and you want to test something in real time and see it in the console
how do ya do that?
 
1:31 AM
So, Gin and Ginger Beer might be my new drink of choice. I think the trick is getting good ginger beer.
 
1:42 AM
I'd like to write a basic online chat program. Any library recommendations? I looked at Twisted and its forks but it seems to be partially stuck in Python 2.
 
For a "basic" chat program, it hardly seems that you would need any libraries at all.
 
The goal is just to be able to pass strings over the Internet between two computers running my app.
I've never really grasped this stuff with sockets and ports, and I'm concerned about violating some kind of basic security principles that I'm not aware of.
 
I hardly think security is the first thing you'd need to consider, at least. :)
Sockets and ports aren't particularly tricky to begin with, and either way I don't think any library is going to do away with them as such.
You very much think of a socket as a file, only that what you write to it goes to the other end instead of to the hard drive.
You can* very much
 
1:59 AM
I don't mean "app's gotta have top security for secret messages!" but rather "your users can only use this junk if they disable their firewall" or something.
 
Nah, that's not usually a concern.
 
Would users have to mess with IP addresses and sockets and ports? Any hard-coding involved?
 
Well, no more or less than for any other network-based program, at least.
If you want to connect to another computer that doesn't have a DNS name, then of course you have to use an IP address instead.
But, again, I don't see that being any different from any other program.
As for ports, you can choose whether to use a hard-coded one, or make it explicit. The most common solution is to use a "default" port and allow users to override if they need to.
Like you how can optionally specify a port in HTTP URLs.
 
Would it be substantially more complex to have some kind of central server that takes care of the IP address and port stuff for users?
 
Depends on your program and what else it does, of course.
And, for that matter, what you mean by "taking care of" it. :)
Either way, it's not necessarily very complex, but it doesn't seem like the considerations you have to begin with anyway.
 
2:04 AM
I mean, when you use Skype or something, you generally don't need to know what a port is.
 
If you want to learn network programming, you should probably just start by getting two computers to talk with each other at all. ;)
 
That's all I want them to do. :P
Should I start with import socket and go from there?
 
Yeah, pretty much.
Just talking between each other is pretty simple in itself.
For example, just run pastebin.com/WNpRbxpt in one Python instance, and pastebin.com/v9ZgVJFe in another.
The first is the "server", and the second the "client".
 
2:27 AM
I'll look into what all those lines mean, thanks. :)
 
3:06 AM
cbg
 
cbg
 
cbg!
 
3:31 AM
Congratulations to @vaultah and @TigerhawkT3 for getting their Python gold badges! Congrats!
 
applause
 
I have hammered many things.
 
Just nailed it as a dupe.
This guy really seems to be phoning it in: stackoverflow.com/users/846381/david?tab=questions
 
4:16 AM
@tristan still up?
oops, nevermind, thought you just joined the room based on where I saw your avatar (2nd after mine)- but now it's gone all the way across the screen somehow.
 
4:49 AM
Every programmer should have to watch this computer explaining why it does things:
 
Nik
Hey guys, I'm screwing up in this code somewhere. It isn't working as it's supposed to.
If I escape the last while loop out of the last for loop, then the last song in the directory is played while all others are skipped.
 
Nik
5:11 AM
Whoops, sorry. Just a mistaken indent. Running the .py file directly doesn't show the error. Had to run it from the terminal to see.
 
Should I close this as a dupe of this, or just answer it? I'm thinking if I hammer it the OP will be like "but teh codez, give dem."
 
wim
with gold badge comes great responsibility :)
not a good dupe target
find a simpler one that is not about matplotlib
 
Nik
@wim :( it's sad when that doesn't work the other way around.
 
wim
@unutbu how you got so much wizardry with numpy !!
 
But that one just has a ton of ways to put a variable into a string...
It's the one I've been using as canonical. Have I done a bad?
 
wim
5:34 AM
I think it's not good, the accepted answer doesn't even use the modern recommended way (str.format) because it's from >5 years ago when people still used the crappy % formatting
surely there must be a better Q&A for string templating !
 
@JonClements what do you think of autoebid.com? I only saw them because What Car? linked to them
 
I think I almost have League of Legends running on a seven-year-old Windows XP netbook...
 
Nice. It's a pretty light game but even so :)
 
Its framerate is bouncing between 0.5 and 1.2, more or less.
I paused a spectated game and things are still moving around.
All the video settings were at the highest... I'm having trouble even navigating the menu. I may have to edit the .ini.
 
5:51 AM
Lol
On this old work laptop I run HotS on very low settings
Still looks fine
 
How to go back to the prev method in pycharm? I know how to go forward by clicking ctrl + method name but I don't know how to move backward.
 
In Eclipse it's alt-leftarrow :)
 
won't work in pycharmm..
 
6:19 AM
I develop with Notepad++ and cmd. Am I a hipster?
Reduced all settings to minimum and set resolution to 512x300... two FPS!
 
6:50 AM
cbg
ubuntu 1510 = tehsuck
 
Nik
In my program, is there any way to pause, stop and rewind without threading or using display? I wish there were more stuff like KeyboardInterrupts
 
and I like there were switch statement T_T
 
 
1 hour later…
8:04 AM
That awkward moment when your sliding puzzle is apparently accidentally unsolvable. Sometimes.
 
 
2 hours later…
9:57 AM
cbg
 
10:17 AM
@AnttiHaapala it is true in general about ubuntu => why not take arch for a spin?
(it is probably the best* GNU/Linux distro out there -- once you managed to install it :P)
*most flexible, most minimal, most pure, best for cutting-edge development, etc.
 
no thanks, it is not called Argh linux for nothing :D
nothing wrong with the debian world but the Ubuntu way of dumbing things down makes fixing problems really hard
now there was a bug with Unity, I do not know which bug it was, and how did I fix it, but I did fix it but it took like 2 hours.
 
@AnttiHaapala Personally I just stay with Debian.
 
maybe it was a problem with compiz...
 
Arch might be Ok, though. People say good things about it. Gentoo is also a possibility.
 
argh is not ok and neither is gentoo.
both put too much bleeding edge...
and with argh you need to constantly update
it'd mean that I'd have to install a different OS on my servers.
 
10:24 AM
cabbage
Hey Antti, this decorator code was linked here the other day by its author (metatoaster) who was wanting some feedback. I told him that it looks intriguing, but I'm not a decorator expert, and I suspect there may be a better way to do what the OP wants. I'd be interested in hearing your comments. However, there is a fair amount of code there, so I totally understand if you don't want to take a close look at it. :)
 
10:40 AM
CentOS \o/
 
@PM2Ring there is no better way to do what the OP wants
(except of course that the OP should not want that at all) :D
 
@AnttiHaapala Good call. :) Sorry about the delay - I was writing an answer... to another question where the OP's desires are dubious. :) stackoverflow.com/q/33316926/4014959
 
11:16 AM
@FaheemMitha gentoo is not really useful in real life => you don't really want to compile every single bit of your softwares all the time.. I mean, the performance you gain with it is just neglectable..
 
cbg
 
cel
gentoo is actually very useful! It will prepare you for the frustrating parts of life :)
 
What's the difference between proxy and delegation in classes ?
 
@PeterVaro It's more about the flexibility, I think. If you want custom versions of things. But I agree about the undesirability of having to compile everything.
 
@AnttiHaapala I'm using arch ~18 hours a day for the last 450-500 days on 3 different machines (home, work, work-mobile) => during this period of time, I only had to fix 2(!) bugs because of the bleeding-edge, daily updates
 
11:17 AM
If you happen to want stuff compiled with non-standard options, it might make sense for you.
 
both of them were realted to X => so I don't think that really is a problem
@cel LOL
 
@PeterVaro Impressive. How does Debian compare?
 
@FaheemMitha I'm using debian (raspbian) on raspberry pis only (7-8 of them) and they are very stable, but, I'm not updating them daily, as updates are not shipping daily
 
@PeterVaro Ok.
 
cel
I think the rolling release strategy of arch and gentoo are really awesome compared to the release based distributions
 
11:19 AM
I only use Debian. I have little experience with Gentoo, and none with Arch.
 
it was a true frustration though, that I had to switch package repositories from wheezy to jessie to get packages from this decade :P
 
@cel There are pros and cons.
 
cel
@FaheemMitha, well obviously. Basically for everything in life :)
 
@cel Agreed.
 
cel
I used gentoo for 2 years
it's cool because you learn a lot about unix systems
 
11:20 AM
@FaheemMitha but ofc, if I have to use a distro on a production server, I would probably use Debian, just to avoid the constant maintainence
however I'm using Arch for my home server (too) (on a BeagleBone Black)
 
cel
but you will spend a LOT of time fixing weird bugs
 
@PeterVaro Well, Debian scales well across many servers. And it's very stable. And has a ton of packages. And its quality control is second to none.
@cel In what? Oh, Gentoo?
 
cel
yes
 
I know, that's why I would use it in high performance production environment
@cel same goes to arch for me as well => I jumped into GNU/Linux from a decade spent with Macs
now I'm not scared of anything :)
 
cel
Haha, I switched to mac recently
 
11:23 AM
orly? why?
 
cel
getting a good notebook that works well with linux is a pain
 
I'm using a MacBook Air now, with Arch Linux
 
cel
haha
that is evil
 
and guess what, ONLY the wifi is playing tricks on me sometimes, but nothing unsolveable
but I'm willing to buy this machine (I think the best notebook for GNU/Linux): cnet.com/products/dell-xps-13-non-touch-2015
 
cel
I totally understand people who dislike OSX, but one has to admit that the hardware is awesome
 
11:26 AM
size of an 11" notebook, packed with a 13" retina display
(it can also come with Ubuntu preinstalled, but I don't care about that)
it is super slim and light, while very durable
 
cel
had a dell xps before that, but was not very happy with it
 
AND has matte display.
@cel what was the problem?
 
cel
gentoo mostly
 
@cel I'm coming from an "Industrial Designer" && "Jewellery Designer" background -- so tell me 'bout it ;)
@cel LOL
 
cel
well configuring fans was very messy
and at some point I decided that I will try a macbook
and at the moment I am quite happy
 
11:29 AM
MacBooks have nice hardwares, but IMO still not worth the extra money you have to pay for the bigger SSD and RAM, etc. (which you really want to have)
not to mention the whole 10.1x series of OS X
 
cel
yea, it's very very expensive
 
I'm using Macs, since they were powered by Motorola, since Tiger I guess? (10.4, maybe 10.3 I can't remember)
 
cel
bought this one 1 year ago
 
and until 10.7 it was amazing: better features every year or so, better performance, everything became better and better
but at around 10.8 they started to dummify their OS, it started to became a memory hog, and I finally get enough of all the limitations it had.. and that's when I started to looking for an alternative
the other side of the story was: I truly wanted to get FOSS on my machine
well, anyway, if you get sick of OS X, you can always install Arch on it: wiki.archlinux.org/index.php/MacBook :P
 
cel
haha
I really need to try arch at some point
 
11:33 AM
(even the keyboard lighting, the display brightness, everything is working just as it should)
 
cel
maybe a raspi is a good idea to try
even the keyboard light? amazing!! :P
 
@cel oh it is, but remember ALARM (arch linux arm) is not "official"
it is wokring great, and I found every package I ever wanted to use on a RPi or BBB -- I just thought it worth mentioning this ;)
 
cel
definitely have to try at some point. Time is the limiting factor i guess :)
 
-- for all of us :)
 
@direprobs The proxy and delegation patterns are closely related. Have you read the Wikipedia articles en.wikipedia.org/wiki/Proxy_pattern and en.wikipedia.org/wiki/Delegation_pattern ?
 
11:38 AM
@cel (what I meant to say was: with the proper media buttons, and with GUI notifications, just as with OS X)
 
@PM yes I read wiki
still not able to grasp the idea
 
@direprobs Sorry about the delay. I see that you've asked a question on the main SO site in the mean time. Theory questions like that tend to get closed on SO - it might be appropriate for SE Programmers, but I'm not very familiar with that site.
Briefly, delegation is when a class hands off some of its functionality to another class. A proxy class is essentially a wrapper around another class, so the proxy class delegates the main part of its functionality to that other class, with the proxy class only handling minor duties - its main purpose is to present a uniform interface to the calling code.
 
12:00 PM
@PeterVaro what problems with wifi
sometimes the networks are not scanned fast enough...
so I scan them on command line
 
12:13 PM
On the Hot Meta list: OP's 1:st edit made answers wrong, 2:nd edit added a solution aka The Attack of the Demented Chameleon.
 
@PM2Ring so technically there's a slight asymmetry between the two ? It's about the amount of delegation (some) & (main), this means that a delegation means a class delegates (some functionality) to another class, but a class wrapper or proxy delegates most of it functionalities to another class, just like the code I posted here: stackoverflow.com/questions/33317701/…
 
stackoverflow.com/q/33318019/770830 - make my homework for me.
 
Yes, that CustomInt can be considered to be a proxy class. Delegation is a general technique, being a proxy is specific (and extreme) application of delegation
 
@PeterVaro they're really nice. Other bezels look really clunky now
 
I should move the Q to SE programmers I guess
 
12:24 PM
@bereal I CV'ed and commented before I noticed that it wasn't Python. OTOH, that should be closed ASAP before some rep-hound does that kid's homework for them...
 
cbg all
 
12:45 PM
@direprobs the difference is that if a Foo is proxy for Bar, the Foo must provide the full interface of Bar but it can intercept some method calls...
the real delegation means that a Foo delegates some of the work to Bar class
 
@AnttiHaapala I got you
 
IOW: proxy: Foo is a thin wrapper over Bar, providing the interface for Bar.
delegation: Foo has the interface of Foo, and to do some of its functionality, it forwards some method calls to a given Bar object
en.wikipedia.org/wiki/Proxy_pattern <- this even uses the word "delegate" there in the UML chart, though I wouldn't
 
Cabbage all! Question: a Tkinter grid's rows and columns expand to accommodate their largest widgets, but if you remove the largest widget they don't shrink back. How do I make it do that?
 
1:01 PM
Dupe hammered.
 
@TigerhawkT3 It's a pleasure doing business with you. :)
@TigerhawkT3 Allegedly, this will force the root window to remap its widgets: root.wm_geometry("")
 
I'm two rep away from joining the close vote party. :) yaay
 
@idjaw Welcome to the club. :)
 
1:18 PM
@PM2Ring awesome! Thank you so much. :) You are wonderful.
 
:) You should've spoken up sooner...
 
@PM2Ring Doesn't seem to do anything.
 
@TigerhawkT3 Oh well. Can you post a MCVE ? There's a grid_propagate method, but I assume you haven't disabled propagation.
 
@PM2Ring I was scrolling up and noticed there were a couple cv-pls. Now to learn how to do the whole voting. :)
 
Making a basic root with an Entry widget seems to change the window size whenever I reconfigure the widget's width. I'm not sure what I'm doing wrong in my actual app.
 
1:25 PM
@idjaw I'm sure you'll soon get the hang of close-voting. If in doubt, just ask here. And I assume I have you to thank for that random upvote I just got. :)
 
Maybe the issue is that I have a Canvas, and it's just its created contents that are changing, while the Canvas itself stays large.
GREAT SUCCESS MY NAME A BORAT.
 
@TigerhawkT3 Pity Kevin's not here - he's compiling a list of Tkinter quirks. I'm still a newbie with Tkinter. I'm a lot more familiar with GTK2; OTOH, I haven't done a lot with GTK in recent years so I'm a bit rusty when it comes to detailed knowledge...
 
@TigerhawkT3 That makes sense.
 
The problem with an empty Canvas is that it's invisible.
I had also been having an issue with some created objects staying behind when I wiped the canvas and put smaller items on it. They would only go away once I put something large enough to fill the canvas, then cleared that.
Kind of like how sometimes artifacts are left after dragging a window, and you need to drag another window over it to wipe it clean.
That wasn't very clear but I hope you know what I mean because I am tired.
 
1:31 PM
FWIW, I only wrote that "unexpected print output in python 3" answer because I'm sick of hackaholic's code dump answers with no explanation of the cause of the OP's problem or why his code solves their problem.
@TigerhawkT3 Yeah, I get it, although I haven't played with Canvas much yet.
 
Well, if you do, be warned that it expands to fit its contents like the geometry managers do, but it doesn't shrink back like they do.
Man, once you look up strategy guides for these tile puzzles and practice several dozen of them, they sure get easier.
 
@TigerhawkT3 OTOH, all the GUI stuff that happens in Tkinter / Tk/Tcl is ultimately derived from X windows, and the same is true of GTK, so I'm familiar with the behaviours even when I may not be familiar with the exact implementation in Tkinter.
Also, quite a few years ago I was mad enough to attempt to learn some actual X windows stuff in C (after I was already reasonably competent at using GTK2+ in Python). The experience was scary but illuminating. :)
Do you mean sliding block puzzles ?
 
Yep.
Instead of just click to move, I added <B1-Motion> to move. It makes such a huge difference in speed that I can't even.
 
I haven't tried writing one of them in ages... In Ancient Times I did a 3D one on a 8 bit machine. It was text-only: using 3 3x3 grids containing the 26 letters of the alphabet and a space. You hit the letter's key to move it.
 
D=
How doable was it?
 
1:49 PM
@TigerhawkT3 It was fun!
 
How ancient were these times?
Was the keyboard made of bits of animal bone?
 
I suppose it was roughly equivalent in difficulty to a 4x4 2D puzzle. The extra dimension doesn't make it harder: it gives you an extra degree of freedom.
@TigerhawkT3 The late 1980s or maybe early 1990s. Back when home computers used 8 bit architecture and 64k of RAM was a lot. :)
 
I was alive in the late 1980s.
 
I was alive in the late 1950s. :)
 
My first computer had 1 MB RAM
it was a Apple IIsi I think
but I do remember also having a classic II
 
1:56 PM
My dad had a dumb green-monochrome terminal from work that appeared in the house occasionally, but our first computer was a Macintosh Classic II.
 
I also had a Newton!
That was a pretty awesome device back then
 
By the way, I thought of a fun Halloween costume: wear some camo pants and a hunting vest, and say I'm dressed up as a dentist.
 
Ah I'm from the new generation
All what I saw was Win 95 and later releases
 
We had a PC with a turbo button.
We should start a movement to bring back vacuum tube computers, and say we prefer them because the bits are "warmer."
 
old days hahah, I still remember playing Batman game, it was really primitive, walking with arrows climbing the ladders, almost like Super Mario
 
2:03 PM
"Pi is so much more mellow on a tube comp, you can really feel the oomph of the digits."
 
The first machine I had access to was a IBM System/360 Model 20
 
You've seen things @PM2Ring
 
@PM That looks like high-tech factory not a computer
 
It's a bit factory.
 
Interesting how computers evolved
 
2:05 PM
They didn't evolve; it was intelligent design. :)
 
Commenting that picture: (I bet that PC has a 3D capability) XD
 
@TigerhawkT3 They certainly would be warmer. Even a transistor & IC machine like the IBM 360 got pretty warm, but most of that heat was generated by the [ferrite core memory](Magnetic-core memory). The machine I had access to had a pair of air conditioners dedicated to keeping it cool.
I was still in high school when I was using that IBM mainframe. It had been donated by IBM to a technology museum, and the museum made it available for free to high school kids, and ran free programming courses during the school vacations.
 
A museum piece served as a practical educational tool?
 
@direprobs :) It didn't even have a monitor. Input was via punch cards, output was via a line printer. It could also punch data onto cards, if you wanted. The disk drive was about the size of a small washing machine, and rather loud.
 
Did you supplement its memory capacity with Post-It notes?
 
2:15 PM
@TigerhawkT3 Definitely! Hundreds of kids got their first chance to run code on that machine. I first learned a language called PL/I on it (I'd learned some BASIC a year or two before, but hadn't had a chance to actually run any code). A year or so later, I learned to program that beast in assembler, which was a lot of fun.
 
Assembler... fun...
 
@TigerhawkT3 We had a back-up of the OS software & PL/I compiler from the hard disk on punch cards; luckily we never needed to use it. Bear in mind, that back then OS software was pretty basic: you can't fit a lot of stuff on a machine with 64k (or less) of RAM.
 
I bet it was basically "yes, this is code."
 
@TigerhawkT3 Sure. This was a single-tasking environment, so it didn't need complicated stuff like memory protection. If you wanted to debug your machine code you could put the machine in single-step mode so it would one run instruction at a time, each time you pressed a front panel button. And you could see a direct readout of all the CPU registers and any selected RAM address on a primitive binary display that used tiny incandescent bulbs.
And if you wanted to, you could easily modify the contents of a RAM address or register by turning a few dials and pressing a button or two. It was a very hands-on approach to debugging. :)
 
@PM2Ring how old are you by the way ?
 
2:23 PM
That sounds... low-level.
 
@TigerhawkT3 Extremely.
 
Anyway, almost 7:30 a.m.; I gotta sleep. Rhubarb to you all!
 
@direprobs 56
@TigerhawkT3 Take care. Rest well. It's been fun chatting about Ancient Times.
 
I think it was easy to understand CS in those days, since technology was not so developed and not many concepts were introduced yet
but now when you look at one concept you'll find thousands or tons of concepts, but in the old days you just focus on the PC itself you don't dwell in more theories like now.
I dunno, I wasn't alive in those days, so I can't judge, am I right ?
 
2:28 PM
Well, hardware and software were a lot simpler back then. A lot of concepts had been developed, though. OTOH, it just wasn't practical to implement complex multi-layered stuff.
I was programming before the term PC was introduced...
 
I see, you have very great experience indeed
I just started programming 2 years I guess
But of course, I started with Python which is not low-level
 
My programming experience isn't as rich as it could be. OTOH, I have programed on a lot of different architectures, in lots of different languages. But I barely remember a lot of the details of some of my first machines and early languages.
 
When I learned C, it was very complicated to understand its terms, not only, the major problem with the language you hardly find documentation, you'll find some of course online, but not as much as for Python, Java and other languages as you know. C is now considered obsolete for us (the new generation). I think to master a computer literally master its real language 0's and 1's.
 
"C is now considered obsolete for us (the new generation)" - lmao.
 
But at least you had an experience with that, now-days we don't start from the low-level like studying the basics of machine language in most CS majors, they start rather with Java or C++.
 
2:35 PM
Oh man. That was good. Got any more good jokes?
 
@Ffisegydd Does MIT teaches C as first language anymore ?
 
Yes, of course, they teach Python which means every single other language ever is obsolete.
Oh noes.
What will we do with Javascript if it's obsolete now?
 
It's used by many major companies, but not taught like back in the 70's
 
So your argument is what? That it's used by major companies (who will be hiring these students), and that makes it obsolete?
But joking aside, I need to run now to prepare dinner. But if you've got any more jokes words of wisdom, knock yourself out.
 
No, I have no argument here at all, obsolete in terms of its documentation only, but it's used now and I guess its usage will continue in the future if no lang succeeded it
Yea, sure Mr.knowledgeable, no job arguing with me only
 
2:39 PM
Actually it's Dr. Knowledgeable.
(Sorry I couldn't help that one, really am leaving now)
 
@JonClements look what a trease I've found: Brilliant deleted scenes from HP // Some of them are so vital, I have no idea why they deleted them from even the director's cut..
 
Naa, doesn't fit you to be a Dr
 
Fair enough, doesn't make it any less true though.
 
@Ffisegydd I still love C, and never learned C++, but I don't think that there's a huge demand for C (in distinction to C++) these days.
 
@PM2Ring I don't think that makes it "obsolete" though.
Demand varies with time, but calling C obsolete truly struck me as funny/ludicrous.
 
2:43 PM
I said its documentation is obsolete
 
may I? C is still with us for a very very good reason:
 
You no longer find that amount of tutorials for C anymore like you'll find say for Python or Java
 
@Ffisegydd Hell no. There's still heaps of vital C code in use. I can't imagine people writing stuff like kernel code, low-level drivers, embedded code, etc in C++ instead of straight C.
 
it is a super thin abstraction layer over the hardware => it has all the tools, you will ever need, to even implement OO or any other higher level stuffs
 
As the old saying goes: "C is so close to the hardware that you can smell the registers"
4
 
2:44 PM
yet it still just a "portable assembly" => and it was designed this way
 
Cpython is written in C, am I stupid to say the language is obsolete ?
 
@PM2Ring LOL
what I love about C (I'm still developing tens of thousands of codes in it) is it is minimalistic and brutally honest
and by that, I mean, it is super explicit, there are almost no implicit mechanisms going on under the hood -- which is IMO a very good thing, compared to C++, where all the RAII, inheritences, name mangling, implicit this pointer, etc. are just overwhelming
 
@PeterVaro it's an imperative language after all
 
I fell in love with C the first time I met it. But I was already familiar with pointers & other low-level stuff, since I'd been programming in assembler for 5 or 6 years by then.
 
when I'm writing C++ I almost never know, when I write idiomatic C++ -- in contrast C, where I only have to open my bible, the C standard, and look at some nice code samples here and there -- and I immediately know if I'm right or wrong
@direprobs that's only one aspect of it..
although there is only ONE downside of C, I could never really love.. and that is the limitation of its macro language
I wish the CPP would be far more powerful and expressive..
 
2:51 PM
C doesn't have built-in support for OOP, but it's still possible to do OO in C: the Amiga OS was largely a OO design implemented in C. Also consider: the earliest forms of C++ were basically implemented via pre-processor macros that converted the OO syntax to pure C.
 
@PM2Ring what do you mean? can't you wrap things into objects? can't you express constructors and destructors? can't you create opaque types and add getters and setters? can't you create single inheritance?
nah, I say you have almost everything you will ever need/want in C to create nearly zero-overhead OO in it
what C++ brought to the table, namely RAII (references, unique_ptr, shared_ptr, etc.) -- automatic memory management is kind of cool, but you can live without them if you ask me
will you need extra attention and focus because of the manual memory management? sure..
 
@PeterVaro I agree you can do those things in C, you just don't have the syntactic sugar that a OOP language gives you. So the code is a little more long-winded. But there's a major benefit to that: things are a lot more explicit.
 
^ +1 exactly
instance.method(value); <==> Type_method(&instance, value);
still very readable :)
 
Some other examples here
 
@PM2Ring I do it differently, let me search for you some code:
all the members of a struct can be added added by invoking a *_MEMBERS() macro
so there is literally no overhead or memory alignment violation
@PM2Ring and here is a specific sensor (subclass) that uses Sensor: github.com/kitchenbudapest/hackathon/blob/master/fw/kb/include/…
 
3:03 PM
I'm really not familiar with C. :) I'm reading about designated initializers after that "dot" before the variable name caught my eye.
 
@idjaw those are superb things!
they are like keyword arguments in python (sort of)
 
that is kinda what I'm getting slowly from reading this: gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html
 
struct S s = {.member1=12, .member2=true};
 
@PeterVaro It's getting late here, but I'll take a look at you code tomorrow.
rhubarb
 
take care @PM2Ring
 
3:06 PM
@PM2Ring kk, c u later, rbrb!
 
My daughter just woke up. Time to go play outside! :) rbrb as well
 
@idjaw rbrb!
 
@direprobs my mistake then. I assumed the sentence "C is now considered obsolete for us (the new generation)." meant that you (the new generation) consider C to be obsolete.
 
Yea, no offense intended to the language and its history
 
3:23 PM
hello guis...can anyone help me in finding with resource for using c++ library in python (extending python with cpp)
i tried looking into docs.python.org/2/extending/… but was not able to understand and get it working for cpp
 
4:26 PM
@vaultah my first cv-pls contribution! :) and my vote put it on hold. Look at me all grown up
:P
 
:)
 
00:00 - 17:0018:00 - 00:00

« first day (1834 days earlier)      last day (3108 days later) »