• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Programming |OT| C is better than C++! No, C++ is better than C

Tomat

Wanna hear a good joke? Waste your time helping me! LOL!
This feeling of cheating will go away when you start writing non-trivial applications. Don't worry about it.

Is this a common feeling for new programmers? I have felt this way before, especially when Im doing something in a new language, or when I learn about something new that provides convenience. It's silly, but it still feels that way sometimes.
 

LukeTim

Member
I use PeopleSoft. The actual code part is called PeopleCode. Its pretty much an in house language used by the system. The system is web based, and the language resembles C++/Java without libraries. It's owned by oracle and had been used since the 60s I believe. If it tells you anything, some of the processes are still based off of COBOL.

Oh, wow...

The only things I know about COBOL are that it is very old, people who know it are rare, and yet it is still used in a lot of places.

Is this a common feeling for new programmers? I have felt this way before, especially when Im doing something in a new language, or when I learn about something new that provides convenience. It's silly, but it still feels that way sometimes.

I totally understand this... I was reluctant to use frameworks and libraries for a while, because I thought it was more fun to do it myself, I even implemented my own CMS and BBCode for a friend's blog... but once I started using them more and more I realized how much easier it becomes to add complexity to an application. I love 'em.
 
Is this a common feeling for new programmers?

Well, it's just that over the course of time, you will spend less time dealing with UI, less time dealing with trivial CRUD apps, and spend more time solving problems that require a good bit of code design skill. That code you feel "guilty" about being generated for you, well, there will simply be less of it, relatively speaking. You will be tasked with more important things as you grow in your knowledge, assuming you get on a career path that leverages and continuously enhances that knowledge.
 
Is this a common feeling for new programmers? I have felt this way before, especially when Im doing something in a new language, or when I learn about something new that provides convenience. It's silly, but it still feels that way sometimes.
Using Python or Ruby for anything feels like cheating ;)
 
Is this a common feeling for new programmers? I have felt this way before, especially when Im doing something in a new language, or when I learn about something new that provides convenience. It's silly, but it still feels that way sometimes.

I reckon its is for programmers who do most of their stuff in code in a editor.


Oh, wow...

The only things I know about COBOL are that it is very old, people who know it are rare, and yet it is still used in a lot of places.

I heard stories about those rare mystical creatures and dungeons where cobol code still lifes.
 

iapetus

Scary Euro Man
I dabbled in a bit of 6502 and had a lot of fun using a certain 6502 simulator.

I want to do the same with ARM, but everything I've read about ARM ASM said learning it is useless because 1) there are so many opcodes and commands, and 2) a C compiler will optimize better than a human ever can.

So that really turned me off a lot...

Most assemblers fall into the same category. If you're learning it, you're learning it for fun. ARM assembler is one of the few where that isn't a sign of insanity.

I just read up on FizzBuzz. People really can't do that? lol.

Though it did take me 6 or 7 years to discover the potential of modulo, so I probably wouldn't have been able to do it before 2007, either... I wasn't serious about programming until around that point, though.

Edit: I should learn to write posts on my phone faster. :(

Here are two of the golden rules of software engineering.

1. Mentioning FizzBuzz will cause most developers to express incredulity that anyone could possibly be unable to implement it at a moment's notice in a dozen ways, normally accompanied with an elegant implementation of FizzBuzz in their language of choice.

2. 75-80% of the implementations provided under rule #1 above will not work.
 

Magni

Member
How would you translate "Ruby gems" in Spanish? And am I right in assuming that "JavaScript libraries" is "bibliotecas JavaScript" ? (or is it "bibliotecas de JavaScript" ?)

I need to translate my resume in Spanish for an exchange semester application, and although I have a fairly good level of Spanish I'm completely lost for all the technical terms. Wikipedia is saving me over and over again :lol

edit: just thought about looking at the documentation in Spanish, duh >< For the curious, it's "gemas [de?] Ruby"

RubyGems es la herramienta preferida por la comunidad para distribuir código. Por lo general, las gemas tienen links hacia la documentación e información sobre los desarrolladores, así que es un buen punto de partida para comenzar a explorar el mundo Ruby.

edit2: getting more Google results for "biblioteca de javascipt" vs "biblioteca javascript" and likewise for "gema de ruby" vs "gema ruby" so I'm assuming it's the former.
 
How would you translate "Ruby gems" in Spanish? And am I right in assuming that "JavaScript libraries" is "bibliotecas JavaScript" ? (or is it "bibliotecas de JavaScript" ?)

I need to translate my resume in Spanish for an exchange semester application, and although I have a fairly good level of Spanish I'm completely lost for all the technical terms. Wikipedia is saving me over and over again :lol

edit: just thought about looking at the documentation in Spanish, duh >< For the curious, it's "gemas [de?] Ruby"



edit2: getting more Google results for "biblioteca de javascipt" vs "biblioteca javascript" and likewise for "gema de ruby" vs "gema ruby" so I'm assuming it's the former.

I guess people here would say : Javascript libraries = librerías de JavaScript (even though bibliotecas is the "right" translation).

And about the other you can just say: "gemas de Ruby"
 
Is there a way to make the border of a div only be visible for a % of the total border height? I dont want to remove the border but I want to "shorten" its visible border.
 
Most assemblers fall into the same category. If you're learning it, you're learning it for fun. ARM assembler is one of the few where that isn't a sign of insanity.



Here are two of the golden rules of software engineering.

1. Mentioning FizzBuzz will cause most developers to express incredulity that anyone could possibly be unable to implement it at a moment's notice in a dozen ways, normally accompanied with an elegant implementation of FizzBuzz in their language of choice.

Must... resist... fizz... buzzzzzzzzzz

Code:
fk = [0x46, 0x69]
tg = [0x42, 0x75]    
uj = fk + [0x7a, 0x7a] + tg
id = lambda x: x
p = [uj, id, id, fk, id, tg, fk, id, id, fk, tg, id, fk, id, id]
import string
for i in range(1 << 7654 >> 7654, (1 << 7) - (1 << 5) + (1 << 2)):
    t = callable(p[i % 15]) and p[i % 15](i)  \
        or string.join(map(chr, p[i % 15] + [0x7a, 0x7a])).replace(chr(0x20), '')  
    print t

2. 75-80% of the implementations provided under rule #1 above will not work.


:( can I have job plz?
 

Fireblend

Banned
How would you translate "Ruby gems" in Spanish? And am I right in assuming that "JavaScript libraries" is "bibliotecas JavaScript" ? (or is it "bibliotecas de JavaScript" ?)

I need to translate my resume in Spanish for an exchange semester application, and although I have a fairly good level of Spanish I'm completely lost for all the technical terms. Wikipedia is saving me over and over again :lol

edit: just thought about looking at the documentation in Spanish, duh >< For the curious, it's "gemas [de?] Ruby"



edit2: getting more Google results for "biblioteca de javascipt" vs "biblioteca javascript" and likewise for "gema de ruby" vs "gema ruby" so I'm assuming it's the former.

My native language is spanish and I live in latin america, and yet I think I'd have more trouble writing my CV in spanish than I've ever had in english. I wouldn't translate Ruby gems and other more technical terms, and like someone said above, libreria is much more used than biblioteca even though the latter is the sensical translation, but both are ok.
 

nan0

Member
My native language is spanish and I live in latin america, and yet I think I'd have more trouble writing my CV in spanish than I've ever had in english. I wouldn't translate Ruby gems and other more technical terms, and like someone said above, libreria is much more used than biblioteca even though the latter is the sensical translation, but both are ok.

I agree. "RubyGems" is actually the name of the package manager, and a "Gem" is a package of it. I wouldn't translate terms like this (you wouldn't translate "Windows" either). "JavaScript libraries" is something different, since it loosely sums up several things of the same type.
 
So I'm working on an Android App. I haven't done any smartphone development, so I've been reading through the official Google docs on Android. They are really well written from what I can tell and have good info on how the entire architecture is structured. One thing I haven't run into yet is how people typically go about doing client/server interactions.

Is it just all JSON over RESTful services? My current plan is to have a Spring based server-side architecture to handle http requests and feed JSON responses back to the clients. It seems the easiest/cleanest way to go about it. I'm just curious as to what the paradigm most people use is.

I think the biggest challenge for me right now is going to be design. Cause, basically I don't have a clue about design. I have some friends that are graphic designers, but I don't think they have any smartphone experience. I'll have to look into that some more.

Anyway, if anyone has any good articles/tutorials/what have you about client/server interactions in Android architecture, please point me to them!
 

leroidys

Member
Was working on a c project after I got off work on Saturday (~10 pm to 4 am), reached an impasse, got really frustrated, wasted a ton of time...

Today I realized that the problem was that I forgot the return statement for one of my functions.

REALLY GCC? YOU COULDN'T AT LEAST GIVE ME A WARNING WHEN I COMPILE? ugh
 

tuffy

Member
Today I realized that the problem was that I forgot the return statement for one of my functions.

REALLY GCC? YOU COULDN'T AT LEAST GIVE ME A WARNING WHEN I COMPILE? ugh

"gcc -Wreturn-type file.c" should give you a compile-time warning, like "control reaches end of non-void function", in this case. Though I usually just use "gcc -Wall".
 

Magni

Member
I guess people here would say : Javascript libraries = librerías de JavaScript (even though bibliotecas is the "right" translation).

And about the other you can just say: "gemas de Ruby"

My native language is spanish and I live in latin america, and yet I think I'd have more trouble writing my CV in spanish than I've ever had in english. I wouldn't translate Ruby gems and other more technical terms, and like someone said above, libreria is much more used than biblioteca even though the latter is the sensical translation, but both are ok.

I agree. "RubyGems" is actually the name of the package manager, and a "Gem" is a package of it. I wouldn't translate terms like this (you wouldn't translate "Windows" either). "JavaScript libraries" is something different, since it loosely sums up several things of the same type.

Thanks guys! I've been French-English bilingual for as long as I can literally remember (started learning English when I was 3 or 4), and I'd have no idea how to write my resume in French, so I know the feeling Fireblend :)

For Ruby gems, I found "gemas de Ruby" on the official Spanish documentation, so I think I'm gonna go with that. For biblioteca/librería, I originally went with what was used on wiki, but I'll trust you guys if you say librería is more used. After all I hear librairie 20x more than I hear bibliothèque in French :lol
 

upandaway

Member
I tried as hard as possible but I really don't know how I'm supposed to use unit testing to drive development. I read way too much about it but I still don't get it.

For exercise's sake I'm trying to write Space Invaders (I figured I'd just do as many classics as possible using the Java API until I get more confident). First I decided on the classes, then... what. Write unit tests before even thinking about the methods/instance variables inside the classes? Or decide on the methods and then write unit tests before writing the methods? It doesn't work for me either way. My head is what.

Can anyone help me out here please
 

Aeris130

Member
Tests drive design and implementation, but you're going to figure out what functions to test before starting. A rough design helps even if you don't have any logic.

  1. Pick a single functionality that you want your code/classes to do (spaceship bullet colliding with obstacle reduces obstacle HP by 1). Write a test that makes sure this happens (you can write skeleton code that does nothing to give your tests something to call).
  2. Run the test, see it fail. Important since otherwise you'll risk having tests that cannot fail.
  3. Implement code that makes the test pass. Doesn't matter if you know you'll have to change it later to accomodate future functionality, only write the bare minimum required to pass the test. Don't even bother putting stuff like nullchecks in, write a separate test for that. 1 test = 1 functionality.
  4. Run the test again, see it pass (or fix your code until it does). Your code can now reduce an obstacles HP by 1 when hit. Start over at #1 and pick a new task. If the new task requires you to fiddle with your previous code, no problem. You have a test that guarantees you won't break anything.
 

upandaway

Member
Tests drive design and implementation, but you're going to figure out what functions to test before starting. A rough design helps even if you don't have any logic.

  1. Pick a single functionality that you want your code/classes to do (spaceship bullet colliding with obstacle reduces obstacle HP by 1). Write a test that makes sure this happens (you can write skeleton code that does nothing to give your tests something to call).
  2. Run the test, see it fail. Important since otherwise you'll risk having tests that cannot fail.
  3. Implement code that makes the test pass. Doesn't matter if you know you'll have to change it later to accomodate future functionality, only write the bare minimum required to pass the test. Don't even bother putting stuff like nullchecks in, write a separate test for that. 1 test = 1 functionality.
  4. Run the test again, see it pass (or fix it until it does). Your code can now reduce an obstacles HP by 1 when hit. Start over at 1 and pick a new task. If the new task requires you to fiddle with your previous code, no problem. You have a test that guarantees you won't break anything.
This is what happens when I tried following this (tweaked to use your example)
1. Wrote the test, pretty simple
2. Ran it, it failed, felt like a genius (not really but I was freaking out a bit)
3. Wrote the following code for the method (and added all the instance variables as needed on the fly):
Code:
public void hitByBullet () {
    //check if hit
    //reduce HP by one
}
Here I start to lose my composure because I want this to be in 3 methods - one to check if he's hit, one to reduce the HP (takes the amount to reduce it), and one that calls the first and then calls the second with the appropriate amount of HP to lose, which will ultimately be the one I call from the engine (it'll be a method inherited into all enemy types). But if I only think in terms of tests, it's not a good idea to do this, but rather the above. Also, because I'm only writing the code to make the test pass, I'm not even sure I need to check if the enemy is hit.

I think it might just be too early for me to try this or something.

Just let your company testers do all the work for you.
If I ever code professionally it won't happen for at least, like, 5 years!
 

Aeris130

Member
This is what happens when I tried following this (tweaked to use your example)
1. Wrote the test, pretty simple
2. Ran it, it failed, felt like a genius (not really but I was freaking out a bit)
3. Wrote the following code for the method (and added all the instance variables as needed on the fly):
Code:
public void hitByBullet () {
    //check if hit
    //reduce HP by one
}
Here I start to lose my composure because I want this to be in 3 methods - one to check if he's hit, one to reduce the HP (takes the amount to reduce it), and one that calls the first and then calls the second with the appropriate amount of HP to lose, which will ultimately be the one I call from the engine (it'll be a method inherited into all enemy types). But if I only think in terms of tests, it's not a good idea to do this, but rather the above. Also, because I'm only writing the code to make the test pass, I'm not even sure I need to check if the enemy is hit.

I think it might just be too early for me to try this or something.

Given the above design, start by testing hitByBullet() with the obstacle getting hit. Only fill hitByBullet() with code that reduces HP by 1 (nothing else), so now the test passes.

Then write another test for hitByBullet() with an obstacle not being hit. HP should remain the same, but it obviously won't (it'll be reduce by 1 either way). Now add logic to hitByBullet() that doesn't reduce HP of things that aren't hit, while still preserving the ability to hurt things that are hit. Now both tests should pass.

Replace the reduction logic with it's own function after writing a test for it (the function). Now the first test should fail again on top of the new one since HP isn't being reduced again. Fill in the logic in the function, now all three tests should work.
 

upandaway

Member
Hmm I get it. That seems like it will require a lot of concentration if I scale it up, but I'll try going with that attitude. Thanks.

I'll be honest though... then it feels like I'll be shaping my tests around what I want the final product to be. I'm supposed to be arriving at the 3 methods after only considering which tests I want, not the other way around, right?
 
By the way why the "largely"? What are the exceptions?

I wasn't serious. I would actually say it's the other way around--there are some areas where unit tests aren't exactly the most useful. I think TDD doesn't work as well as some other architectural paradigms, but that doesn't mean that other architectural paradigms don't require testing. I think the biggest flaw in unit tests is that some people use them in lieu of integration testing or ignore the need to do regression testing because all of their unit tests still pass.
 

Aeris130

Member
Hmm I get it. That seems like it will require a lot of concentration if I scale it up, but I'll try going with that attitude. Thanks.

I'll be honest though... then it feels like I'll be shaping my tests around what I want the final product to be. I'm supposed to be arriving at the 3 methods after only considering which tests I want, not the other way around, right?

Start by coming up with what you want the program to do, then decide what tests can be used to check that it does it, then decide what code is needed to pass the tests.
 
Trade training. In a few years Wolfram Alpha and Google's equivalent will become self-aware and human coding will become obsolete.

serious answer plz, I already completed the math prerequisites (86% average in calculus and advance functions). I am going through physics I and II right now, my friend told me to stay away from programming and recommended that I study math instead (become a teacher).

I have three options:

do nothing and continue working as a security guard
start learning programming
or bet a bachelors in math
 

usea

Member
upandaway I totally understand your problem getting into TDD. When I think about a problem, my brain already starts solving it and I have lots of different solutions architected in my mind before I even start typing. Ignoring all that seems impossible. I struggle a lot with TDD, although I haven't practiced it much.
You guys are complicated
This is the nicest way I've ever seen somebody say troll.
 

LukeTim

Member
serious answer plz, I already completed the math prerequisites (86% average in calculus and advance functions). I am going through physics I and II right now, my friend told me to stay away from programming and recommended that I study math instead (become a teacher)

A lot of mathematicians get into programming too... they do compliment each other.

You shouldn't choose a subject based on career prospects, though. Choose a subject you enjoy and are fascinated by.
 

Lonely1

Unconfirmed Member
serious answer plz, I already completed the math prerequisites (86% average in calculus and advance functions). I am going through physics I and II right now, my friend told me to stay away from programming and recommended that I study math instead (become a teacher).

I have three options:

do nothing and continue working as a security guard
start learning programming
or bet a bachelors in math

You could learn programming while getting your bachelors in Math. I did something very similar, though my situation is probably very different than yours (not in the USA).
 
You could learn programming while getting your bachelors in Math. I did something very similar, though my situation is probably very different than yours (not in the USA).

that's a good idea!

A lot of mathematicians get into programming too... they do compliment each other.

You shouldn't choose a subject based on career prospects, though. Choose a subject you enjoy and are fascinated by.

well I am most fascinated by astronomy and the brain, but sadly it is too late for those things now. I am 28 :/ I just stick to reading books on astronomy and neurology

anyway thnx for the input
 

Lonely1

Unconfirmed Member
that's a good idea!



well I am most fascinated by astronomy and the brain, but sadly it is too late for those things now. I am 28 :/ I just stick to reading books on astronomy and neurology

anyway thnx for the input

Studying neurology from a CS point of view is a fascinating and fruitful field, though. And never is too old :(.
 
that's a good idea!



well I am most fascinated by astronomy and the brain, but sadly it is too late for those things now. I am 28 :/ I just stick to reading books on astronomy and neurology

anyway thnx for the input

28 isn't too late at all, btw. I started a bit late myself. No one cares at all.
 

LukeTim

Member
well I am most fascinated by astronomy and the brain, but sadly it is too late for those things now. I am 28 :/ I just stick to reading books on astronomy and neurology

anyway thnx for the input

It's never too late for anything. If you want to do something, do it.

When I was getting my Bachelors there were guys there who were in their 40s who were getting their first degree.

In fact, I have plans to go into Neuroscience myself. They love Mathematicians, Programmers, Physicists etc. in Neuroscience.
 
Thanks for the encouragement you guys! Coming to this thread has re energized me a bit, I have been wasting far too much time on video games and neogaf these days. I should be studying phyisics right now!
 
Thanks for the encouragement you guys! Coming to this thread has re energized me a bit, I have been wasting far too much time on video games and neogaf these days. I should be studying phyisics right now!

Totally, have fun with it. But don't study 24/7.

I went back to school, did a degree in astrophysics and I'm doing my phd in astronomy right now. If you want to do it it's definitely attainable.
 
Totally, have fun with it. But don't study 24/7.

I went back to school, did a degree in astrophysics and I'm doing my phd in astronomy right now. If you want to do it it's definitely attainable.

Last year when I was upgrading my math, I used to study 10 hours a day. I really loved it! 24/7 is too much, now I have to balance study and work both at the same time, but yea been slacking off for a while (damn night shifts)

But thnx again, your words go a long way to encourage me. Sorry for going off topic.
 
Last year when I was upgrading my math, I used to study 10 hours a day. I really loved it! 24/7 is too much, now I have to balance study and work both at the same time, but yea been slacking off for a while (damn night shifts)

But thnx again, your words go a long way to encourage me. Sorry for going off topic.

No problem. If you have any questions later feel free to shoot me a PM.
 

hateradio

The Most Dangerous Yes Man
Thanks guys! I've been French-English bilingual for as long as I can literally remember (started learning English when I was 3 or 4), and I'd have no idea how to write my resume in French, so I know the feeling Fireblend :)

For Ruby gems, I found "gemas de Ruby" on the official Spanish documentation, so I think I'm gonna go with that. For biblioteca/librería, I originally went with what was used on wiki, but I'll trust you guys if you say librería is more used. After all I hear librairie 20x more than I hear bibliothèque in French :lol
A little late, but I think people misuse the world librería. It actually means bookstore, while biblioteca is a collection of things or an actual library building.

I think in that case, biblioteca de JavaScript would makes sense, but since library-librería resemble each other, people typically fuck it up.
 
Top Bottom