stupid computer programming question only for C/C++ gearheads

Message Bookmarked
Bookmark Removed
What is the meaning of the first prototype here? How does it compare to #2?

void foo(int &bar);
void foo(int *bar);

Jonothong Williamsmang (ex machina), Tuesday, 4 October 2005 16:21 (twenty years ago)

Mainly in syntax in the body of the function.

In the former.. you can do the following:

bar = 0;

In the latter.. you have to do the following:

*bar = 0;

References like this are just an easy way to make a parameter in/out without having to change the syntax if it were previously passed by copy.

CONST references are far more useful, because they can pass a major object by reference, but still offer much of the same protection from being written over as a pass by copy (and I stress "much")

donut hallivallerieburtonelli omg lol (donut), Tuesday, 4 October 2005 16:29 (twenty years ago)

Thank you, now I remember.

As far as const references, doesn't that just prevent you from reassigning the pointer within the function? (such a reassignment is meaningless -- the pointer is in the current stack frame)

Jonothong Williamsmang (ex machina), Tuesday, 4 October 2005 16:33 (twenty years ago)

Well, const refs are meaningless with scalar types, but with objects like classes and structs, you are prevented from calling methods that could change the internals of the object. You are, however, allowed to reference object methods that are declared as const in the class declaration.. like Get methods or what have you.

donut hallivallerieburtonelli omg lol (donut), Tuesday, 4 October 2005 16:36 (twenty years ago)

ahhhhhh!

Jonothong Williamsmang (ex machina), Tuesday, 4 October 2005 16:36 (twenty years ago)

Const is like the Maximum Rock N' Roll of C++.. you either have to be all const or you have to just say "fuck const, man". There is a line, and if you cross it, you're just as bad as everyone else on that side.

donut hallivallerieburtonelli omg lol (donut), Tuesday, 4 October 2005 16:37 (twenty years ago)

Const fxns are C++ only right?

Jonothong Williamsmang (ex machina), Tuesday, 4 October 2005 16:38 (twenty years ago)

I believe so, yeah. (My practical experience with C in general has been 95% C++ though.)

donut hallivallerieburtonelli omg lol (donut), Tuesday, 4 October 2005 16:39 (twenty years ago)

(I know const functions within classes are definitely C++ only, since classes are C++ only by definition. But you obv. knew that already.)

donut hallivallerieburtonelli omg lol (donut), Tuesday, 4 October 2005 16:41 (twenty years ago)

Overloading the bitshift operators for io = MAJOR DUD

Jonothong Williamsmang (ex machina), Tuesday, 4 October 2005 20:28 (twenty years ago)

Eh, I've never had any practical problems with the bitshift overloading, though it is a bit icky aesthetically.

RickyT (RickyT), Tuesday, 4 October 2005 20:36 (twenty years ago)

Much more annoying is that the closing pointy brackets in eg map are interpreted as being a right shift. The number of times I have typed something like that without thinking is ridiculous.

RickyT (RickyT), Tuesday, 4 October 2005 20:38 (twenty years ago)

Bollocks, forgot abt html - that map above shd read map<int,vector<int>>

Oh and const functions only make sense (and are only legal IIRC) as non-static member functions because they need to be const with respect to an actual object.

RickyT (RickyT), Tuesday, 4 October 2005 20:43 (twenty years ago)

well, arguments of any fxn can be const right?

Jonothong Williamsmang (ex machina), Tuesday, 4 October 2005 21:03 (twenty years ago)

Yes. But the notion of a const function is different. Take the following declaration.

class A
{

}

RickyT (RickyT), Tuesday, 4 October 2005 21:06 (twenty years ago)

well, yes

Jonothong Williamsmang (ex machina), Tuesday, 4 October 2005 21:07 (twenty years ago)

Ignore that. Something weird just happened and posted before I was finished.

class A
{
int function1(const B& bob);
int function2(const B& bob) const;
};

The first function is a non-const function, the second a const one. It's legal to call either on a non-const object of class A, but only legal to call the second on a const object of class A.

RickyT (RickyT), Tuesday, 4 October 2005 21:12 (twenty years ago)

Overloading the bitshift operators for io = MAJOR DUD

It was an interesting idea that ended up having pretty much zero use in the real world.

Yeah, MAJOR DUD.

donut hallivallerieburtonelli omg lol (donut), Tuesday, 4 October 2005 21:17 (twenty years ago)

C++ is mostly a dud. Unfortunately, we're stuck with it.

C, though, is an ultra classic.

Const is classic though in all of its many meanings. Const correctness may be bondage and discipline, but it helps out a lot.

mikef (mfleming), Tuesday, 4 October 2005 23:12 (twenty years ago)

C# is ok as is Objective C

Jonothong Williamsmang (ex machina), Tuesday, 4 October 2005 23:32 (twenty years ago)

two years pass...

Hey guys.

I'm losing my job in the up and coming year or so due to changes in our company. I've decided to look into computer programming as a next step career. I'm just after casual discussion on what any ilxors are doing currently, or have done in the recent past. I only really know C++ and java and am still only a real novice in both of those, but I'm willing to learn other languages if it's more suitable.

I have no idea about programming in the real world, what job opportunities are out there for budding beginners like myself ?

Ste, Wednesday, 16 January 2008 13:26 (eighteen years ago)

^^^ same

ken c, Wednesday, 16 January 2008 13:43 (eighteen years ago)

I get the impression no one starts new projects in C++ anymore, so maybe think about learning something a bit more modern? But really, the best thing you can do is learn C inside-out. If you figure that out then picking up most any other language is going to be a morning's work. If you find C heavy going then maybe take a look at Python and then come back to C.

As far as the jobs themselves go, no idea. I stuck to academia.

caek, Wednesday, 16 January 2008 14:03 (eighteen years ago)

thanks caek, any suggestions on a language alternative to C/C++ then?

Can't believe there aren't any more ilxors working in the programming business. for shame.

Ste, Thursday, 17 January 2008 11:24 (eighteen years ago)

Uh I think there are a lot of ILX programmers... not sure where they are.

Java, VB.NET, or C# is the way to go right now. Everything is becoming web-based and almost all of that is being done in those languages. If you already know some Java, I'd say stick down that course. Scripting languages like PHP is another way you could go, but I think Java is your best bet.

Vinnie, Thursday, 17 January 2008 15:44 (eighteen years ago)

yay JAVA I learnt quite a lot of java from uni

however, this was 7 years ago.. i assumed a lot of moved on since.. what is the hot thing that one needs to know now? see when i finished uni it was like all about Java RMI and CORBA...

ken c, Thursday, 17 January 2008 15:51 (eighteen years ago)

http://tell.fll.purdue.edu/JapanProj/FLClipart/Medical/headache.gif

Catsupppppppppppppp dude 茄蕃, Thursday, 17 January 2008 17:25 (eighteen years ago)

java's moved on leaps and bounds now that it's graphical

ken c, Thursday, 17 January 2008 17:40 (eighteen years ago)

If you want to program for PCs, these suggestions are good. If you want to program for devices, you should learn C/C++. I can't tell you what a nightmare it is to run Java on embedded systems. Java seems to bring out the laziest tendencies of programmers.

schwantz, Thursday, 17 January 2008 17:57 (eighteen years ago)

Also the Java APIs on mobile platforms are usually so crippled.

Catsupppppppppppppp dude 茄蕃, Thursday, 17 January 2008 18:08 (eighteen years ago)

In a lot of ways C++ is a terrible pain in the ass though. If you just want to write something quickly that will run on Windows, with rich graphical controls and pretty good performance, give me .Net any day.

o. nate, Thursday, 17 January 2008 18:19 (eighteen years ago)

well no shit....

Catsupppppppppppppp dude 茄蕃, Thursday, 17 January 2008 18:34 (eighteen years ago)

http://www.kiberpipa.org/gallery/album189/DSCN0794.sized.jpg

am0n, Thursday, 17 January 2008 18:39 (eighteen years ago)

Trying to answer Ste's question though - for a beginner trying to break into programming, I think you need to figure out what kind of programming you want to do: web, database, windows-application, server-side, embedded, etc. Then you need to solve a chicken & egg problem - no one wants to hire you if you don't have any experience, but how are you going to get experience until someone hires you? For that, I'd suggest maybe figuring out some way you could either use programming in your current job, or consider taking a class that involves programming project work, or maybe spend some extracurricular time on a shareware project of your own. If it turns out to be something useful, it could be a great source of publicity and look good on your resume.

o. nate, Thursday, 17 January 2008 19:19 (eighteen years ago)

cheers o.nate. That's some healthy advice to get me thinking.

Ste, Thursday, 17 January 2008 20:33 (eighteen years ago)

two months pass...

okay, I've been learning OpenGL lately which is my first step into 3d graphics. It's pretty simples and I'm really enjoying it and am gearing up to start my first project with it, but I'm starting to maybe think that Directx would have been a more sensible option as I've heard it's faster for games.

thoughts?

Ste, Thursday, 3 April 2008 09:39 (eighteen years ago)

http://en.wikipedia.org/wiki/Comparison_of_OpenGL_and_Direct3D

"Direct3D is a proprietary API designed by Microsoft Corporation for hardware 3D acceleration on the Windows platform. OpenGL is an open standard API that provides a number of functions for the rendering of 2D and 3D graphics and is available on most modern operating systems."

which pretty much settles it for me.

koogs, Thursday, 3 April 2008 10:09 (eighteen years ago)

are you referring to the multi platform significance in that statement?

i hear they're releasing opengl3 this year, which is going to be a complete revamp of the structure. So I still could be learning all this for nought. sigh.

Ste, Thursday, 3 April 2008 10:44 (eighteen years ago)

the 'proprietary API designed by Microsoft' and 'open standard API' bits.

opengl3 will be a while yet, i think. take the time to get used to the 3d geometry bits. and maybe try to write them in a way that'll let you change your 'display layer' later. or use something like SDL which is cross platform and might buffer you from opengl api changes (and provides similar extra bits to those that directx adds to direct3d, ie input and audio)

JOGL is fun, in a run-everwhere kind of way. and processing.org which is java-like but easier. i tend to come back to using xscreensaver core (which is C) as a framework for anything more involved.

koogs, Thursday, 3 April 2008 11:56 (eighteen years ago)

Well, they're on DirectX 9 or 10 (?) now and I don't know about complete design overhauls but each new version renames a bunch of classes and functions (tried to teach myself DX8 using DX7 book and gave up in frustration pretty quickly, but then I'm like that).

I only did a little GL some time ago but I still think of things I learnt then that are useful now, and not necessarily just in GL (right now I should be writing something which effectively steals the "display list" idea, hohum).

Would like to get back into... either DX or GL. Actually I have a little project in mind that would seem to involve learning DirectSound, so maybe that would lead me to the DirectX side of the graphics divide. Most likely I'll continue to ignore my daydream project for another year or two, since it was first hatched at least 15 months ago. Sigh. Finding the time/energy to learn new non-work coding stuff is hard.

a passing spacecadet, Thursday, 3 April 2008 12:13 (eighteen years ago)

In case I didn't spell it out properly I don't know a whole lot about DirectX, so maybe I'm wrong about the renaming stuff, but it was frustrating to a beginner (then again maybe the book just plain got it wrong; I've looked at two and one of them seemed OK but the other was full of things that even I could tell were mistakes, I just didn't know enough to guess at fixing most of them).

a passing spacecadet, Thursday, 3 April 2008 12:15 (eighteen years ago)

(think DX10 was new for vista and only exists on xp as a kludge. internet would seem to concur. in fact it was meant as a vista exclusive and held over peoples' heads as another reason to upgrade. this is the kind of bollocks that makes me not want to touch it with a pole.)

openGL equiv of directsound is openAL but, again, SDL does both.

my dream project (audio division): software-only version of this: http://www.youtube.com/watch?v=0h-RhyopUmc (reactable)

koogs, Thursday, 3 April 2008 12:27 (eighteen years ago)

Yes I've already delved into SDL but I thought it best to learn the bare bones of OpenGL anyway.

I've already read the Beginning OpenGL book which was pretty decent but skimmed on a lot, so now I've got the 'red book' which features a lot more.

Spent too long now putting off projects, and at the moment I feel I'm on a bit of a roll in getting things done. Fingers crossed it lasts.

Ste, Thursday, 3 April 2008 13:10 (eighteen years ago)

i've done dx9 projects for work. it's decent. as easy as opengl imho. the general way you do things is somewhat the same from a high level point of view. planning on any particular api to last the test of time is going to have it's painful moments.

koogs' advice about abstracting your display layer out is gold. same with that sound software. :)

that's a sweet interface. i've been working on a pac man loops game/instrument where you set certain wavs to play for certain game actions (like going up) and then you drive pac around in a loop and then you can set him on autopilot, grab a second character and repeat. throw in an effect weather cloud. etc etc. it's still a pile of nothing yet because it's hard to have time to work on it. day job has been sapping my will to program. that and the visual studio tools are all upgrading and holy shit are they expensive. depressing.

keep. hope. alive. i really need to quit world of warcraft.

msp, Thursday, 3 April 2008 13:27 (eighteen years ago)

pac man loops game/instrument

This sounds awesome!

I really need to quit... ILX? Work? Sleeping? ;_;

a passing spacecadet, Thursday, 3 April 2008 13:36 (eighteen years ago)

pacman loops thing reminds me of http://www.pawfal.org/al-jazari/ which itself looks like a 3d version of something i saw decades ago on tv (you had mirrors and rotators to define paths, things would trundle down them setting off effects, like a modtracker but less linear, more colourful) and always fancied copying myself.

(facetious comment about cost of dev tools on linux deleted) 8)

koogs, Thursday, 3 April 2008 13:46 (eighteen years ago)

oh i know... i have fedora 8 on my newest machine. (i'll be damned to pay for another copy of xp or vista)... but c# has become my language of choice lately. i need to check out mono. that might be my route to dev c# on linux.

java might be easier overall.

al-jazari... what a name...

msp, Thursday, 3 April 2008 17:05 (eighteen years ago)

it is a great name for what it does:
http://en.wikipedia.org/wiki/Al-Jazari

going mad trying to find the little sound toy thing i mentioned above. saw it on tv, remember it being listed on yahoo directory, or somewhere like that, at the time, saw a copy for sale, maybe, in virgin megastore. about 1997, something like that. name was so generic though, 'tone'something, something'beat'? argh.

koogs, Thursday, 3 April 2008 17:24 (eighteen years ago)

possibly simtunes, an early Toshio Iwai effort. name does sound familiar but maybe from recent elektroplankton reviews.

http://www.cdaccess.com/html/pc/simtunes.htm

koogs, Thursday, 3 April 2008 17:48 (eighteen years ago)

so I'm in full flow with this Opengl lark and feel very comfortable with constructing models, lighting, textures etc. Or so I thought, my problem lies with optimizing the code.

A very very simple program for instance which just rotates a couple of polygons seems to cause all other running apps to come to a grinding halt, or at least reduces them to a stuttering wreck. Is there something in the code I should be aware of that could cause resource problems?

any opengl experts out there?

Ste, Wednesday, 16 April 2008 09:53 (eighteen years ago)

a 3d card in your pc! 8)

displaylists

(pictures?)

my 3d rotating, ever-growing tube thing got rejected by xscreensaver bloke. curse him.

koogs, Wednesday, 16 April 2008 12:42 (eighteen years ago)

http://farm1.static.flickr.com/207/461309045_9c2c8fdced_m.jpg

koogs, Wednesday, 16 April 2008 12:47 (eighteen years ago)

a couple ideas that might be common mistakes at this stage:

- if you're using a function of some kind to generate points... only generate the points on init and use transforms after every frame instead of regenerating.

- some simple structures are much more efficient than the complex polygons. (regardless, if you've only got a few...)

- if you have more than one transform on each frame, combine the transforms first, then apply them towards your points. (this may be a given depending on how things draw, but...) doing both transforms separately might result in a lot more operations. kind of depends again on the number of points involved etc.

- are you using textures? is that process optimized?

these might be obvious. i figured what little i could offer is better than nothing. it might spark an idea at least.

msp, Wednesday, 16 April 2008 13:22 (eighteen years ago)

actually i think it's more a resource problem with running under Windows, the program itself seems to run fine. It's just my other programs are suffering suffocation from the Windows event que (or something)

Having said that, your third point about combining transforms sounds something I should be utilising. cheers.
(this will replace my current noob routine of constantly calling a draw plane routine with endless transform/rotate commands - which I included because i wanted to just use one Normal vector)

Ste, Wednesday, 16 April 2008 13:46 (eighteen years ago)

(and I shall be using display lists and vertex arrays soon, i'm still just experimenting with the modelling parts)

Ste, Wednesday, 16 April 2008 13:47 (eighteen years ago)

(sorry to keep going on)

My display list code isn't showing textures, I'm using texture Objects is that a problem? Not much documentation about it in the Red book.

So now I have this rather moody fogged-green looking set of corriders, with a couple of flourescent lights, one randomly blinking on and off. Next is the zombie, which I'll need to spend the rest of the weekend studying zombie movies to research their motion. what a bummer.

Ste, Friday, 18 April 2008 10:35 (eighteen years ago)

> My display list code isn't showing textures

ha, could be anything. are your polygons wound the right way? (or are you using GL_FRONT_AND_BACK)? have you defined normals? are the normals normalised? are the texture coords normalised? glEnable? lights? ambient light? or, yes, texture not loading?

pictures?

koogs, Monday, 21 April 2008 09:07 (eighteen years ago)

The textures work fine when they're not in a display list, so there's nothing wrong with all the things you've mentioned.

I'll come back to it. At the moment I'm working with collision detection which is pretty mammoth. The weekend I solved mouse control movement!

Ste, Monday, 21 April 2008 13:32 (eighteen years ago)

(my code structure at the moment is pretty much a joke, I'm still focusing on just learning opengl in itself but i'm beginning to rapidly see the benefits of putting everything in appropriate classes)

Ste, Monday, 21 April 2008 13:35 (eighteen years ago)

me again :)

I managed to get my display lists to work with textures. But now its' causing another problem. I'm getting an 'intermittent' exception error when I close down my program, which leads me to believe something isn't being deleted properly.

My opengl main rendering class is a new pointer object, does this mean I have to manually delete the Display Lists? I only say this because after reading how they are created, they sound like a dynamic creation.

Ste, Wednesday, 23 April 2008 13:18 (eighteen years ago)

This error btw seems almost certainly only ever happening when I use display lists.

Ste, Wednesday, 23 April 2008 13:19 (eighteen years ago)

I'd have thought that you were more likely to get an exception if you'd deleted something twice, rather than not having deleted enough.

Forest Pines Mk2, Wednesday, 23 April 2008 14:05 (eighteen years ago)

yes maybe, although it is *very* intermittent - it happens about 10% of instances.

If I don't solve it tonight I'll post a link to the code, see if anyone can spot my trub. cheers

Ste, Wednesday, 23 April 2008 14:36 (eighteen years ago)

Intermittent faults like that are usually caused by dereferencing pointers that you've previously freed or deleted, in my experience.

If you access an object that you've deleted, then usually its storage will still be accessible to your process, without causing a fault. However, a lot of the time, the data inside the object will have turned into nonsense. Therefore, pointers inside a deleted object will sometimes point to some random and inaccessible location; when you dereference them, you get a crash.

(sorry if this seems self-evident and you already know it)

Forest Pines Mk2, Wednesday, 23 April 2008 15:12 (eighteen years ago)

no that's totally cool advice, cheers.

Ste, Wednesday, 23 April 2008 15:20 (eighteen years ago)

It's strange that the error only happens on exit and only with display lists turned on. There's nothing special in the list, just a bunch of Triangle and Normal statements.

luckily i can proceed without using display lists, as my current models aren't reducing the speed of the program to any signicant degree.

Ste, Wednesday, 23 April 2008 15:29 (eighteen years ago)

Hmm, I just noticed something. The code I'm using was borrowed from Beginning OpenGL (from the gamedev guys), the function that calls the deletion of texture items is never called. It could be linked. I've emailed the authors anyway.

Ste, Wednesday, 23 April 2008 18:10 (eighteen years ago)

one month passes...

I'm tearing my hair out with an Array problem

My array won't initialise any values, it's being initialised in a 'start up' function just like all my other variables/arrays which work okay. It's initialised with values like this :-

float basic_array[] = {
...values...
};

it works if I assign the elements individually, which i don't want to do with large arrays.
And also it works if I assign the values within the specific class method it's being used in, again not nice as the method is called a lot.

Also, it throws an error if I remove the 'float', this is strange as I've already declared it in the class structure with:

float basic_array[56];

I've tried passing it to the functions as pointers and references but the values still appear to be 0.

What obvious thing am I doing wrong?

Ste, Saturday, 31 May 2008 16:43 (seventeen years ago)

show us the code

Mackro Mackro, Saturday, 31 May 2008 18:48 (seventeen years ago)

the first doesn't have an array size specified -- it can't be inferred

Catsupppppppppppppp dude 茄蕃, Sunday, 1 June 2008 04:45 (seventeen years ago)

I tried that, still nothing. I've just assigned the values individually for now, that works.

should I declare the array in a different way within the class structure, ie instead of:

float basic_array[56];

?

Ste, Sunday, 1 June 2008 08:51 (seventeen years ago)

k&r says that the first one is fine, gives an example with ints:

int days[] = {31, 28, 31, 30, 31};

(the size can be inferred - by the number of values supplied)

don't know why it's not working in your case

> I've already declared it in the class structure

but it may be this. two things with the same name?

koogs, Sunday, 1 June 2008 19:13 (seventeen years ago)

i got it working, i declared it as a static const array and removed the numerical values from the [] on both occasions.

and i also got my collision detection partially working today, which is a boon. Although I can't get my objects to 'bounce' off the walls quite right, I'm using the Normals of the wall planes to calculate the collision reaction but I get an ever-so slight bias in one direction. I'll figure it, sorry I'm waffling.

Ste, Sunday, 1 June 2008 22:22 (seventeen years ago)

Okay I'm done with this, I think I've learnt a substantial amount of bare bones on 3d programming to take it to the next level - can anyone recommend an existing free source 3d game engine for me to utilise ?

Ste, Tuesday, 3 June 2008 08:38 (seventeen years ago)

amazingly, ilx is the only web site my works internet is letting me on today. the fools!

Ste, Tuesday, 3 June 2008 08:39 (seventeen years ago)

apparently, according to my IT neighbour here at my desk, it's because "there is a sith out"

Ste, Tuesday, 3 June 2008 08:39 (seventeen years ago)

did read a good tutorial series that used, i think, ogre.
http://www.ogre3d.org/

and crystal space is the other one i recognise by name:
http://www.crystalspace3d.org/main/Main_Page

both seem quite active.

2 slashdot discussions about the same question:
http://ask.slashdot.org/article.pl?sid=06/04/21/213221
http://ask.slashdot.org/article.pl?sid=07/05/26/206242

koogs, Tuesday, 3 June 2008 08:51 (seventeen years ago)

I've heard of ogre, actually i think the first book i got on opengl used it for the game it provided on its CD.

I'll check them out, thanks.

Ste, Tuesday, 3 June 2008 08:53 (seventeen years ago)

hmm, looks like Ogre has no collision detection or physics, which is my main want.

Torque isn't free but seems worth checking out, although the demo made it look like the results might all be a bit 'samey'.

I just need something to help with physics and collision, I can do all the 3d modelling myself if I have to. I'm not looking at huge projects here.

Havok is now freely available, might check that out tonight.

Ste, Tuesday, 3 June 2008 12:16 (seventeen years ago)

one month passes...

Hi helpful ilxors.

I've left the first-person stuff for now just to mess about with a zombie swarming emulator. It's not great and doesn't really do anything exciting. But I was wondering if someone could check it out to see how it runs on other (Windows) machines - as I've yet to learn how to lock fps rates and stuff like that.

http://www.mullsports.com/zombiesim.rar

The RAR file contains two exe files and 3 texture files, just save them all into one folder and run either file.

One file runs in a 1024 x 768 full screen, with mouse control.
The other runs in a 800 x 600 window, with no mouse control (and lots more zombies)

The windowed version should look like this :

http://www.mullsports.com/images/zombieswarm.JPG

Not too exciting hey
Control the grey pyramid with the WASD keys. Mouse or up down cursor keys can change the view slightly. press ESC to quit.

The zombies should swarm immediately in the windowed version, but will only react if the player is close by in the full screen one.

You can't die, its just a test for the zombie movement.

and sorry the grey pyramid dude is difficult to see. but if you can't see it straight away - it's the one that will be quickly surrounded by hundreds of red pyramid zombies.

Ste, Thursday, 10 July 2008 20:36 (seventeen years ago)

My colleague has asked me to help his son learn a programming language with us in the office this summer. I started with qbasic, but probably that is not the best place to start nowadays... what do you guys think? I don't really know Java all that well but I know at my university they teach Java as the main language. I use C++ most of the time but all the c/c++ crossover is probably confusing for a beginner and I'm not sure whether c++ is still the most desirable skill? I work in hardware and don't really keep up with the trends in the software programming world.

Can anyone recommend any good Java books/online tutorials for beginners? (he is a real beginner but a really bright kid) Or does anyone seriously disagree with my choice of Java?

tpp, Tuesday, 22 July 2008 10:49 (seventeen years ago)

Java's probably a good place to start - C++ is too big and messy, I'd say.

At a guess, most of the programmers in the world are Visual Basic programmers - but I wouldn't have thought it a good way to start programming.

Forest Pines Mk2, Tuesday, 22 July 2008 12:52 (seventeen years ago)

how about c# ?

Ste, Tuesday, 22 July 2008 12:54 (seventeen years ago)

best way to get a job, it's way more popular than java now apparently ;_; </unemployed java developer>

ledge, Tuesday, 22 July 2008 12:58 (seventeen years ago)

Didn't really think of that to be honest! And I don't know enough of its syntax or API to offer an opinion.

PHP is good as a "useful" language, but it's very easy to write horrible horrible unstructured code in; and there is lots and lots of horrible PHP code out there created by web designers. I think its syntax can be awkward in places, too.

Forest Pines Mk2, Tuesday, 22 July 2008 12:58 (seventeen years ago)

c# is yer basic c-based syntax just like java and well 90% of other languages.

ledge, Tuesday, 22 July 2008 13:01 (seventeen years ago)

There aren't many other C-based languages, are there? C, C++, Objective C, Java, C# - what else?

Forest Pines Mk2, Tuesday, 22 July 2008 13:06 (seventeen years ago)

well i was thinking of perl and php, which aren't c based but do use a c-like syntax for flow control, operators, 'n' stuff.

and javascript of course.

ledge, Tuesday, 22 July 2008 13:11 (seventeen years ago)

ugh PHP is the only language that i've ever gave up learning half way through. i think it was also a case of suddenly thinking "hang on, when am i EVER going to use this?"

java or c# then for consideration, i agree c++ maybe more versatile but it's harder going.

Ste, Tuesday, 22 July 2008 13:15 (seventeen years ago)

True.

I did at one time know all the various different syntactical meanings of { and } in Perl5. I could probably still list most of them if I thought about it - there's about 7 or 8.

xp

I think one of C++'s flaws is that its designer tried very, very hard to make it a superset of C. It's a much bigger language than Java, in syntax if not in API terms.

Forest Pines Mk2, Tuesday, 22 July 2008 13:16 (seventeen years ago)

As a beginner myself I 'accidentally' learnt C by trying to learn C++, and I've only recently realised that all my programming has really just been simple C stuff.

So now I'm trying to get my head more into the whole polymorphism, inheritance, encapsulation, and virtual function parts.

I also want to learn 'good' efficient coding, which is difficult to learn from most books.

Ste, Tuesday, 22 July 2008 13:26 (seventeen years ago)

"good" and "efficient" are often at odds!

Forest Pines Mk2, Tuesday, 22 July 2008 13:53 (seventeen years ago)

There are far fewer C++ jobs these days than Java jobs. It's kind of a previous generation in a sense, C++, much as assembler was the generation before. As computers become more powerful, the kind of beefs that once plagued Java are not an issue for the most part nowadays; that's to say, the areas where maximum performance is absolutely necessary is a smaller percentage of software that needs to be written. So in the '80s, you'd program games in assembler, because it was more important that it ran quickly than being portable across instruction sets, but in the '90s, pretty much everyone wrote games in C (and their bespoke scripting things).

Nowadays, the pain that access to memory directly causes is just not worth it for just about everything, so C/C++ is unnecessary. C++ is really quite horrible/inconsistent/unintuitive too, so I would avoid it for all the above reasons.

FWIW performance now is kind of edging Java's way for some types of applications, because of the runtime optimisations it does. ILX, for example on JDK 1.5 was able to run at 260 transactions/second on my old PC; whereas, when I installed JDK 1.6, it went to 60 transactions/second but slowly climbed over a couple of minutes to 400 transactions/second. I read now that Tomcat is faster than Apache (written in C) at serving static HTML, which is a bit of a milestone.

Java and C# are practically the same language, which helps if you want to do both.

Efficient coding will come more from learning about computability/intractability/computational complexity/'order' of algorithms, rather than pointer arithmetic or any other specific of a given programming language.

Keith, Tuesday, 22 July 2008 13:56 (seventeen years ago)

Keith, I imagine the only way that Tomcat could beat Apache is with green threads vs. the only apache prefork style.

Catsupppppppppppppp dude 茄蕃, Tuesday, 22 July 2008 14:01 (seventeen years ago)

I would think C++ still outweighs Java in some industry circles, like the games industry for instance?

Ste, Tuesday, 22 July 2008 14:05 (seventeen years ago)

Well, to be honest, I read the results of that test in a book about Tomcat, so it's probably skewed. Even that it gets close enough is probably pretty surprising.

That said, there are all sorts of things that Apache can't take advantage of because of its static compilation (e.g. how long to spin for before putting a thread into a wait state).

x-post. Steve, yeah I'm sure it does, but that's probably about the only place. Maybe embedded stuff, but most of that seems to be Java nowadays too.

Keith, Tuesday, 22 July 2008 14:06 (seventeen years ago)

yeah that's true actually. I need to dig out my java book, i smell a career change at the end of this year.

Ste, Tuesday, 22 July 2008 14:12 (seventeen years ago)

I think C++ is still very widely used in the city, too?

toby, Tuesday, 22 July 2008 15:12 (seventeen years ago)

if you're talking financial applications I'm pretty sure some of those mothers are still blasting fortran

El Tomboto, Tuesday, 22 July 2008 17:21 (seventeen years ago)

Mr spacecadet has just started a new C++ job for embedded stuff, and being a C programmer rather than a C++ one he was sent on a course. Grumbling point for the non-OO programmers in the room:
"why do we have to make the member variables private and then write access functions for them? why can't we just make them public?"
"ah well, that's bad OO practice, bla bla guarantee nothing else is fucking with your data etc"
"but isn't it slow having a function call every time you just need to see your data?"
"well, a little, but it doesn't matter unless you're writing realtime embedded systems, then you should stick with C"
"err... we're writing realtime embedded systems and we've all been sent on a C++ course because the company decided it should be their new standard"
"...oh"

What are the son's interests? Someone was enthusing about Processing to me lately, which seems to be a java-based programming environment with some built-in libraries for making graphics stuff easy to the not-really-programmer. Hopefully from there "real" Java is a small step. But if he's not particularly interested in that side of things then going straight into Java or C# or whatever would be better (it might be anyway, really).

a passing spacecadet, Tuesday, 22 July 2008 17:46 (seventeen years ago)

I think you probably mean COBOL, Tom. In my experience of financials, which is probably about ten years, there was a bit of C++, but it was toe in the water stuff. At that time (early '90s) it was mostly COBOL; a whole bunch of older MVS assembler stuff, and quite a lot of 4GL stuff at the time, some of which generated COBOL (great idea). Come the late '90s, they all got into Java, and whilst there's still loads of COBOL around and still a lot of ongoing development, Java is mostly where it's at, although some places are Microsoft shops, they tend toward Java because of IBM's advocacy.

Keith, Tuesday, 22 July 2008 17:48 (seventeen years ago)

Thanks for all the responses - I started him on Java today...he seemed fairly comfortable and was enjoying himself. I have no experience with this C# (although I'm interested to check it out) and Java is easy for him to try at home on his windows computer as well as on our machines (all linux).

In my industry - hardware design, apart from the HDLs (Verilog, VHDL), you are more or less required to know C/C++, just to run fast software simulations. But speed really is the key here - the joke amongst all hardware guys I've met is that Java is too slow to be really useful. As far as I'm aware - C++ is still highly desirable in the City too (London)

tpp, Tuesday, 22 July 2008 19:26 (seventeen years ago)

C++ = classic
templates, private data members, and all the other crap that comes with C++ (except maybe inheritance) = dud

Without question C++ should be the first programming language you ever learn. If I can program in C++ anybody can.

Mr. Snrub, Tuesday, 22 July 2008 19:41 (seventeen years ago)

Java is good, too, though. At least you don't have to worry about any goddamn pointers.

Mr. Snrub, Tuesday, 22 July 2008 19:46 (seventeen years ago)

xx-post

C++ is still desirable... Just less than it was. According to http://www.jobstats.co.uk it's the 37th top skill in the UK. That's quite a jump down, though I notice Java is down to 25. They both used to be in the top 20. Maybe it's a change in how they've measured it.

The stuff about speed is (for me) to be taken with a pinch of salt, basically because it's the first port of call when someone's trying to convince you to use their favourite language... You know... Real men program in (language x) etc. That was kind of my point above about people giving it the assembler thing twenty years ago. I would still stand by a knowledge of algorithms and data structures being way ahead of knowing about the specifics of languages.

Keith, Tuesday, 22 July 2008 20:07 (seventeen years ago)

I'm no Java programmer but when I did a course on it I liked a piece of software called BlueJ, which is a class-testing utility type thing for beginners, so you can get used to writing the code for classes and checking they do roughly what is expected without writing all the rest of the code just to get something running. Then again, if he's already happy throwing together the main skeleton code, there may be no need.

If you're interested in C# or other .NET stuff but run Linux you might want to look at the Mono project but I can't say I've used it.

Any advice for anyone with academic experience of using VHDL to program FPGAs but not much actual job experience looking for jobs in that area? (This isn't me, so I may not be asking the right question, but...)

a passing spacecadet, Tuesday, 22 July 2008 20:30 (seventeen years ago)

A totally hep language to pick up on for a first language would be D, fo sho.

libcrypt, Tuesday, 22 July 2008 20:32 (seventeen years ago)

That said, there are all sorts of things that Apache can't take advantage of because of its static compilation (e.g. how long to spin for before putting a thread into a wait state).

There's no reason why you couldn't implement this in C. As far as static content performance, Apache+sendfile should spank the bejesus out of Tomcat.

Catsupppppppppppppp dude 茄蕃, Tuesday, 22 July 2008 21:09 (seventeen years ago)

Absolutely you could implement it in C. You could do it all in assembler too. But it's not done.

Keith, Tuesday, 22 July 2008 21:22 (seventeen years ago)

I suppose the problem with implementing it in C is that you would be pretty much programming the layer that is the JVM, and the bit that's responsible for Java being 'slower' than C. I mean, the JVM is implemented in C, after all.

Keith, Tuesday, 22 July 2008 21:26 (seventeen years ago)

If you're using green threads, I see no reason to spin on i/o since a context switch is so cheap.

xpost

Catsupppppppppppppp dude 茄蕃, Tuesday, 22 July 2008 21:27 (seventeen years ago)

I don't quite get you here, Jon... I don't know who uses green threads these days; in fact, when you mentioned it earlier, it's probably been ten years since I heard the term, as OSs all have native thread support now... Anyway, is what you're suggesting is that a bespoke thread implementation could be faster than a 'native' (i.e. in the OS) implementation... Is that what you mean? Why would the context switch be cheaper? It's got to do the same thing surely, push the stack?

Keith, Tuesday, 22 July 2008 21:32 (seventeen years ago)

Oh, shit I forgot that switching between a different *process* and a different *kthread* is different?

Catsupppppppppppppp dude 茄蕃, Tuesday, 22 July 2008 21:35 (seventeen years ago)

I've been hanging out with Ruby and Erlang people too much.

Catsupppppppppppppp dude 茄蕃, Tuesday, 22 July 2008 21:35 (seventeen years ago)

I dunno what a kthread is.

Keith, Tuesday, 22 July 2008 21:36 (seventeen years ago)

kernel thread aka native

Catsupppppppppppppp dude 茄蕃, Tuesday, 22 July 2008 21:37 (seventeen years ago)

So I think I read you're in a new job now... Is that right? What are you doing now?

x-post ah OK

Keith, Tuesday, 22 July 2008 21:37 (seventeen years ago)

Look at my hostname.

Catsupppppppppppppp dude 茄蕃, Tuesday, 22 July 2008 21:39 (seventeen years ago)

You'd *think* I'd know more about Java and this shit now but I'm working on Another Language.

Catsupppppppppppppp dude 茄蕃, Tuesday, 22 July 2008 21:40 (seventeen years ago)

Oh OK... Good stuff. I try not to care about languages and more about fundamentals. You might've noticed me batting on about it in the past.

The Tomcat/Apache thing was in Jason Brittan's book about Tomcat. The tests he had done did beat Apache, but I am well aware of how easy it is to skew tests to get the results you want. For all that, it is plausible, as Tomcat can use the APR to get the native file stuff. Also, things change over time. I was surprised how super fast Tomcat was when doing ILX. Rumour would have it it is a bunch of shit, but it's very stable and very fast.

Keith, Tuesday, 22 July 2008 21:44 (seventeen years ago)

(whatever very fast means, but ILX runs at < 1% of the machine's CPU)

Keith, Tuesday, 22 July 2008 21:45 (seventeen years ago)

I'm rewriting our version of crash reporter in Symfony (PHP) because the java one dies whenever we release a new version.

xpost

Are you talking about (unix) load or CPU -- load is a bit of a more abstract metric.

Catsupppppppppppppp dude 茄蕃, Tuesday, 22 July 2008 21:46 (seventeen years ago)

I'm talking CPU, as reported by top. But I/O is piss all too, so it's basically doing nothing, which is quite nice.

Keith, Tuesday, 22 July 2008 21:48 (seventeen years ago)

Is that not the framework you used in your last job? is that why they took you on? I guess it seems unlikely two places using the same framework (given that there are millions of these f***ers), but possible, I suppose, or maybe you introduced it to them?

Keith, Tuesday, 22 July 2008 21:49 (seventeen years ago)

Yea, I'm v familiar with it and they're letting me use whatever tools I want since I'm the most senior web person. I'm migrating to version 1.1 right now which has an OO form framework. Additionally, I'm starting to move to phpDoctrine which is basically ActiveRecord for php with ActAs and whatnot.

I've suspended most of that work for the time being and have been concentrating 90% of my time on writing open source.

And yes it is using MySQL as the shared memory backing store for the tracker (hopefully in memory tables) because it needs to run on commodity web hosting.

Catsupppppppppppppp dude 茄蕃, Tuesday, 22 July 2008 21:57 (seventeen years ago)

Good stuff. Good luck. I don't use any memory tables, but as I understand it, they're just hash tables. There's no sense in me doing the cross-process overhead when I could just use a Java hash table instead (which is what most of ILX is built on variants of), but as you say for commodity hosting, Java stuff's not that easy to come by; well, at least, not with the control that you typically want. ILX made that kind of easy for me by having a computer of its own.

Keith, Tuesday, 22 July 2008 22:00 (seventeen years ago)

It is a necessity of our business plan -- otherwise we would have probably done this in ruby (and I wouldn't have been involved) which is at tomcat levels of frustratingness. This project has to be "unzip & run" basically.

Catsupppppppppppppp dude 茄蕃, Tuesday, 22 July 2008 22:04 (seventeen years ago)

Yeah, the whole Java/Tomcat stuff really is a total pain in the arse as far as deployment is concerned. I have made a load of improvements of late, but it still takes what would be termed an 'expert' to install it. One day, I may stick up a website and explain how to do it and see if anyone does, but it really isn't anywhere near as easy as it should be.

Keith, Tuesday, 22 July 2008 22:07 (seventeen years ago)

> Someone was enthusing about Processing to me lately, which seems to be a java-based programming environment with some built-in libraries for making graphics stuff easy to the not-really-programmer.

processing great for getting small things up and running and the flickr group is often a joy to behold. coming from java though, i find it a bit restrictive (everything is actually done within a java class so there is stuff you cannot do) and the editor isn't as friendly as your netbeans and your eclipses (our your vims, come to that)

http://www.flickr.com/groups/processing/pool/

koogs, Wednesday, 23 July 2008 17:57 (seventeen years ago)

Was there ever a band called C++ Music Factory?

Oilyrags, Thursday, 24 July 2008 15:24 (seventeen years ago)

Some of those pictures are beautiful, but I had another look at Processing and remembered that it is SO SLOW. All the demos take an age to initalise a window, as do simpler files the aforementioned enthusiast sent me and my own feeble hello-worldish effort. Several minutes to see 320x200 blank pixels because I made a mistake on line 27? Well, OK, I think the 486 I used to run POVRay on still works, I'll try that instead, thanks.

(Maybe it doesn't like Windows, or maybe I'm doing something wrong, or...)

a passing spacecadet, Thursday, 24 July 2008 15:33 (seventeen years ago)

two months pass...

Time.h only seems to give me parameters in seconds. How do I get time in milliseconds ?

Ant Attack |=| (Ste), Friday, 3 October 2008 10:37 (seventeen years ago)

Divide by 100.

caek, Friday, 3 October 2008 10:41 (seventeen years ago)

Sorry.

caek, Friday, 3 October 2008 10:42 (seventeen years ago)

Answer is platform-dependent. e.g. Lunix: http://linux.about.com/library/cmd/blcmdl2_getitimer.htm

caek, Friday, 3 October 2008 10:43 (seventeen years ago)

i need one for a Windows exe.

Ant Attack |=| (Ste), Friday, 3 October 2008 10:46 (seventeen years ago)

GetTickCount() or GetSystemTime()

caek, Friday, 3 October 2008 10:49 (seventeen years ago)

I think

caek, Friday, 3 October 2008 10:49 (seventeen years ago)

thanks, are they in time.h?

Ant Attack |=| (Ste), Friday, 3 October 2008 10:50 (seventeen years ago)

I haven't used Windows since the 90s though, so maybe they only do it to the second

caek, Friday, 3 October 2008 10:50 (seventeen years ago)

win32 api somewhere

caek, Friday, 3 October 2008 10:50 (seventeen years ago)

ta, i'll look into them.

Ant Attack |=| (Ste), Friday, 3 October 2008 10:52 (seventeen years ago)

http://msdn.microsoft.com/en-us/library/ms724408(VS.85).aspx

caek, Friday, 3 October 2008 10:52 (seventeen years ago)

works great! thanks caek

Ant Attack |=| (Ste), Friday, 3 October 2008 12:16 (seventeen years ago)

two weeks pass...

me again, i'm having error problems

i have a class, which i create a pointer to in Winmain. for months it's worked fine as is. I manually call the destructor in the standard way.

now when i add a new int member to the class member list, i get a 'memory can't be read' error message when i close down.

i guess something is happening on destruction of the new variable, but i can't fathom out what.

Ant Attack |=| (Ste), Tuesday, 21 October 2008 09:02 (seventeen years ago)

btw, it makes no difference to whether i initialise the variable in the init() method of the class, or do anything with it in any other methods, or whether i just declare it in the class.h file and do nothing with it. the error always appears.

Ant Attack |=| (Ste), Tuesday, 21 October 2008 09:07 (seventeen years ago)

the code looks something like this:

class opengl {
private:
int m_winheight;
int m_winwidth;
int m_rotvalue; //New member, and the cause of the error
...

Ant Attack |=| (Ste), Tuesday, 21 October 2008 09:15 (seventeen years ago)

My guess is: there was something bad already lurking in the code, to do with object sizes, objects overlapping in memory, or something like that. It was fine in the old code, because the size of your class meant that there was padding at the end of the object; but adding a new member has used up that padding and caused a problem.

Forest Pines Mk2, Tuesday, 21 October 2008 09:51 (seventeen years ago)

you're "manually calling the destructor in the standard way." What do you mean by that?

Woman Who Force Madonna At House Party To Make Bold Statement (Mackro Mackro), Tuesday, 21 October 2008 15:48 (seventeen years ago)

http://media.ebaumsworld.com/picture/thesonofabob/StayPuftMarshmallowMan.png

The Wayward Johnny B, Tuesday, 21 October 2008 16:38 (seventeen years ago)

i mean i'm just manually calling the destructor, because the instance is a pointer.

Ant Attack |=| (Ste), Tuesday, 21 October 2008 17:14 (seventeen years ago)

You should never manually call a destructor.

Either use delete, or just let a declared variable fall out of scope. That's what destructors are for.

Joe Petagno's Imagination Station! (Mackro Mackro), Tuesday, 21 October 2008 17:56 (seventeen years ago)

sorry, i meant i called the delete on the pointer.

Ant Attack |=| (Ste), Tuesday, 21 October 2008 18:37 (seventeen years ago)

i'm getting my terms confused.

Ant Attack |=| (Ste), Tuesday, 21 October 2008 18:38 (seventeen years ago)

oh the plot thickens, less be said this is the last time i rely on someone else's so called 'reusable' code.

Ant Attack |=| (Ste), Tuesday, 21 October 2008 19:18 (seventeen years ago)

i *think* it was the two original variables:

int m_winheight;
int m_winwidth;

upon closer inspection were not being used for anything, and were only initiated on WM_SIZE being called. (the error went away when i flicked to a windowed screen)

anyway, removed, and problem seems to have gone away.

Ant Attack |=| (Ste), Tuesday, 21 October 2008 19:39 (seventeen years ago)

three months pass...

anyone know much about std::lists and pointers ?

I've declared a list of pointers similar to:

list <Pointer*> pointerlist;

so what's the best way of deleting all the objects at the end of those pointers, is it a simple loop through the list, like :

list<Pointer*>::iterator it = pointerlist.begin();
while (it != pointerlist.end() ) {
delete *it;
it++;
}

I have this, and i don't get any memory access or compile errors. how do i know it's working?

Ant Attack.. (Ste), Wednesday, 4 February 2009 13:07 (seventeen years ago)

(i have a feeling i'm only deleting the address in the above code)

Ant Attack.. (Ste), Wednesday, 4 February 2009 13:13 (seventeen years ago)

anyone know why Dev-C++ would suddently start ignoring simple code like

variable++ ;

??
My program has been working fine all day, and all of a sudden half of the code has just gone loopy due to some real randomness.

what could it be?

Ant Attack.. (Ste), Saturday, 7 February 2009 23:54 (seventeen years ago)

Check it in valgrind and check for leaked memory - this is what I always do when things start going funny after compiling ok.

all my single lobsters put a ring on it (tpp), Sunday, 8 February 2009 00:08 (seventeen years ago)

one year passes...

my compiler seems to have an issue with me initialising an array like:

myobject exampleobject[4];

the compiler complains that this line is missing the class constructor parameters, if i do away with the array set up and just create individual objects it works fine.

so why would it hate me declaring an array like this?

bracken free ditch (Ste), Thursday, 11 February 2010 11:28 (sixteen years ago)

the next lines in the code just set up the objects, like

exampleobject[0] = myobject(constructor params etc);

for all 4 objects.

bracken free ditch (Ste), Thursday, 11 February 2010 11:31 (sixteen years ago)

what does the object look like? (and is this c or c++?)

koogs, Thursday, 11 February 2010 13:46 (sixteen years ago)

looks to be fine in c++ as long as the class is defined before you use it.

in c you'd need a typedef on the struct or to add the struct keyword to the array definition.

koogs, Thursday, 11 February 2010 13:58 (sixteen years ago)

(i am ashamed that i had to look that up. which is what happens after 5.5 years of using java)

koogs, Thursday, 11 February 2010 13:59 (sixteen years ago)

the class definition seems okay because i've used it in non array forms too with no problems

the object is just a very basic class which takes four parameters in its construction.

i'll try and do the same thing with another class and see if it comes up with the same error, i guess if it doesn't then we know its a problem with the class itself rather than the array apsect.

bracken free ditch (Ste), Thursday, 11 February 2010 16:47 (sixteen years ago)

It's been ages since I've programmed C++, but wouldn't you usually use an array of pointers to the class?

o. nate, Thursday, 11 February 2010 16:49 (sixteen years ago)

i think both are valid

http://www.cppgameprogramming.com/cgi/nav.cgi?page=arrayclasses

Dog myDogs[5];

koogs, Thursday, 11 February 2010 17:43 (sixteen years ago)

oh, if you use pointers then you have to later create the instances using new and then you get to use the parameters

using the non-pointer form it'll try and use a 0 parameter constructor and will complain if there isn't one. which i think is what you're seeing.

koogs, Thursday, 11 February 2010 17:45 (sixteen years ago)

http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.5

"If your class doesn't have a default constructor, you'll get a compile-time error when you attempt to create an array using the above simple syntax..."

koogs, Thursday, 11 February 2010 17:47 (sixteen years ago)

ahhh default constructor. many many thanks!

bracken free ditch (Ste), Thursday, 11 February 2010 18:55 (sixteen years ago)

three years pass...

if you want to learn to program today, in 2013, for the web, what are the recommended language to focus on? html/html5/css3/ + ruby on rails?

kenjataimu (cozen), Friday, 21 June 2013 10:11 (twelve years ago)

i have asked that question of a few ppl lately they all said html5 & java, emphasis on java

should we bin tapping? (darraghmac), Friday, 21 June 2013 10:16 (twelve years ago)

lol java.

absolutely start with html5 + css3. without them you are nothing.

ruby on rails is kind of a ghetto, but it's a big ghetto. whether it's a good place to start depends on whether you can program in any other language yet. like if you're not familiar with basic procedural programming it's going to turn you into a weird programmer imo.

caek, Friday, 21 June 2013 10:39 (twelve years ago)

ha imma get on to my 'expert' mates and tell them u said so

should we bin tapping? (darraghmac), Friday, 21 June 2013 10:40 (twelve years ago)

We are doing all our new development using python/django (ditching PHP/Zend which all the legacy stuff uses). Seems like that's quite popular at the moment but could be a fad? I dunno.

Just noise and screaming and no musical value at all. (Colonel Poo), Friday, 21 June 2013 10:41 (twelve years ago)

i learnt html/css back in the zen garden days, but at the time the standard text was a previous edition of this

http://www.amazon.com/HTML5-Visual-QuickStart-Guide-Edition/dp/0321719611

caek, Friday, 21 June 2013 10:41 (twelve years ago)

Did they maybe mean javascript? Can't imagine why anyone would say to learn Java for web programming nowadays.

Just noise and screaming and no musical value at all. (Colonel Poo), Friday, 21 June 2013 10:42 (twelve years ago)

your expert mates probably said javascript, which is a necessary evil xxxp

caek, Friday, 21 June 2013 10:42 (twelve years ago)

python is absolutely the best language to learn programming in, and it happens to be useful in many practical situations including web programming.

i'm not super familiar with django, but it seems to have survived the rails onslaught at least.

i know the ultracool kids don't use either any more though.

caek, Friday, 21 June 2013 10:43 (twelve years ago)

belay that book recommendation btw. the author has changed since the edition i had, and the reviews sound ominous.

caek, Friday, 21 June 2013 10:45 (twelve years ago)

FWIW I attempted to teach myself Java about 12 years ago, when my only experience with any kind of coding was simple shell scripts, Commodore BASIC & a bit of SQL and failed miserably. A couple of years later I got a job as a database developer through my SQL experience and learnt Python on the job and found it quite easy in comparison. So I'd echo caek in that python is a good language to start with.

Just noise and screaming and no musical value at all. (Colonel Poo), Friday, 21 June 2013 10:49 (twelve years ago)

all our new, shiny web front ends are done with GWT

http://en.wikipedia.org/wiki/Google_Web_Toolkit

which (i'm told) is javascript 'compiled' from java-like code.

but it'll be something else tomorrow, probably.

koogs, Friday, 21 June 2013 10:50 (twelve years ago)

xp - how useful is python for 'the web' though?

koogs, Friday, 21 June 2013 10:50 (twelve years ago)

Useful enough for Youtube & Reddit, for example.

Just noise and screaming and no musical value at all. (Colonel Poo), Friday, 21 June 2013 10:54 (twelve years ago)

i mean you could start with C or a toolkit, but one is too low level and the other too high.

C is great and fundamental but it's been relegated to computer science these days as higher level languages like python and perl and java have become more polished.

a toolkit or even a specific platform is not the place to start if you can't code. you do need to know a programming language and be at least with variables, flow, etc. if not OOP and functional stuff. the actual language you learn in is not terribly important, but it seems a shame to waste the opportunity to learn a language that is practically useful in 2013, which is where python comes in.

caek, Friday, 21 June 2013 11:23 (twelve years ago)

what's the thinking on CS degree vs. self-taught route?

kenjataimu (cozen), Friday, 21 June 2013 12:41 (twelve years ago)

As someone who did the latter I sometimes wish I'd done a CS degree because my colleagues who did have a much more rounded skillset than I do. Tbh, though, this hasn't really hampered me that much, because I primarily work with higher-level stuff like Python & SQL, so for my job I don't really need to know exactly how machine code works or anything like that, it's more for my own personal curiosity that I'd go back and change my degree subject if I had the chance.

In terms of career prospects, I think it def helps to have a CS degree at the start of your career, but once you have a few years experience behind it doesn't seem to matter a shit. Nobody's ever been bothered about my lack of CS degree.

Just noise and screaming and no musical value at all. (Colonel Poo), Friday, 21 June 2013 12:49 (twelve years ago)

^^^ cosign
My degree is also in a non-CS subject (Information Systems Design, so it's still related), and it was only a slight disadvantage in the first few years after I graduated. And then only really a problem with recruiters and HR wonks ("oh, you don't have a CS degree, oooohhhhhh" <insert teeth sucking sound>).

go cray cray on my lobster soufflé (snoball), Friday, 21 June 2013 13:22 (twelve years ago)

i get the impression it matters much less in development for the web (serious database work notwithstanding) than apps, games, os stuff etc.

caek, Friday, 21 June 2013 13:29 (twelve years ago)

the #trendy #data #science stuff at the moment, it's more useful to have a science/maths phd than a compsci undergrad.

caek, Friday, 21 June 2013 13:30 (twelve years ago)

I have a law degree, will that do

kenjataimu (cozen), Friday, 21 June 2013 13:43 (twelve years ago)

I have a psychology degree, so most probably, yes.

Just noise and screaming and no musical value at all. (Colonel Poo), Friday, 21 June 2013 14:01 (twelve years ago)

Shouldn't be an issue. One programming team I worked with had no-one with a CS degree. In fact they'd come from all kinds of backgrounds. One of the senior programmers had been head of Humanities at a secondary school.

go cray cray on my lobster soufflé (snoball), Friday, 21 June 2013 14:27 (twelve years ago)

I take it jobs are pretty portable? is it common for UK devs to go work in the US? daydreaming: I’d like to work in NYC mebbes

I take the job markets are largely p.bouyant in london, US, even scotland’s had a lot of chat recently about a lack of skilled programmers

kenjataimu (cozen), Friday, 21 June 2013 14:44 (twelve years ago)

I think second-guessing the market in search of a career is a mug’s game tbh; best to do something you enjoy and find worthwhile

it was going down the first route that finds me here in first place

kenjataimu (cozen), Friday, 21 June 2013 14:47 (twelve years ago)

the skills are portable. the problem is finding a company that will get you a H1-B, which is the usual visa you need to work in the US in tech.

the way the wind is blowing, it might be a little easier in 5 years or so. one thing to bear in mind: the spouse of a H1-B is not eligible to work in the US.

ken otm.

caek, Friday, 21 June 2013 14:49 (twelve years ago)

one month passes...

python is absolutely the best language to learn programming in, and it happens to be useful in many practical situations including web programming.

any tips for a good python book for a beginner?

tpp, Monday, 12 August 2013 07:23 (twelve years ago)

http://www.greenteapress.com/thinkpython/thinkpython.html

free and good!

Clay, Monday, 12 August 2013 07:24 (twelve years ago)

for someone looking to learn programming from scratch i should say.

xp

tpp, Monday, 12 August 2013 07:25 (twelve years ago)

this looks perfect thanks

tpp, Monday, 12 August 2013 07:47 (twelve years ago)

i've been doing this! i've used that website, the codecademy python stuff, and the learn python the hard way website.

just sayin, Monday, 12 August 2013 08:46 (twelve years ago)

two months pass...

have to stick with javascript for course purposes, but no harm in learning the discipline in a structured/all-round way i spose

if i need someone to help me find out where all my fucking stuff has saved to nowe that im using eclipse, this could be that thread right? no pressure until tuesday 6pm...

unblog your plug (darraghmac), Monday, 14 October 2013 02:18 (twelve years ago)

there's usually a Eclipse Workspace (or something) directory that it makes. if you File > New > Project then it shows you the default location (or at least mine does, version 3.7.2)

Project > Properties > Resource also shows you for an open project

koogs, Monday, 14 October 2013 08:54 (twelve years ago)

Ta

unblog your plug (darraghmac), Monday, 14 October 2013 09:06 (twelve years ago)

You’re using Eclipse to write JavaScript? Why? It sounds like a PITA.

Allen (etaeoe), Monday, 14 October 2013 19:41 (twelve years ago)

four months pass...

oh, i get it now, ruby on rails is why every website looks and works like shit and why (because website) everyone wants ruby on rails 'developers'

web whatever point 0 is the worst

j., Sunday, 2 March 2014 03:59 (twelve years ago)

one year passes...

fed up now

After installing Windows 10 I seem to have automatically been given Visual Studio Community 2015, because I like to mess about in c++. Previously I was usuing VS express 2013 I think

First things first, I'm a very casual coder - I only write small dumb little games for myself or whatever, I'm not a pro.

So for some reason now nothing compiles, literally trying to compile a simple c++ file which has an #include "iostream" and a basic main function (for now) but nothing else, so it should just compile really easily yeah?

But consistantly being hit with "186 errors", sometimes more. They read along the lines :

variable "errno_t" is not a type name
explicit type is missing ('int' assumed)
(in crtdb.h file which I've not even mentioned in my code)
...and so on, none of the errors make sense in relation to the small code I've written

Internet can only suggest that
This looks like you are compiling against a mix of header files, with some from one compiler version and some from the other.

But I've uninstalled all other Visual Studio versions so I can't see how that's happening.

Any ideas ilx?

Drop soap, not bombs (Ste), Friday, 27 November 2015 14:24 (ten years ago)

don't know about the windows compiler but gcc has flags that'll show you the compilation steps and / or save the files after going through the pre-processor, maybe that'll help.

(i've just re-installed VS 2010 on my vista laptop but haven't compiled anything with it yet)

koogs, Friday, 27 November 2015 14:42 (ten years ago)

Finally, I deinstalled every little thing that had anything to do with VS, including registry entries. Seems to be working now

Drop soap, not bombs (Ste), Friday, 27 November 2015 18:35 (ten years ago)

one year passes...

i've been making an effort to bring myself up to date with the new c++ specifications by reading a few books (meyers, alexandrescu). kind of blown away by how useful some of the new features are ('auto' has already saved me hours of my time) but also how complex the language has become.

tpp, Wednesday, 19 July 2017 05:29 (eight years ago)

eight months pass...

I've been reading/learning c# lately, from what I have gleamed so far it is extremely similar to Java but tailored obviously for Windows.Net

It's also losing me quite often, the maze of interfaces mixed with generics and delegates and whatnot other ways of designing object orientated code makes me think that I'm never going to fully conquer this one.

In space, pizza sends out for YOU (Ste), Wednesday, 18 April 2018 18:59 (eight years ago)

oh god don't confuse me, just about starting to get my head around some of the common java patterns

thomasintrouble, Wednesday, 18 April 2018 19:54 (eight years ago)

is Java still something worth pursueing these days, from a career perspective? I kinda bailed just before getting to know the advanced stuff, but it was useful for some modding programming.

Feel like cowering back into BASIC retro computer programming right now, for a procedural one last hit.

In space, pizza sends out for YOU (Ste), Wednesday, 18 April 2018 21:34 (eight years ago)

Android uses Java, so yes.

Meme Imfurst (Leee), Wednesday, 18 April 2018 21:35 (eight years ago)

C# syntax has improved quite a bit over the last few years and I think it's nicer to use than Java but tbh I don't have much Java experience

Colonel Poo, Wednesday, 18 April 2018 21:39 (eight years ago)

Java and C# are virtually interchangeable to me at this point. I say focus on whichever one you need for your current job and make up some silly side project to keep your toes in the water with the other one.

Embalming is a flirty business (DJP), Thursday, 19 April 2018 00:57 (eight years ago)


You must be logged in to post. Please either login here, or if you are not registered, you may register here.