Go Back   English Forum Switzerland > Off-Topic > Off-Topic > General off-topic
Reply
 
Thread Tools Display Modes
  #1  
Old 13.12.2009, 23:52
Junior Member
 
Join Date: Nov 2009
Location: Zurich
Posts: 91
Groaned at 2 Times in 2 Posts
Thanked 45 Times in 26 Posts
Alan_Zurich has no particular reputation at present
Programmers - What Did You Learn The Hard Way?

We've all had those days where we spend hours and hours trying to fix a problem and then make a revelation that was a lesson well learned. Until I started programming professionally I was entirely self-taught, which usually meant long afternoons not understanding how to do things properly (I never used a debugger which really made things hard...)

In php I couldn't understand why this wouldn't work when I added up:

$sum = 10;
if ($sum = 10) { ... }

When I finally learned equivalance, suddenly it became obvious to:

$sum = 10;
if ($sum == 10) { ... }

The next thing was trying to self-learn object-oriented programming in .NET. The whole concept just didn't make sense, and it was probably due to over-complicated analogies, i.e.

Car car = new Car();

To anyone with a background in OOP this is as simple as it gets. You're creating a new car object. But it took a long time before I could 'think in OOP.' Once I finally got it, it all made sense.

I look back at the stuff I did three years ago and facepalm. Anyone else looking back at older code have WTF moments? What things have you learned the hard way? And if you could speak to yourself a year or two in the past, what advice would you give yourself?
Reply With Quote
  #2  
Old 13.12.2009, 23:56
sygirl101's Avatar
Forum Veteran
 
Join Date: Jun 2009
Location: Zurich
Posts: 500
Groaned at 0 Times in 0 Posts
Thanked 376 Times in 162 Posts
sygirl101 has a reputation beyond reputesygirl101 has a reputation beyond reputesygirl101 has a reputation beyond reputesygirl101 has a reputation beyond reputesygirl101 has a reputation beyond repute
Re: Programmers - What Did You Learn The Hard Way?

One of the big things that still bugs me when I'm doing a more serious project is multiple threads. I invariably screw something up and spend hours trying to debug.

One of my saddest programming moments was when I realized MATLAB could (a) handle OOP and (b) could import JAVA classes. I spent hours on 1000s of lines of code that could have been written nicely in about 100 lines. Truly a facepalm moment.

I still quite often have facepalm moments, but that's why I'm a real engineer, not a code monkey.
Reply With Quote
  #3  
Old 14.12.2009, 00:09
jacek's Avatar
Forum Legend
 
Join Date: Oct 2007
Location: Aargau
Posts: 7,774
Groaned at 98 Times in 77 Posts
Thanked 5,253 Times in 2,949 Posts
jacek has a reputation beyond reputejacek has a reputation beyond reputejacek has a reputation beyond reputejacek has a reputation beyond reputejacek has a reputation beyond reputejacek has a reputation beyond repute
Re: Programmers - What Did You Learn The Hard Way?

I started programming as one of the subjects at varsity and except few mini-projects with Visual Basic and C, C++ and some Assembly, I never used it until implementaion of part of my R&D projects in electrical engineering. Then I started using more C language with PIC, 8051 microprocessor and eventually with DSP's. Initially it looked like black-magic and I couldn't figure out the memory mapping, registers and my all time hated subject were interrupts, where to mask and unmask them. Early platforms did not make much sense to me and I had to figure out all by myself, how it all functioned. Somehow I managed to get the things working but if you look at it from programmers point of view you could pick up more errors. My classical problems were "for" and "if" loops, timers and interrupts. After a while these things started making more sense.

These days I use lot of MATLAB/Simulink and*.m script programming. Lots of operations on maticies and arrays exercise your brain and after a while it all becomes daily bread, piece of cake and easy to be digested
__________________
🎾That's what we do to help English speaking expats community in Switzerland:
General Information About Swiss Tennis
Tennis Lessons Summer Winter Seasons
🎾🎾Our charity organization to help unprivileged kids to realize their dreams:
FMTF Supports Tennis For Children in Southern Africa
Reply With Quote
  #4  
Old 14.12.2009, 00:10
flavio's Avatar
Forum Veteran
 
Join Date: Jun 2009
Location: Winterthur
Posts: 747
Groaned at 67 Times in 38 Posts
Thanked 596 Times in 333 Posts
flavio has a reputation beyond reputeflavio has a reputation beyond reputeflavio has a reputation beyond reputeflavio has a reputation beyond repute
Re: Programmers - What Did You Learn The Hard Way?

Quote:
View Post
One of the big things that still bugs me when I'm doing a more serious project is multiple threads.
Off-topic but somehow related: Are multiple threads lately replaced by MapReduce/Hadoop?
Reply With Quote
  #5  
Old 14.12.2009, 00:16
sygirl101's Avatar
Forum Veteran
 
Join Date: Jun 2009
Location: Zurich
Posts: 500
Groaned at 0 Times in 0 Posts
Thanked 376 Times in 162 Posts
sygirl101 has a reputation beyond reputesygirl101 has a reputation beyond reputesygirl101 has a reputation beyond reputesygirl101 has a reputation beyond reputesygirl101 has a reputation beyond repute
Re: Programmers - What Did You Learn The Hard Way?

Quote:
View Post
Then I started using more C language with PIC, 8051 microprocessor and eventually with DSP's.
Totally had the same problem with Assembly and stuff.

Gods, those 8051 and PICs just made my life miserable. Cool what you could do with old technology, but all that low level programming just made me cry and huddle around my laptop as I sobbed "please just let me at least use C!"

Quote:
View Post
Off-topic but somehow related: Are multiple threads lately replaced by MapReduce/Hadoop?
Not in any of my applications. I've never had use for MapReduce in any of my programs. But I'm doing hardware/embedded stuff mainly.

Editted to add: Another error is how different languages have different symbols for not. There's "!=" or "~=" and some more isoteric ones. I invariably use the wrong one for at least the first hour after switching between languages.
__________________
Floccinaucinihilipilification: act of describing something as useless.
Reply With Quote
  #6  
Old 14.12.2009, 00:21
Junior Member
 
Join Date: Nov 2009
Location: Zurich
Posts: 91
Groaned at 2 Times in 2 Posts
Thanked 45 Times in 26 Posts
Alan_Zurich has no particular reputation at present
Re: Programmers - What Did You Learn The Hard Way?

Quote:
View Post
Off-topic but somehow related: Are multiple threads lately replaced by MapReduce/Hadoop?
I'm not sure which language you're talking about, probably in MATLAB right? Multi-Threading is fairly straightfoward in .NET languages. If you're just looking to spawn a background thread there are some really neat things to tap into like the BackgroundWorker component. As someone who hasn't worked in MATLAB, am I right in saying it's more difficult to do things like this than in Java/C#/Python?
Reply With Quote
  #7  
Old 14.12.2009, 00:22
Junior Member
 
Join Date: Nov 2009
Location: Zurich
Posts: 91
Groaned at 2 Times in 2 Posts
Thanked 45 Times in 26 Posts
Alan_Zurich has no particular reputation at present
Re: Programmers - What Did You Learn The Hard Way?

Quote:
View Post
Totally had the same problem with Assembly and stuff.

Gods, those 8051 and PICs just made my life miserable. Cool what you could do with old technology, but all that low level programming just made me cry and huddle around my laptop as I sobbed "please just let me at least use C!"



Not in any of my applications. I've never had use for MapReduce in any of my programs. But I'm doing hardware/embedded stuff mainly.

Editted to add: Another error is how different languages have different symbols for not. There's "!=" or "~=" and some more isoteric ones. I invariably use the wrong one for at least the first hour after switching between languages.
I'm the same with excel. The whole syntax takes a brain-switch! i.e.

IF(AND(B12<>'10', C12='20'),B12,"")
Reply With Quote
  #8  
Old 14.12.2009, 00:24
Dougal's Breakfast's Avatar
Forum Legend
 
Join Date: Nov 2007
Location: GL
Posts: 16,445
Groaned at 1,045 Times in 807 Posts
Thanked 43,550 Times in 13,473 Posts
Dougal's Breakfast has a reputation beyond reputeDougal's Breakfast has a reputation beyond reputeDougal's Breakfast has a reputation beyond reputeDougal's Breakfast has a reputation beyond reputeDougal's Breakfast has a reputation beyond reputeDougal's Breakfast has a reputation beyond repute
Re: Programmers - What Did You Learn The Hard Way?

Quote:
Programmers - What Did You Learn The Hard Way?


Not to leave the tape next to the television speakers.
Reply With Quote
  #9  
Old 14.12.2009, 00:33
Forum Veteran
 
Join Date: Jul 2007
Location: Vaud
Posts: 2,043
Groaned at 131 Times in 93 Posts
Thanked 3,722 Times in 1,420 Posts
Mikers has a reputation beyond reputeMikers has a reputation beyond reputeMikers has a reputation beyond reputeMikers has a reputation beyond reputeMikers has a reputation beyond reputeMikers has a reputation beyond repute
Re: Programmers - What Did You Learn The Hard Way?

Quote:
View Post
I'm not sure which language you're talking about, probably in MATLAB right? Multi-Threading is fairly straightfoward in .NET languages. If you're just looking to spawn a background thread there are some really neat things to tap into like the BackgroundWorker component. As someone who hasn't worked in MATLAB, am I right in saying it's more difficult to do things like this than in Java/C#/Python?
Mapreduce and hadoop are distributed/cloud based development libraries ans tools.
Reply With Quote
  #10  
Old 14.12.2009, 00:46
Junior Member
 
Join Date: Nov 2009
Location: Zurich
Posts: 91
Groaned at 2 Times in 2 Posts
Thanked 45 Times in 26 Posts
Alan_Zurich has no particular reputation at present
Re: Programmers - What Did You Learn The Hard Way?

Quote:
View Post
Mapreduce and hadoop are distributed/cloud based development libraries ans tools.
Just read that Mapreduce is available in C++, C#, Erlang, Java, Python, Ruby, F#, R among others (via Wikipedia). I have to admit that I have no experience in the more mathematically-based programming you're involved in. I think they are quite distinct skillsets that have a conceptual overlaps at least
Reply With Quote
  #11  
Old 14.12.2009, 14:48
ipoddle's Avatar
Forum Veteran
 
Join Date: Jan 2008
Location: basel
Posts: 812
Groaned at 20 Times in 13 Posts
Thanked 708 Times in 303 Posts
ipoddle has earned the respect of manyipoddle has earned the respect of manyipoddle has earned the respect of many
Re: Programmers - What Did You Learn The Hard Way?

that there was no money in it...
Reply With Quote
  #12  
Old 14.12.2009, 15:17
bigblue2's Avatar
Forum Legend
 
Join Date: Mar 2009
Location: Glarus
Posts: 6,824
Groaned at 333 Times in 272 Posts
Thanked 11,163 Times in 4,498 Posts
bigblue2 has a reputation beyond reputebigblue2 has a reputation beyond reputebigblue2 has a reputation beyond reputebigblue2 has a reputation beyond reputebigblue2 has a reputation beyond reputebigblue2 has a reputation beyond repute
Re: Programmers - What Did You Learn The Hard Way?

not to give the publisher the code to the game they said they where going to publish.
Reply With Quote
  #13  
Old 14.12.2009, 15:33
weejeem's Avatar
Forum Legend
 
Join Date: Nov 2008
Location: .
Posts: 3,728
Groaned at 37 Times in 31 Posts
Thanked 5,874 Times in 2,467 Posts
weejeem has a reputation beyond reputeweejeem has a reputation beyond reputeweejeem has a reputation beyond reputeweejeem has a reputation beyond reputeweejeem has a reputation beyond reputeweejeem has a reputation beyond repute
Re: Programmers - What Did You Learn The Hard Way?

Quote:
View Post
Off-topic but somehow related: Are multiple threads lately replaced by MapReduce/Hadoop?
Depends on whether a shared process context needs to be available to
the multiple "threads", since Mapper/Reducer tasks are spawned off as
child processes in separate JVMs.

Learned the hard way...

* EBCDIC is a pain in the proverbials.

* Fight any temptation to "delete from dual;"

* rm -rf // as root on a 200-workstation network is A Very Bad Thing.
.

Last edited by weejeem; 14.12.2009 at 18:19. Reason: Convert Gibberish to English.
Reply With Quote
  #14  
Old 14.12.2009, 15:53
Senior Member
 
Join Date: Apr 2007
Location: Glasgow
Posts: 393
Groaned at 4 Times in 4 Posts
Thanked 330 Times in 157 Posts
Fraser has a reputation beyond reputeFraser has a reputation beyond reputeFraser has a reputation beyond reputeFraser has a reputation beyond repute
Re: Programmers - What Did You Learn The Hard Way?

Quote:
View Post
What things have you learned the hard way? And if you could speak to yourself a year or two in the past, what advice would you give yourself?
I guess the lesson that every programmer learns is that standing in the kitchen at parties quoting monty python sketches wont get you laid.
Reply With Quote
  #15  
Old 14.12.2009, 16:08
weejeem's Avatar
Forum Legend
 
Join Date: Nov 2008
Location: .
Posts: 3,728
Groaned at 37 Times in 31 Posts
Thanked 5,874 Times in 2,467 Posts
weejeem has a reputation beyond reputeweejeem has a reputation beyond reputeweejeem has a reputation beyond reputeweejeem has a reputation beyond reputeweejeem has a reputation beyond reputeweejeem has a reputation beyond repute
Re: Programmers - What Did You Learn The Hard Way?

Quote:
View Post
I guess the lesson that every programmer learns is that standing in the kitchen at parties quoting monty python sketches wont get you laid.
A simple "My hovercraft is full of eels." has never failed me yet!
.
Reply With Quote
  #16  
Old 14.12.2009, 16:43
Newbie 1st class
 
Join Date: Aug 2009
Location: Zurich
Posts: 28
Groaned at 1 Time in 1 Post
Thanked 27 Times in 15 Posts
geekosaurus has made some interesting contributions
Re: Programmers - What Did You Learn The Hard Way?

Quote:
View Post
One of the big things that still bugs me when I'm doing a more serious project is multiple threads.
Threads are hard, and for non-trivial thread/task interaction one will almost certainly miss out on certain cases.

D has a nice solution to it than the current set of imperative languages - storage is automatically thread-local, so the default is to act in the thread-local space instead of the process space. I have read that D's TLS lacks in the speed department though.
Reply With Quote
  #17  
Old 14.12.2009, 16:44
Newbie 1st class
 
Join Date: Nov 2009
Location: Zurich
Posts: 18
Groaned at 0 Times in 0 Posts
Thanked 5 Times in 4 Posts
golgoth has no particular reputation at present
Re: Programmers - What Did You Learn The Hard Way?

When I was starting out with C++, I remember mistakenly typing a class member function definition like this (in the .cpp file):

void somefunc( ... )

It was in some code we had to update and edit and had been a very long day and night. I got some of the most bizarre compiler errors until I realised that it should have been:

void MyClass::somefunc( ... )

Years later, I managed to repeat a similar thing...assuming that it must be something complicated.

One thing I never needed to be taught, though, was this kind of thing I saw from a well-known company whose code we took over:

typedef int Int
typedef char String
(and so on)

Thrown is a hefty dose of Hungarian notation, mock-polymorphism, class and variable names in excess of 32 characters...
Reply With Quote
  #18  
Old 14.12.2009, 16:51
Slaphead's Avatar
Moderato espressivo
 
Join Date: May 2007
Location: Zürich
Posts: 3,243
Groaned at 41 Times in 37 Posts
Thanked 9,408 Times in 2,870 Posts
Slaphead has a reputation beyond reputeSlaphead has a reputation beyond reputeSlaphead has a reputation beyond reputeSlaphead has a reputation beyond reputeSlaphead has a reputation beyond reputeSlaphead has a reputation beyond repute
Re: Programmers - What Did You Learn The Hard Way?

How to spell "Environment"
Reply With Quote
  #19  
Old 14.12.2009, 16:54
sygirl101's Avatar
Forum Veteran
 
Join Date: Jun 2009
Location: Zurich
Posts: 500
Groaned at 0 Times in 0 Posts
Thanked 376 Times in 162 Posts
sygirl101 has a reputation beyond reputesygirl101 has a reputation beyond reputesygirl101 has a reputation beyond reputesygirl101 has a reputation beyond reputesygirl101 has a reputation beyond repute
Re: Programmers - What Did You Learn The Hard Way?

Quote:
View Post
I guess the lesson that every programmer learns is that standing in the kitchen at parties quoting monty python sketches wont get you laid.
It truly depends where that kitchen is. Amongst other nerds, it can work quite well.
Reply With Quote
  #20  
Old 14.12.2009, 16:58
Ouchboy's Avatar
Forum Legend
 
Join Date: Jun 2008
Location: Baden
Posts: 3,032
Groaned at 33 Times in 28 Posts
Thanked 4,545 Times in 1,776 Posts
Blog Entries: 19
Ouchboy has a reputation beyond reputeOuchboy has a reputation beyond reputeOuchboy has a reputation beyond reputeOuchboy has a reputation beyond reputeOuchboy has a reputation beyond reputeOuchboy has a reputation beyond repute
Re: Programmers - What Did You Learn The Hard Way?

"It's 5:50 a.m., Do you know where your stack pointer is?"


[ No, and my program doesn't, either! ]


Last edited by Ouchboy; 14.12.2009 at 17:04. Reason: i thought people might like the cartoon.
Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SAP ABAP Programmers RyanValdez Jobs wanted 18 25.04.2009 08:47
How hard can this be???....... Really??? Island Monkey Employment 14 13.02.2009 14:25
Reasons why the English language is hard to learn JVC Language corner 37 16.01.2009 21:20
Looking hard for a wedding planner David Wood Introductions 0 27.01.2008 21:18


All times are GMT +2. The time now is 09:23.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0