Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 369 370 [371] 372 373 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 903708 times)

MorleyDev

  • Bay Watcher
  • "It is not enough for it to just work."
    • View Profile
    • MorleyDev
Re: if self.isCoder(): post() #Programming Thread
« Reply #5550 on: March 09, 2014, 08:09:08 am »

Languages like C++ are slower to parse. Any kind of respectable IDE support has only started to get good incredibly recently compared to C# and Java, so not getting any real benefits from an IDE is more understandable. Autocomplete support recently has improved significantly, with tools that can finally understand complicated templates and the like, but that's available even in vim/emacs since you can hook those up to a clang-based parser. Refactoring support is still lagging behind significantly.

For languages like C#/Java, whilst I could work without an IDE it wouldn't be as fun. TDD would be much more difficult to carry out effectively without Resharper or IntelliJ, since I couldn't do things like let the IDE autogenerate function and class declarations for me as I write them in the tests, or have it manage moving classes to different namespaces or breaking functions into different classes. It just saves so much time.
« Last Edit: March 09, 2014, 08:44:48 am by MorleyDev »
Logged

GlyphGryph

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5551 on: March 09, 2014, 08:46:24 pm »

This is true, but in my own experiences you would have to write exceptionally bad code to break a decent IDE.
How good are IDEs at tracking metaprogramming, by the way? I know historically, at work, it's been a bit of a problem hunting down metaprogramming interactions, and in many programming paradigms metaprogramming is pretty common.

In other news, I am actually using Eclipse now, or might be, since libgdx claims to require it, but I am reminded why I hate it so much.

Actually, I hate Java too. Why is such a goddamn headache to get the Dev SDK I need for Android compatibility?
« Last Edit: March 09, 2014, 09:11:10 pm by GlyphGryph »
Logged

gogis

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5552 on: March 11, 2014, 02:32:04 pm »


My co-workers on a regular basis need to deal with  about 45 million lines of code.   It is possible to keep the gist of how it all works in your head.  Not specifics, just the overview.  It is a case of knowing the flow of the data, not the specifics.

These guys are not all wizards.  Some are, some are not.
Could a really good IDE be a boon to some of them?  Yes.
Do some of them need it?  Nope.

Many of them came out of the age when there were no good IDEs.
So it got kept in the head.  It you doubted what was going on, another window got opened.
And a phone call was placed to get a second set of eyes on the code in general.

IDEs can be great.
I will never deny that.
But things get complex enough, and there are some very nasty side effects that take about 4 months to show up that a GUI will never catch.

How do these things get noticed?
Usually when someone gets bit by them at 0300.

Breaking during QA is almost expected.
Not ideal, but if everyone was perfect, QA would not need to exist ( And they need to.  Everyone will make a mistake eventually  ).
Break something in production and you learn.

The mantra in my workplace is "Do not impact the Person On the Street."
We have wiggle room beyond that.

gnome

I also came from times when IDE's not existed. I remember punch cards as well  :D And yes, I use simpler tools to code aswell, notably I write bash scripts in Notepad++ mostly out of habit. But efficiency is a key if you really aware of speed and productivity. Pretty much always. And I feel very gimped having only terminal and vim in my hands. It's just feels excruciatingly slow.
Also, you notion of 45mil lines of code - it's exactly the case when blazingly fast indexed search of IDE comes into play.
Also it's really question of quality of IDE. I personally found Eclipse/Coda/Netbeans to be very bad, but IntelliJ very good. You just need to try more stuff.
Logged
In Soviet Russia cigarette smokes you

dragnar

  • Bay Watcher
  • [Glub]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5553 on: March 12, 2014, 11:45:43 am »

So, all the IDE debate aside: I'm having some trouble with SQL. Namely, I'm learning it for a graduate class, and can't seem to get a conditional update query working. This one specifically:
Code: [Select]
IF EXISTS (SELECT * FROM Applications WHERE STUDENT_ID="902076179")
  UPDATE Applications SET (LAST_NAME="DERP") WHERE STUDENT_ID="902076179"
ELSE
  INSERT INTO Applications (LAST_NAME) VALUES "HERP"
...Well ok, obviously not that one EXACTLY, but that's the super-short example bit I've been trying to get working before I actually write the parsing code I'll need for the full thing. Looks like the exact syntax used in all the examples I can find, but it's failing to run and giving me this instead in phpmyadmin: (Yes, I know it's SQL parser is a bit iffy at times, but I'd think this would be basic enough to work without any issue.)

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS (SELECT * FROM Applications WHERE STUDENT_ID="902076179") UPDATE Ap' at line 1
Logged
From this thread, I learned that video cameras have a dangerosity of 60 kiloswords per second.  Thanks again, Mad Max.

gogis

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5554 on: March 12, 2014, 05:09:46 pm »

So, all the IDE debate aside: I'm having some trouble with SQL. Namely, I'm learning it for a graduate class, and can't seem to get a conditional update query working. This one specifically:
Code: [Select]
IF EXISTS (SELECT * FROM Applications WHERE STUDENT_ID="902076179")
  UPDATE Applications SET (LAST_NAME="DERP") WHERE STUDENT_ID="902076179"
ELSE
  INSERT INTO Applications (LAST_NAME) VALUES "HERP"
...Well ok, obviously not that one EXACTLY, but that's the super-short example bit I've been trying to get working before I actually write the parsing code I'll need for the full thing. Looks like the exact syntax used in all the examples I can find, but it's failing to run and giving me this instead in phpmyadmin: (Yes, I know it's SQL parser is a bit iffy at times, but I'd think this would be basic enough to work without any issue.)

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS (SELECT * FROM Applications WHERE STUDENT_ID="902076179") UPDATE Ap' at line 1

Have you checked
http://dev.mysql.com/doc/refman/5.6/en/insert-on-duplicate.html
Logged
In Soviet Russia cigarette smokes you

gnome42

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5555 on: March 12, 2014, 11:49:00 pm »


Blah blah blah.
Gnome might try justify his case and just wander off into unproductive ranting.
Gnome is most likely wrong
gnome

Heavily edited to make more fun of me than anyone else

I also came from times when IDE's not existed. I remember punch cards as well  :D And yes, I use simpler tools to code aswell, notably I write bash scripts in Notepad++ mostly out of habit. But efficiency is a key if you really aware of speed and productivity. Pretty much always. And I feel very gimped having only terminal and vim in my hands. It's just feels excruciatingly slow.
Also, you notion of 45mil lines of code - it's exactly the case when blazingly fast indexed search of IDE comes into play.
Also it's really question of quality of IDE. I personally found Eclipse/Coda/Netbeans to be very bad, but IntelliJ very good. You just need to try more stuff.

I never said this code was the best. 
Hell half of it was written by Fortran folks that really needed a Clue-By-four applied to them about certain language specifics ( 0 based VS 1 based ), 

All of us are Guilty about this eventually. It happens

Pick a standard.  those of us that support it afterwards will conform to it( maybe ).

Just that in a mature situation ( defined as, "well, it works" ) you can run into this anywhere.

Fortunately/Unfortunately you can run into situations where the people trying to figure out the logic ( be it code monkeys after the fact, or designers of the IDE ) do not have that built in bias

If you are working in a shop that does not have that kind of bias? 
Great, you are ahead of the game.
But never assume that that assumptions by the designers/implementers were the same as what you learned as the standard.

If the code predates you, always double check the assumptions.

The newer methods are not wrong.

They just stand the chance of having nothing to do with the system you are tasked to support.

Language of the week ( Fortran/Cobol/C/Java/PHP/Eta al) 
ANY of them can the job done.  ( the only difference is where the issues come up )

It is the assumptions made on how things should work that will bite you in the butt at the wrong moment.

IDEs are great.
The fact that they were written to conform to the standard, as apposed to what really works is not a bad thing.

Maybe what I am trying to say in a less than perfect way is that you may look at it ( and have the compliler/IDE  just puke on it with warnings) does not mean that it is wrong.

It might be absolute crap that is based on an older language that does not apply in this case.
Then again, it might be something that will blow your socks off with "How in the hell did they figure out this would work this well?"

The first case you put up with and try to fix over time.

The second case you sit back in awe over what was achieved.

Stare at it.  Get confused as hell.  Spend weeks just wondering why it even worked at all.

Then the light dawns. ooooohhhhh this is why this works

The subtle difference between complete crap and the most elegant code you will ever see is a very fine line.

It is recognizing where the line is that is the hard part.

Recognizing the three different things that will turn that wonderful code to complete crap is the next stage.

Writing that code that makes everyone go "What?  Does this even work???" is the final stage

Not that you should do this out of hand.
It is a very bad practice. 
Since even you will come back to it six months later and wonder why it works and what drugs you took to even design it in the first place.

It most likely makes sense at the time you wrote it, but hours of (no)sleep/Booze/Drug of the week have a lot to do with the mental state at the time you came up with it, and most of the time, those cases have nothing to do with now.  Sleep deprivation and massive coffee intake are much harder to reproduce than just outright doing anything else on a regular basis.

Basic design evolves. the tools get better.

This is a good thing

But never assume that what came  before is wrong.
It very well could be.  It also might make sense in some weird way.  ( not a good way, just a way )

Many of the long standing folks in software can be pricks.

Unfortunately, the reason behind this may have nothing to do with you.

I've been on both sides of this.
Complete noob getting told off about some questions.
More senior person training someone up.

Unfortunately,in many cases, those that know how things work get tasked with training the new hires, without any input on the hiring process.
If we( Seniors) are not complete assholes?  Okay, we will explain it to you the first two times.

You could be good.  You might be exactly what we are looking for, and we should  want to get you to the point where you can be left alone.   We really are looking for our replacements in larger companies.

Then we have the ones that are not well suited for the job.  Could be the basic coding aspect, could be the abilty to grasp the overview of how the system functions, could be that they just do not give a damn to learn, If SRs care at this point, we will point out what we think is the why.

Deal with more of the last sort and you get burned out on it.
Which is a failing on our parts, but it really is a case of self defense.
Find the problem.( 90% of the time in several minutes just because we have screwed it up ourselves.  Most of the more interesting mistakes are learned the hard way.  Either we just outright screwed up, or had to fix a latent bug that predates even us, We can can learn from both )  Give the JR enough information to isolate and correct the issue without further input in a way that does not involve file name and line numbers. I.E teach them
If they fail in this?  Fix it anyway.
Work harder to get the JRs to understand how to isolate the problem. ( and we never have instruction in this area.  We all learn by screwing this up as well.  Some are naturals.  Some learn after a few screw up.  Some are never good at it )

Problem solving, data analysis, and confidence in the solution are some of the harder things to teach. ( Not just "I think this is why it broke".  knowing full well what caused it to break, why the fix is correct, and the reasons that the fix should be installed now or after some testing.   Let alone the confidence to state to a customer "I[/]i broke it right here.  This bit?  garbage.  Complete crap. It is the worst code ever written.  But here is why I know it is crap, and why I have faith in the fix".  If you cannot have this kind of conversation with the Customer ( and the flip side is being able to point out " Uh, you agreed to this" or "Uh, you stated it should work like this in this meeting on this date, why are we having this conversation???") without an issue, than making a mistake that an IDE or a context sensitive editor is the least of your problems]

IDE's are perfect for highlighting the basic mistakes of "Structure?  what member are you even trying to reference?" that the compiler will puke on anyway.  They save time there.

They do nothing to understand the side effects of what you just did to the data.

Nothing that gets complied can completely replace the human brain at this stage for problem analysis.
We are a few years off yet.

The day an AI system comes out that can do what I do? 
I will retire,grow Hot Peppers for a living, be happier for it, and wonder why I did not switch over sooner.

I just do not really expect this to happen before I can retire anyway, and then spend most of my time pissing off the wife(more) instead of the customer.

Seniors can be the biggest assholes you will ever deal with.

Sometime we are so burned out with folks that never should have been hired, that we stop training our replacements properly, despite our own self interests.  The better JRs are trained, the less we have to deal with during times that we would really rather be doing something else.

One clue is "Is this the first time I asked this question?  Did I listen when taught?"

If this Senior is a prick every time? 
It is the Senior. If you can find another mentor in the company, use them.  No?  Run like hell.

Is the Senior a prick after the second or third time the same question is asked?
Do most of the seniors react this way eventually( assuming more than one or two persons )?
Umm, it might not be them.
It could be you are not a fit for this area of work.

Various areas of CS have vastly different mindsets.  some folks are very suited to one area and not another.

Some folks are really good at having tn thoughtless understanding of User Interfaces.  They just do not have to think about it.  They just know it is right.
Some folks understand data flow.
Some folks understand how to get data tofly[ in a slick way.
( I have done enough of all of this to know the difference.  I suck at User interface.   I know this, and try to fight anything that involves it.  I will do it wrong without specifics.  So if someone more suited is available?  Get them to do it )

This is your target.  What matches your skills/mindset? 
Realize what you are good at.  Working in that area will make you the most fulfilled. 

Seek out jobs that leverage those strengths.

Computer Science is not hard. 
Figuring out what part of CS you are the best at is the hard part. And then finding the Job to match that.


gnome

Logged

gnome42

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5556 on: March 13, 2014, 12:31:50 am »

Man I turned into the wall of text from hell. 

TLDR:
Seniors are pricks, but there might be a reason.
Find out what you are good at and enjoy.
Concentrate there.  You are happier, every one is happier.
When this gets figured out, we should shrug and suggest having a beer when it is solved at 0600.
First two rounds on the Junior.
The next 10 on the Senior.

Manger drives our piss-drunk asses home.

gnome


Logged

Sheb

  • Bay Watcher
  • You Are An Avatar
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5557 on: March 13, 2014, 03:06:23 am »

You should write haikus gnome.

IDE sucks lots
Except when they don't
I am grumpy cat
Logged

Quote from: Paul-Henry Spaak
Europe consists only of small countries, some of which know it and some of which don’t yet.

gnome42

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5558 on: March 13, 2014, 03:33:17 am »

You should write haikus gnome.

IDE sucks lots
Except when they don't
I am grumpy cat

Maybe
All code sucks
Except when beautiful
I am jaded bastard

Which most likely really sucks as a Haiku. 
At 0330+  can't be buggered to remember/google the syllable counts.





Logged

kaijyuu

  • Bay Watcher
  • Hrm...
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5559 on: March 13, 2014, 09:16:39 am »

5/7/5
Logged
Quote from: Chesterton
For, in order that men should resist injustice, something more is necessary than that they should think injustice unpleasant. They must think injustice absurd; above all, they must think it startling. They must retain the violence of a virgin astonishment. When the pessimist looks at any infamy, it is to him, after all, only a repetition of the infamy of existence. But the optimist sees injustice as something discordant and unexpected, and it stings him into action.

GlyphGryph

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5560 on: March 13, 2014, 10:19:55 am »

In other news - I finally got the android emulator working on my system and successfully deployed me ruby app to it! I also have /another/ ruby app that I've successfully hooked up to the Java libraries I'll be needing. Plenty of speed bumps, but I am making steady progress in my attempts to CONQUER MOBILE.

I even got eclipse working! (Haven't used it yet, but I did get it working)

Turns out all I needed to do was install a new operating system (I was a year and a half behind the most recent). Easy peasy, boom, the worst quarter of my problems were fixed.

Considering just going with Java instead of Ruby at this point - the libraries are fully compatible, of course, and it all compiles down to Dalvik bytecode in the end, but Eclipse don't play well with Ruby, apparently, and if I want to minimize the effort spent in cross-compiling to a multitude of targets, it still seems like Eclipse is the way to go. Sadly.
Logged

MorleyDev

  • Bay Watcher
  • "It is not enough for it to just work."
    • View Profile
    • MorleyDev
Re: if self.isCoder(): post() #Programming Thread
« Reply #5561 on: March 13, 2014, 10:38:31 am »

Java: Compile once run anywhere. Unless you're doing anything involving networking on multiple threads. Then it'll run on the OS you wrote it, but have weird race conditions on other OSs.

Or involving keyboard input, because Linux and Windows treat holding a key down differently (Windows repeats key down until you release, Linux rapidly fires key up and a key down immediately afterwards).

Damnit Java, you had one job!
Logged

da_nang

  • Bay Watcher
  • Argonian Overlord
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5562 on: March 13, 2014, 03:35:43 pm »

Minor nitpick is that Java doesn't have an escape character for line separator independent from the OS. It's either System.getProperty("line.separator"); or cry.
Logged
"Deliver yesterday, code today, think tomorrow."
Ceterum censeo Unionem Europaeam esse delendam.
Future supplanter of humanity.

GlyphGryph

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5563 on: March 13, 2014, 03:43:09 pm »

Java: Compile once run anywhere. Unless you're doing anything involving networking on multiple threads. Then it'll run on the OS you wrote it, but have weird race conditions on other OSs.

Or involving keyboard input, because Linux and Windows treat holding a key down differently (Windows repeats key down until you release, Linux rapidly fires key up and a key down immediately afterwards).

Damnit Java, you had one job!

And thank god I have libraries to hopefully handle this stuff for me! And technically it's only anywhere you have a JVM, just like any other bytecode/interpreted language. Ruby is run-anywhere too!
Logged

Mephisto

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5564 on: March 13, 2014, 03:46:45 pm »

If I ever have to do mobile development (hey, it could happen - work mentions it in passing now and then), I'm going to see if I can sell anyone on Kivy.
Logged
Pages: 1 ... 369 370 [371] 372 373 ... 796